Commit bd5613f3 authored by Trond Myklebust's avatar Trond Myklebust Committed by Yang Yingliang
Browse files

nfsd: Ensure CLONE persists data and metadata changes to the target file



mainline inclusion
from mainline-v5.5-rc1
commit a25e3726
category: bugfix
bugzilla: 27346
CVE: NA

-------------------------------------------------

The NFSv4.2 CLONE operation has implicit persistence requirements on the
target file, since there is no protocol requirement that the client issue
a separate operation to persist data.
For that reason, we should call vfs_fsync_range() on the destination file
after a successful call to vfs_clone_file_range().

Fixes: ffa0160a ("nfsd: implement the NFSv4.2 CLONE operation")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Cc: stable@vger.kernel.org # v4.5+
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>

Conflicts:
	fs/nfsd/nfs4proc.c
	fs/nfsd/vfs.c
42ec3d4c ("vfs: make remap_file_range functions take and return bytes
completed")
2e5dfc99 ("vfs: combine the clone and dedupe into a single
remap_file_range")

Signed-off-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 46325589
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment