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 '6.10-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:

- two important netfs integration fixes - including for a data
corruption and also fixes for multiple xfstests

- reenable swap support over SMB3

* tag '6.10-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
cifs: Fix missing set of remote_i_size
cifs: Fix smb3_insert_range() to move the zero_point
cifs: update internal version number
smb3: reenable swapfiles over SMB3 mounts

+34 -6
+2 -1
fs/netfs/direct_write.c
··· 27 27 * Perform an unbuffered write where we may have to do an RMW operation on an 28 28 * encrypted file. This can also be used for direct I/O writes. 29 29 */ 30 - static ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov_iter *iter, 30 + ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov_iter *iter, 31 31 struct netfs_group *netfs_group) 32 32 { 33 33 struct netfs_io_request *wreq; ··· 117 117 netfs_put_request(wreq, false, netfs_rreq_trace_put_return); 118 118 return ret; 119 119 } 120 + EXPORT_SYMBOL(netfs_unbuffered_write_iter_locked); 120 121 121 122 /** 122 123 * netfs_unbuffered_write_iter - Unbuffered write to a file
+3 -3
fs/smb/client/cifsfs.c
··· 1226 1226 struct cifsFileInfo *smb_file_src = src_file->private_data; 1227 1227 struct cifsFileInfo *smb_file_target = dst_file->private_data; 1228 1228 struct cifs_tcon *target_tcon, *src_tcon; 1229 - unsigned long long destend, fstart, fend, new_size; 1229 + unsigned long long destend, fstart, fend, old_size, new_size; 1230 1230 unsigned int xid; 1231 1231 int rc; 1232 1232 ··· 1293 1293 goto unlock; 1294 1294 if (fend > target_cifsi->netfs.zero_point) 1295 1295 target_cifsi->netfs.zero_point = fend + 1; 1296 + old_size = target_cifsi->netfs.remote_i_size; 1296 1297 1297 1298 /* Discard all the folios that overlap the destination region. */ 1298 1299 cifs_dbg(FYI, "about to discard pages %llx-%llx\n", fstart, fend); ··· 1306 1305 if (target_tcon->ses->server->ops->duplicate_extents) { 1307 1306 rc = target_tcon->ses->server->ops->duplicate_extents(xid, 1308 1307 smb_file_src, smb_file_target, off, len, destoff); 1309 - if (rc == 0 && new_size > i_size_read(target_inode)) { 1308 + if (rc == 0 && new_size > old_size) { 1310 1309 truncate_setsize(target_inode, new_size); 1311 - netfs_resize_file(&target_cifsi->netfs, new_size, true); 1312 1310 fscache_resize_cookie(cifs_inode_cookie(target_inode), 1313 1311 new_size); 1314 1312 }
+2 -2
fs/smb/client/cifsfs.h
··· 147 147 #endif /* CONFIG_CIFS_NFSD_EXPORT */ 148 148 149 149 /* when changing internal version - update following two lines at same time */ 150 - #define SMB3_PRODUCT_BUILD 48 151 - #define CIFS_VERSION "2.48" 150 + #define SMB3_PRODUCT_BUILD 49 151 + #define CIFS_VERSION "2.49" 152 152 #endif /* _CIFSFS_H */
+23
fs/smb/client/file.c
··· 3189 3189 /* do we need to unpin (or unlock) the file */ 3190 3190 } 3191 3191 3192 + /** 3193 + * cifs_swap_rw - SMB3 address space operation for swap I/O 3194 + * @iocb: target I/O control block 3195 + * @iter: I/O buffer 3196 + * 3197 + * Perform IO to the swap-file. This is much like direct IO. 3198 + */ 3199 + static int cifs_swap_rw(struct kiocb *iocb, struct iov_iter *iter) 3200 + { 3201 + ssize_t ret; 3202 + 3203 + WARN_ON_ONCE(iov_iter_count(iter) != PAGE_SIZE); 3204 + 3205 + if (iov_iter_rw(iter) == READ) 3206 + ret = netfs_unbuffered_read_iter_locked(iocb, iter); 3207 + else 3208 + ret = netfs_unbuffered_write_iter_locked(iocb, iter, NULL); 3209 + if (ret < 0) 3210 + return ret; 3211 + return 0; 3212 + } 3213 + 3192 3214 const struct address_space_operations cifs_addr_ops = { 3193 3215 .read_folio = netfs_read_folio, 3194 3216 .readahead = netfs_readahead, ··· 3226 3204 */ 3227 3205 .swap_activate = cifs_swap_activate, 3228 3206 .swap_deactivate = cifs_swap_deactivate, 3207 + .swap_rw = cifs_swap_rw, 3229 3208 }; 3230 3209 3231 3210 /*
+2
fs/smb/client/smb2ops.c
··· 2028 2028 * size will be queried on next revalidate, but it is important 2029 2029 * to make sure that file's cached size is updated immediately 2030 2030 */ 2031 + netfs_resize_file(netfs_inode(inode), dest_off + len, true); 2031 2032 cifs_setsize(inode, dest_off + len); 2032 2033 } 2033 2034 rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid, ··· 3637 3636 rc = smb2_copychunk_range(xid, cfile, cfile, off, count, off + len); 3638 3637 if (rc < 0) 3639 3638 goto out_2; 3639 + cifsi->netfs.zero_point = new_eof; 3640 3640 3641 3641 rc = smb3_zero_data(file, tcon, off, len, xid); 3642 3642 if (rc < 0)
+2
include/linux/netfs.h
··· 400 400 ssize_t netfs_buffered_write_iter_locked(struct kiocb *iocb, struct iov_iter *from, 401 401 struct netfs_group *netfs_group); 402 402 ssize_t netfs_unbuffered_write_iter(struct kiocb *iocb, struct iov_iter *from); 403 + ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov_iter *iter, 404 + struct netfs_group *netfs_group); 403 405 ssize_t netfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from); 404 406 405 407 /* Address operations API */