Hi all.

Just happen to notice that a file on my f2fs filesystem marked as immutable is 
actually "mutable". At first I thought it was because of file corruption or so, 
but after some test it appears that the effect will be gone anyway once the 
filesystem is remounted. The flag remains though, as per the output of lsattr.

Here is a test case:

[tom@localhost ~]$ truncate -s 256M f2fs.img
[tom@localhost ~]$ sudo losetup -f f2fs.img 
[tom@localhost ~]$ sudo mkfs.f2fs /dev/loop0 

        F2FS-tools: mkfs.f2fs Ver: 1.8.0 (2017-02-03)

Info: Debug level = 0
Info: Label = 
Info: Trim is enabled
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 524288 (256 MB)
Info: zone aligned segment0 blkaddr: 512
Info: format version with
  "Linux version 4.10.13-1-ARCH (builduser@tobias) (gcc version 6.3.1 20170306 
(GCC) ) #1 SMP PREEMPT Thu Apr 27 12:15:09 CEST 2017"
Info: [/dev/loop0] Discarding device
Info: This device doesn't support BLKSECDISCARD
Info: Discarded 256 MB
Info: Overprovision ratio = 15.000%
Info: Overprovision segments = 35 (GC reserved = 21)
Info: format successful
[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/
[tom@localhost ~]$ uname -a
Linux localhost 4.10.13-1-ARCH #1 SMP PREEMPT Thu Apr 27 12:15:09 CEST 2017 
x86_64 GNU/Linux

As you can see, mkfs.f2fs is of version 1.8.0, and the kernel is as of 4.10.13. 
Let me know if you need further information. Thanks in advance.

Regards,
Tom
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to