Commit 9ed92167 authored by Ramon Nou's avatar Ramon Nou
Browse files

fix s3d

parent 0ea0fd9a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1087,8 +1087,10 @@ rpc_srv_write_data_inline(hg_handle_t handle) {
        }

        // 1. Check limits
        if(in.offset + in.count > gkfs::config::metadata::inline_data_size) {
            out.err = EFBIG; // File too large for inline
        if(in.offset + in.count > gkfs::config::metadata::inline_data_size ||
           md.size() > gkfs::config::metadata::inline_data_size ||
           (md.size() > 0 && md.inline_data().empty())) {
            out.err = EFBIG; // File too large for inline or already in chunks
        } else {
            // 2. Prepare data string from input buffer
            // Note: in.data is a hg_const_string_t (char*)
+2 −0
Original line number Diff line number Diff line
@@ -161,3 +161,5 @@ def test_inline_overflow_pwrite(gkfs_daemon, gkfs_client):
    assert read_buf[0:100] == buf1
    assert read_buf[100:offset] == b'\x00' * (offset - 100)
    assert read_buf[offset:offset+100] == buf2