f2fs: separate f2fs i_flags from fs_flags and ext4 i_flags
authorEric Biggers <ebiggers@google.com>
Wed, 5 Jun 2019 05:59:04 +0000 (22:59 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 21 Jun 2019 17:41:57 +0000 (10:41 -0700)
commit360985573b556db415daf93e34ce103ec0ee1fe5
tree38acf6c42f75d1b6de5205987d94f15544e873ed
parent176ef3c4dea3d9d6f7e7fd9a44feac3cd0c78be7
f2fs: separate f2fs i_flags from fs_flags and ext4 i_flags

f2fs copied all the on-disk i_flags from ext4, and along with it the
assumption that the on-disk i_flags are the same as the bits used by
FS_IOC_GETFLAGS and FS_IOC_SETFLAGS.  This is problematic because
reserving an on-disk inode flag in either filesystem's i_flags or in
these ioctls effectively reserves it in all the other places too.  In
fact, most of the "f2fs i_flags" are not used by f2fs at all.

Fix this by separating f2fs's i_flags from the ioctl bits and ext4's
i_flags.

In the process, un-reserve all "f2fs i_flags" that aren't actually
supported by f2fs.  This included various flags that were not settable
at all, as well as various flags that were settable by FS_IOC_SETFLAGS
but didn't actually do anything.

There's a slight chance we'll need to add some flag(s) back to
FS_IOC_SETFLAGS in order to avoid breaking users who expect f2fs to
accept some random flag(s).  But hopefully such users don't exist.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/file.c