summaryrefslogtreecommitdiff
path: root/fs/overlayfs/readdir.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-07-07 14:04:44 (GMT)
committerMiklos Szeredi <miklos@szeredi.hu>2016-03-21 16:31:45 (GMT)
commitfb5bb2c3b73df060d588b6521de5ab03589283f7 (patch)
tree1b55a911a8e69efee962e65e7935b815a0c15fd6 /fs/overlayfs/readdir.c
parent07f2af7bfd247857b1bf16ae7f479b5b6f4ef305 (diff)
downloadlinux-fb5bb2c3b73df060d588b6521de5ab03589283f7.tar.xz
ovl: Warn on copy up if a process has a R/O fd open to the lower file
Print a warning when overlayfs copies up a file if the process that triggered the copy up has a R/O fd open to the lower file being copied up. This can help catch applications that do things like the following: fd1 = open("foo", O_RDONLY); fd2 = open("foo", O_RDWR); where they expect fd1 and fd2 to refer to the same file - which will no longer be the case post-copy up. With this patch, the following commands: bash 5</mnt/a/foo128 6<>/mnt/a/foo128 assuming /mnt/a/foo128 to be an un-copied up file on an overlay will produce the following warning in the kernel log: overlayfs: Copying up foo129, but open R/O on fd 5 which will cease to be coherent [pid=3818 bash] This is enabled by setting: /sys/module/overlay/parameters/check_copy_up to 1. The warnings are ratelimited and are also limited to one warning per file - assuming the copy up completes in each case. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/readdir.c')
0 files changed, 0 insertions, 0 deletions