gfs2: Fix and clean up {GET,SET}FLAGS ioctl
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 9 Oct 2017 14:15:30 +0000 (16:15 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 31 Oct 2017 13:26:57 +0000 (14:26 +0100)
commitb16f7e57b7811d5c60ef1858bd92339be28359bf
treeb274da6550404d162202afba2b62c6da6a63d460
parent61d6899ad4268b6d95187053740fcb17a0d31632
gfs2: Fix and clean up {GET,SET}FLAGS ioctl

Switch to a simple array for mapping between the FS_*_FL and GFS_DIF_*
flags.  Clarify how the mapping between FS_JOURNAL_DATA_FL and the
filesystem flags works.  The GFS2_DIF_SYSTEM flag cannot be set from
user space, so remove it from GFS2_FLAGS_USER_SET.  Fail with -EINVAL
when trying to set flags that are not supported instead of silently
ignoring those flags.

Partially fixes xfstest generic/424.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/file.c