f2fs: restrict setting up inode.i_advise
authorChao Yu <yuchao0@huawei.com>
Thu, 19 Jul 2018 15:57:54 +0000 (23:57 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 5 Sep 2018 22:12:55 +0000 (15:12 -0700)
commit75c16e310e9dba614e475454049aa3795536d7ad
tree1c875df8ac8daa51af9e641a6088479309aff6fb
parent29b4a3803b890f919c92908003d9aba682dba6bd
f2fs: restrict setting up inode.i_advise

In order to give advise to f2fs to recognize hot/cold file, it is possible
that we can set specific bit in inode.i_advise through setxattr(), but
there are several bits which are used internally, such as encrypt_bit,
keep_size_bit, they should never be changed through setxattr().

So that this patch 1) adds FADVISE_MODIFIABLE_BITS to filter modifiable
bits user given, 2) supports to clear {hot,cold}_file bits.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/xattr.c