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.

NFSD: pass range end to vfs_fsync_range() instead of count

_nfsd_copy_file_range() calls vfs_fsync_range() with an offset and
count (bytes written), but the former wants the start and end bytes
of the range to sync. Fix it up.

Fixes: eac0b17a77fb ("NFSD add vfs_fsync after async copy is done")
Signed-off-by: Brian Foster <bfoster@redhat.com>
Tested-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Brian Foster and committed by
Chuck Lever
79a1d88a 9f27783b

+3 -2
+3 -2
fs/nfsd/nfs4proc.c
··· 1642 1642 u64 src_pos = copy->cp_src_pos; 1643 1643 u64 dst_pos = copy->cp_dst_pos; 1644 1644 int status; 1645 + loff_t end; 1645 1646 1646 1647 /* See RFC 7862 p.67: */ 1647 1648 if (bytes_total == 0) ··· 1662 1661 /* for a non-zero asynchronous copy do a commit of data */ 1663 1662 if (nfsd4_copy_is_async(copy) && copy->cp_res.wr_bytes_written > 0) { 1664 1663 since = READ_ONCE(dst->f_wb_err); 1665 - status = vfs_fsync_range(dst, copy->cp_dst_pos, 1666 - copy->cp_res.wr_bytes_written, 0); 1664 + end = copy->cp_dst_pos + copy->cp_res.wr_bytes_written - 1; 1665 + status = vfs_fsync_range(dst, copy->cp_dst_pos, end, 0); 1667 1666 if (!status) 1668 1667 status = filemap_check_wb_err(dst->f_mapping, since); 1669 1668 if (!status)