linux/fs/overlayfs
Miklos Szeredi c568d68341 locks: fix file locking on overlayfs
This patch allows flock, posix locks, ofd locks and leases to work
correctly on overlayfs.

Instead of using the underlying inode for storing lock context use the
overlay inode.  This allows locks to be persistent across copy-up.

This is done by introducing locks_inode() helper and using it instead of
file_inode() to get the inode in locking code.  For non-overlayfs the two
are equivalent, except for an extra pointer dereference in locks_inode().

Since lock operations are in "struct file_operations" we must also make
sure not to call underlying filesystem's lock operations.  Introcude a
super block flag MS_NOREMOTELOCK to this effect.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Acked-by: Jeff Layton <jlayton@poochiereds.net>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
2016-09-16 12:44:20 +02:00
..
copy_up.c ovl: don't copy up opaqueness 2016-08-08 15:08:49 +02:00
dir.c ovl: Switch to generic_getxattr 2016-09-01 11:12:00 +02:00
inode.c ovl: listxattr: use strnlen() 2016-09-01 11:12:00 +02:00
Kconfig ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
Makefile ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
overlayfs.h ovl: Switch to generic_getxattr 2016-09-01 11:12:00 +02:00
readdir.c ovl: proper cleanup of workdir 2016-09-01 11:11:59 +02:00
super.c locks: fix file locking on overlayfs 2016-09-16 12:44:20 +02:00