Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'v6.17-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:

- Fix possible refcount leak in compound operations

- Fix remap_file_range() return code mapping, found by generic/157

* tag 'v6.17-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
fs/smb: Fix inconsistent refcnt update
smb3 client: fix return code mapping of remap_file_range

+19 -2
+14
fs/smb/client/cifsfs.c
··· 1358 1358 truncate_setsize(target_inode, new_size); 1359 1359 fscache_resize_cookie(cifs_inode_cookie(target_inode), 1360 1360 new_size); 1361 + } else if (rc == -EOPNOTSUPP) { 1362 + /* 1363 + * copy_file_range syscall man page indicates EINVAL 1364 + * is returned e.g when "fd_in and fd_out refer to the 1365 + * same file and the source and target ranges overlap." 1366 + * Test generic/157 was what showed these cases where 1367 + * we need to remap EOPNOTSUPP to EINVAL 1368 + */ 1369 + if (off >= src_inode->i_size) { 1370 + rc = -EINVAL; 1371 + } else if (src_inode == target_inode) { 1372 + if (off + len > destoff) 1373 + rc = -EINVAL; 1374 + } 1361 1375 } 1362 1376 if (rc == 0 && new_size > target_cifsi->netfs.zero_point) 1363 1377 target_cifsi->netfs.zero_point = new_size;
+5 -2
fs/smb/client/smb2inode.c
··· 207 207 server = cifs_pick_channel(ses); 208 208 209 209 vars = kzalloc(sizeof(*vars), GFP_ATOMIC); 210 - if (vars == NULL) 211 - return -ENOMEM; 210 + if (vars == NULL) { 211 + rc = -ENOMEM; 212 + goto out; 213 + } 212 214 rqst = &vars->rqst[0]; 213 215 rsp_iov = &vars->rsp_iov[0]; 214 216 ··· 866 864 smb2_should_replay(tcon, &retries, &cur_sleep)) 867 865 goto replay_again; 868 866 867 + out: 869 868 if (cfile) 870 869 cifsFileInfo_put(cfile); 871 870