summaryrefslogtreecommitdiff
path: root/fs/overlayfs/file.c
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2018-05-11 18:49:33 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2018-07-20 10:56:17 +0300
commit997336f2c3053b74ec8c9d2d368ddd960f2fc8b6 (patch)
treea66cb2bb959049f180195aaedb482e9556832833 /fs/overlayfs/file.c
parentd1e6f6a94d6cefed2b6f7a222853ebcd2805b43b (diff)
downloadlinux-997336f2c3053b74ec8c9d2d368ddd960f2fc8b6.tar.xz
ovl: Do not do metadata only copy-up for truncate operation
truncate should copy up full file (and not do metacopy only), otherwise it will be broken. For example, use truncate to increase size of a file so that any read beyong existing size will return null bytes. If we don't copy up full file, then we end up opening lower file and read from it only reads upto the old size (and not new size after truncate). Hence to avoid such situations, copy up data as well when file size changes. So far it was being done by d_real(O_WRONLY) call in truncate() path. Now that patch has been reverted. So force full copy up in ovl_setattr() if size of file is changing. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/file.c')
0 files changed, 0 insertions, 0 deletions