]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: don't cache acl on overlay layer
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 1 Sep 2016 09:11:59 +0000 (11:11 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 1 Sep 2016 09:11:59 +0000 (11:11 +0200)
commit915aad6ec5ac86170f2540be6f79b2d0e8c96c8b
tree4615559df3c1faddf9ef388adce449fb8e89f680
parent1e1cf4a6b075ea83a830ebeb756b8df8977ab98f
ovl: don't cache acl on overlay layer

Some operations (setxattr/chmod) can make the cached acl stale.  We either
need to clear overlay's acl cache for the affected inode or prevent acl
caching on the overlay altogether.  Preventing caching has the following
advantages:

 - no double caching, less memory used

 - overlay cache doesn't go stale when fs clears it's own cache

Possible disadvantage is performance loss.  If that becomes a problem
get_acl() can be optimized for overlayfs.

This patch disables caching by pre setting i_*acl to a value that

  - has bit 0 set, so is_uncached_acl() will return true

  - is not equal to ACL_NOT_CACHED, so get_acl() will not overwrite it

The constant -3 was chosen for this purpose.

Fixes: e54439229971 ("ovl: define ->get_acl() for overlay inodes")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/inode.c
include/linux/fs.h