]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vfs: swap names of {do,vfs}_clone_file_range()
authorAmir Goldstein <amir73il@gmail.com>
Mon, 22 Oct 2018 17:56:46 +0000 (20:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:49:44 +0000 (07:49 -0800)
commit1d15a9f087040c3ec6ba4671a2771eb47f6cbdc7
tree6fc9ba6008f5dbe86d8c486da176495321c229ad
parentde1341b7a671bff0f8a654df763191318ef585d7
vfs: swap names of {do,vfs}_clone_file_range()

commit a725356b6659469d182d662f22d770d83d3bc7b5 upstream.

Commit 031a072a0b8a ("vfs: call vfs_clone_file_range() under freeze
protection") created a wrapper do_clone_file_range() around
vfs_clone_file_range() moving the freeze protection to former, so
overlayfs could call the latter.

The more common vfs practice is to call do_xxx helpers from vfs_xxx
helpers, where freeze protecction is taken in the vfs_xxx helper, so
this anomality could be a source of confusion.

It seems that commit 8ede205541ff ("ovl: add reflink/copyfile/dedup
support") may have fallen a victim to this confusion -
ovl_clone_file_range() calls the vfs_clone_file_range() helper in the
hope of getting freeze protection on upper fs, but in fact results in
overlayfs allowing to bypass upper fs freeze protection.

Swap the names of the two helpers to conform to common vfs practice
and call the correct helpers from overlayfs and nfsd.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 031a072a0b8a ("vfs: call vfs_clone_file_range() under freeze...")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ioctl.c
fs/nfsd/vfs.c
fs/overlayfs/copy_up.c
fs/read_write.c
include/linux/fs.h