• Jaegeuk Kim's avatar
    f2fs: load inode's flag from disk · 9aabcf47
    Jaegeuk Kim authored
    commit 93607124 upstream.
    
    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/
    Reported-by: default avatarTom Yan <tom.ty89@outlook.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    9aabcf47
file.c 54.9 KB