Re: [PATCH] fs-writeback: Flush plug before next iteration in wb_writeback()

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

 



在 2022/4/16 13:42, Christoph Hellwig 写道:
I think the root cause is fsync gets buffer head's lock without locking
corresponding page, fixing 'progess' and flushing plug are both
workarounds.

So let's fix that.


I think adding page lock before locking buffer head is a little difficult and risky: 1. There are too many places getting buffer head before submitting bio, and not all filesystems behave same in readpage/writepage/write_inode. For example, ntfs_read_block() has locked page before locking buffer head and then submitting bh, ext4(no journal) and fat may lock buffer head without locking page while writing inode. It's a huge work to check all places. 2. Import page lock before locking buffer head may bring new unknown problem(other deadlocks about page ?). Taking page lock before locking buffer head(in all processes which can be concurrent with wb_writeback) is a dangerous thing.

So, how about applying the safe and simple method(flush plug) for the time being? PS: Maybe someday buffer head is removed from all filesystems, then we can remove this superfluous blk_flush_plug.



[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