f2fs: load inode's flag from disk
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 16 May 2017 20:20:16 +0000 (13:20 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 24 May 2017 04:05:31 +0000 (21:05 -0700)
commit93607124c5450148e592c3d18ac533b4e5f25b8b
tree05e24d9ac81e9fd14834f650df7f0a2113d5b448
parent15d3042a937c13f5d9244241c7a9c8416ff6e82a
f2fs: load inode's flag from disk

This patch fixes missing inode flag loaded from disk, reported by Tom.

[tom@localhost ~]$ sudo mount /dev/loop0 /mnt/
[tom@localhost ~]$ sudo chown tom:tom /mnt/
[tom@localhost ~]$ touch /mnt/testfile
[tom@localhost ~]$ sudo chattr +i /mnt/testfile
[tom@localhost ~]$ echo test > /mnt/testfile
bash: /mnt/testfile: Operation not permitted
[tom@localhost ~]$ rm /mnt/testfile
rm: cannot remove '/mnt/testfile': Operation not permitted
[tom@localhost ~]$ sudo umount /mnt/
[tom@localhost ~]$ sudo mount /dev/loop0 /mnt/
[tom@localhost ~]$ lsattr /mnt/testfile
----i-------------- /mnt/testfile
[tom@localhost ~]$ echo test > /mnt/testfile
[tom@localhost ~]$ rm /mnt/testfile
[tom@localhost ~]$ sudo umount /mnt/

Cc: stable@vger.kernel.org
Reported-by: Tom Yan <tom.ty89@outlook.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c
fs/f2fs/inode.c