Doubt regarding fsync behaviour

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I have a doubt related to the behaviour of fsync().

I am tinkering with Ext4 on a slightly older linux kernel (5.5.10) and
I observed that dirty flags (I_DIRTY_INODE and I_DIRTY_PAGES)
maintained in vfs inode state (inode->i_state) do not get cleared
after fsync().

I observed this behaviour using the following simple program:

open(file);
write(file);
fsync(file);
close(file);  //I checked status of inode->i_state inside close()

Since, both dirty data and metadata get synced to disk
(ext4_sync_file()), shouldn't inode state be updated to not-dirty
after fsync?

Could someone please point out why this isn't done or whether my
observation is incorrect?

PS: I looked around the source code of fsync() in latest kernel
(v6.13-rc3) and I think this behaviour still exists in latest kernel
also.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux