]> git.baikalelectronics.ru Git - kernel.git/commit
fs: Move notify_change permission checks into may_setattr
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 28 Jul 2021 12:47:33 +0000 (07:47 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 13 Aug 2021 04:41:05 +0000 (00:41 -0400)
commit07922b1ca28ef3d40f2a5065156703b99ea343dd
treeea8c59e2b72ecbc9fcacc0ecf91f349f1a480989
parentb1b49cbcf8bd66059ed6f80c573a7ff83991d8ef
fs: Move notify_change permission checks into may_setattr

Move the permission checks in notify_change into a separate function to
make them available to filesystems.

When notify_change is called, the vfs performs those checks before
calling into iop->setattr.  However, a filesystem like gfs2 can only
lock and revalidate the inode inside ->setattr, and it must then repeat
those checks to err on the safe side.

It would be nice to get rid of the double checking, but moving the
permission check into iop->setattr altogether isn't really an option.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/attr.c
include/linux/fs.h