generic: clear of suid/sgid on direct write

Check that suid/sgid bits are cleared on direct write. XFS triggered
WARN_ON_ONCE in this case. Patchset from Jan Kara fixed the warning:

http://oss.sgi.com/archives/xfs/2014-12/msg00071.html

This test is inspired by a test case from Eric Sandeen, and follows
the test steps in generic/193. This test requires direct I/O, it's
not added to generic/193 but to a new test, so that generic/193
still runs on filesystems don't have direct I/O support.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Eryu Guan
2016-05-26 13:59:48 +08:00
parent 86e7366e84
commit 6f54d8136b
3 changed files with 113 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
QA output created by 355
Check that suid/sgid bits are cleared after direct write
== with no exec perm
before: -rwSr-Sr--
after: -rw-r-Sr--
== with user exec perm
before: -rwsr-Sr--
after: -rwxr-Sr--
== with group exec perm
before: -rwSr-sr--
after: -rw-r-xr--
== with user+group exec perm
before: -rwsr-sr--
after: -rwxr-xr--