Whamcloud - gitweb
LU-11944 llite: Lock inode on tiny write if setuid/setgid set 18/34218/4
authorAnn Koehler <amk@cray.com>
Fri, 8 Feb 2019 21:41:37 +0000 (15:41 -0600)
committerOleg Drokin <green@whamcloud.com>
Sun, 3 Mar 2019 00:21:39 +0000 (00:21 +0000)
commitf39a552922ca2db0c6974374fa3a917a34a4a747
treeab81eed18374332ea36143d83037185ca88b035a
parent5ce10d8850a3d104193a634ca6ee796299fd6270
LU-11944 llite: Lock inode on tiny write if setuid/setgid set

During a write, the setuid/setgid bits must be reset if they are
enabled and the user does not have the correct permissions. Setting
any file attributes, including setuid and setgid, requires the inode
to be locked. Writes became lockless with the introduction of
LU-1669. Locking the inode in the setuid/setgid case was added to
vvp_io_write_start() as a special case. The inode locking was not
included when support for tiny writes was added with LU-9409. This
mod adds the necessary inode lock/unlock calls to ll_do_tiny_write().

If the inode is not locked when setuid/setgid are reset, the kernel
will issue a one time warning and Lustre may hang trying to get the
inode lock in ll_setattr_raw().

Signed-off-by: Ann Koehler <amk@cray.com>
Change-Id: I5e8a98789828de52dbff4226958741320aba92e6
Reviewed-on: https://review.whamcloud.com/34218
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c
lustre/llite/vvp_io.c