summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/fs.h
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-09-16 12:44:20 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2016-09-16 12:44:20 +0200
commitc568d68341be7030f5647def68851e469b21ca11 (patch)
treefe205e47e6d6d292557580c16ea0186a05752634 /include/uapi/linux/fs.h
parentf3fbbb079263bd29ae592478de6808db7e708267 (diff)
downloadlinux-c568d68341be7030f5647def68851e469b21ca11.tar.gz
linux-c568d68341be7030f5647def68851e469b21ca11.tar.bz2
linux-c568d68341be7030f5647def68851e469b21ca11.zip
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>
Diffstat (limited to 'include/uapi/linux/fs.h')
-rw-r--r--include/uapi/linux/fs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index 3b00f7c8943f..2473272169f2 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -132,6 +132,7 @@ struct inodes_stat_t {
#define MS_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */
/* These sb flags are internal to the kernel */
+#define MS_NOREMOTELOCK (1<<27)
#define MS_NOSEC (1<<28)
#define MS_BORN (1<<29)
#define MS_ACTIVE (1<<30)