writeback: Avoid postponing periodic data writeback indefinitely
Jan Kara
reviewerPATCH 1/1 writeback: Avoid postponing periodic data writeback indefinitely
Hongyu Jin has reported that f2fs periodically calls sync_inode_metadata() for some inodes. The logic in writeback_single_inode() thus periodically calls to redirty_tail() and the inode's dirtied_when timestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.
The redirty_tail() logic in writeback_single_inode() actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes and writeback_single_inode() is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove the redirty_tail() logic and add a comment explaining the rules.
--- fs/fs-writeback.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-)
fs/fs-writeback.c +22 -13
@@ -1946,22 +1946,31 @@ static int writeback_single_inode(struct inode *inode,* as it can be finally deleted at this moment. */ if (!(inode_state_read (inode) &I_FREEING )) { +enum inode_state_flags_enum istate =inode_state_read (inode); +/* -* If the inode is now fully clean, then it can be safely -* removed from its writeback list (if any). Otherwise the -* flusher threads are responsible for the writeback lists. +* __mark_inode_dirty() is responsible for promoting inode to +* the proper list (b_attached -> b_dirty_time -> b_dirty). +* Here we are responsible for demoting inode after some dirty +* bits were cleared. +* +* If the inode is now fully clean, then it can be safely moved +* to b_attached list. If the inode is dirty, we don't want to +* touch it - it should be already put to the dirty list by +* __mark_inode_dirty() and we'd just unnecessarily clobber the +* dirtied_when stamp (which is particularly problematic when +* we were called from sync_inode_metadata()). We also cannot +* touch the dirty list association when I_SYNC_QUEUED is set +* and flush worker is responsible for it. Otherwise move the +* inode to b_dirty_time list as that's the only remaining +* possibility. */ -if (!(inode_state_read (inode) &I_DIRTY_ALL )) +if (!(istate &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode_state_read (inode) &I_SYNC_QUEUED )) { -if ((inode_state_read (inode) &I_DIRTY )) -redirty_tail_locked (inode, wb); -else if (inode_state_read (inode) &I_DIRTY_TIME ) { - inode->dirtied_when = jiffies; -inode_io_list_move_locked (inode, - wb, - &wb->b_dirty_time); - } +else if (!(istate &I_SYNC_QUEUED ) && !(istate &I_DIRTY )) { +WARN_ON_ONCE (!(istate &I_DIRTY_TIME )); + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); } }
Signature · 1 line
2.51.0
Commit 846 a3351ddfe4a86eede4bb26a205c3f38ef84d3 problem need to be considered:
We have run into an issue that a task gets stuck in balance_dirty_pages_ratelimited() when perform I/O stress testing. The reason we observed is that an I_DIRTY_PAGES inode with lots of dirty pages is in b_dirty_time list and standard background writeback cannot writeback the inode.
After studing the relevant code, the following scenario may lead to the issue:
task1 task2
----- -----fuse_flush
write_inode_now // in b_dirty_time
writeback_single_inode
__writeback_single_inode
fuse_write_end
filemap_dirty_folio
__xa_set_mark:PAGECACHE_TAG_DIRTY
lock inode->i_lock
if mapping tagged PAGECACHE_TAG_DIRTY
inode->i_state |= I_DIRTY_PAGES
unlock inode->i_lock
__mark_inode_dirty:I_DIRTY_PAGES
lock inode->i_lock
-was dirty, inode stays in b_dirty_time
unlock inode->i_lock
if(!(inode->i_state & I_DIRTY_All))
-not true,so nothing doneQuoted 75 lines · Jan Kara <[email protected]> 于2026年10月27日周二 05:10写道:
Hongyu Jin has reported that f2fs periodically calls
sync_inode_metadata()for some inodes. The logic inwriteback_single_inode()thus periodically calls toredirty_tail()and the inode'sdirtied_whentimestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.The
redirty_tail()logic inwriteback_single_inode()actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes andwriteback_single_inode()is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove theredirty_tail()logic and add a comment explaining the rules.Reported-by Hongyu Jin <[email protected]>Signed-off-by Jan Kara <[email protected]>--- fs/fs-writeback.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-)fs/fs-writeback.c +22
-14@@ -1946,22 +1946,31 @@ static int writeback_single_inode(struct inode *inode,* as it can be finally deleted at this moment. */ if (!(inode_state_read (inode) &I_FREEING )) { +enum inode_state_flags_enum istate =inode_state_read (inode); +/* -* If the inode is now fully clean, then it can be safely -* removed from its writeback list (if any). Otherwise the -* flusher threads are responsible for the writeback lists. +* __mark_inode_dirty() is responsible for promoting inode to +* the proper list (b_attached -> b_dirty_time -> b_dirty). +* Here we are responsible for demoting inode after some dirty +* bits were cleared. +* +* If the inode is now fully clean, then it can be safely moved +* to b_attached list. If the inode is dirty, we don't want to +* touch it - it should be already put to the dirty list by +* __mark_inode_dirty() and we'd just unnecessarily clobber the +* dirtied_when stamp (which is particularly problematic when +* we were called from sync_inode_metadata()). We also cannot +* touch the dirty list association when I_SYNC_QUEUED is set +* and flush worker is responsible for it. Otherwise move the +* inode to b_dirty_time list as that's the only remaining +* possibility. */ -if (!(inode_state_read (inode) &I_DIRTY_ALL )) +if (!(istate &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode_state_read (inode) &I_SYNC_QUEUED )) { -if ((inode_state_read (inode) &I_DIRTY )) -redirty_tail_locked (inode, wb); -else if (inode_state_read (inode) &I_DIRTY_TIME ) { - inode->dirtied_when = jiffies; -inode_io_list_move_locked (inode, - wb, - &wb->b_dirty_time); - } +else if (!(istate &I_SYNC_QUEUED ) && !(istate &I_DIRTY )) { +WARN_ON_ONCE (!(istate &I_DIRTY_TIME )); + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); } } --2.51.0
Jan Kara
reviewerQuoted 15 lines · Hongyu Jin
Commit 846
a3351ddfe4a86eede4bb26a205c3f38ef84d3problem need to be considered:We have run into an issue that a task gets stuck in
balance_dirty_pages_ratelimited()when perform I/O stress testing. The reason we observed is that anI_DIRTY_PAGESinode with lots of dirty pages is inb_dirty_timelist and standard background writeback cannot writeback the inode.
After studing the relevant code, the following scenario may lead to the issue:task1 task2
----- -----fuse_flush
write_inode_now// inb_dirty_time
writeback_single_inode
Quoted 15 lines
__writeback_single_inode
fuse_write_end
filemap_dirty_folio
__xa_set_mark:PAGECACHE_TAG_DIRTY
lock inode->i_lock
if mapping tagged PAGECACHE_TAG_DIRTY
inode->i_state |= I_DIRTY_PAGES
unlock inode->i_lock
__mark_inode_dirty:I_DIRTY_PAGES
lock inode->i_lock
-was dirty, inode stays in b_dirty_time
unlock inode->i_lock
if(!(inode->i_state & I_DIRTY_All))
-not true,so nothing doneHum, right. Thanks for testing! Back to drawing board...
Honza
Quoted 76 lines
Quoted 75 lines · Jan Kara <[email protected]> 于2026年10月27日周二 05:10写道:
Hongyu Jin has reported that f2fs periodically calls
sync_inode_metadata()for some inodes. The logic inwriteback_single_inode()thus periodically calls toredirty_tail()and the inode'sdirtied_whentimestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.The
redirty_tail()logic inwriteback_single_inode()actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes andwriteback_single_inode()is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove theredirty_tail()logic and add a comment explaining the rules.Reported-by Hongyu Jin <[email protected]>Signed-off-by Jan Kara <[email protected]>--- fs/fs-writeback.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-)fs/fs-writeback.c +22
-14@@ -1946,22 +1946,31 @@ static int writeback_single_inode(struct inode *inode,* as it can be finally deleted at this moment. */ if (!(inode_state_read (inode) &I_FREEING )) { +enum inode_state_flags_enum istate =inode_state_read (inode); +/* -* If the inode is now fully clean, then it can be safely -* removed from its writeback list (if any). Otherwise the -* flusher threads are responsible for the writeback lists. +* __mark_inode_dirty() is responsible for promoting inode to +* the proper list (b_attached -> b_dirty_time -> b_dirty). +* Here we are responsible for demoting inode after some dirty +* bits were cleared. +* +* If the inode is now fully clean, then it can be safely moved +* to b_attached list. If the inode is dirty, we don't want to +* touch it - it should be already put to the dirty list by +* __mark_inode_dirty() and we'd just unnecessarily clobber the +* dirtied_when stamp (which is particularly problematic when +* we were called from sync_inode_metadata()). We also cannot +* touch the dirty list association when I_SYNC_QUEUED is set +* and flush worker is responsible for it. Otherwise move the +* inode to b_dirty_time list as that's the only remaining +* possibility. */ -if (!(inode_state_read (inode) &I_DIRTY_ALL )) +if (!(istate &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode_state_read (inode) &I_SYNC_QUEUED )) { -if ((inode_state_read (inode) &I_DIRTY )) -redirty_tail_locked (inode, wb); -else if (inode_state_read (inode) &I_DIRTY_TIME ) { - inode->dirtied_when = jiffies; -inode_io_list_move_locked (inode, - wb, - &wb->b_dirty_time); - } +else if (!(istate &I_SYNC_QUEUED ) && !(istate &I_DIRTY )) { +WARN_ON_ONCE (!(istate &I_DIRTY_TIME )); + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); } } --2.51.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
PATCH v2 1/1 writeback: Avoid postponing periodic data writeback indefinitely
From: Jan Kara <[email protected]>
f2fs periodically calls sync_inode_metadata() for some inodes. The logic in writeback_single_inode() thus periodically calls to redirty_tail() and the inode's dirtied_when timestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.
The redirty_tail() logic in writeback_single_inode() actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes and writeback_single_inode() is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove the redirty_tail() logic and add a comment explaining the rules.
The redirty_tail() did hide a race though, the one fixed by commit 846a3351ddfe ("writeback: Avoid skipping inode writeback"). __writeback_single_inode() sets I_DIRTY_PAGES again when the mapping is still tagged dirty. If the inode had no I_DIRTY bits (e.g. write_inode_now(inode, 0) or sync_inode_metadata(inode, 0) of an inode with only I_DIRTY_TIME), the dirty pages come from a racing writer, whose __mark_inode_dirty() then finds I_DIRTY_PAGES set and does not queue the inode, leaving it on b_dirty_time or b_attached. Call __mark_inode_dirty() in that case instead, so that the inode gets queued on b_dirty.
[hongyu.jin: let __mark_inode_dirty() queue an inode whose pages were
dirtied while it had no I_DIRTY bits, update comments]
--- fs/fs-writeback.c | 60 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 17 deletions(-)
fs/fs-writeback.c +43 -17
@@ -1780,7 +1780,9 @@ bool sync_lazytime(struct inode *inode)* * This doesn't remove the inode from the writeback list it is on, except * potentially to move it from b_dirty_time to b_dirty due to timestamp -* expiration. The caller is otherwise responsible for writeback list handling. +* expiration, or to queue it on b_dirty via __mark_inode_dirty() when its +* pages were dirtied while it had no I_DIRTY bits. The caller is otherwise +* responsible for writeback list handling. * * The caller is also responsible for setting the I_SYNC flag beforehand and * calling inode_sync_complete() to clear it afterwards.
@@ -1790,6 +1792,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) {struct address_space *mapping = inode->i_mapping;long nr_to_write = wbc->nr_to_write; +bool mark_pages = false;unsigned dirty;int ret;
@@ -1843,12 +1846,23 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)* still has dirty pages. The flag is reinstated after smp_mb() if * necessary. This guarantees that either __mark_inode_dirty() * sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY. +* +* If the inode had any I_DIRTY bits, __mark_inode_dirty() has already +* queued it (if it is to be queued at all) and we can just reinstate +* I_DIRTY_PAGES. Otherwise the pages were dirtied by a racing writer +* and the inode may sit on b_dirty_time or b_attached. Setting the +* flag here would make the writer's __mark_inode_dirty() bail out +* without queueing the inode, so let __mark_inode_dirty() set it and +* queue the inode instead. */ smp_mb (); -if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) -inode_state_set (inode,I_DIRTY_PAGES ); -else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) { +if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) { +if (dirty) +inode_state_set (inode,I_DIRTY_PAGES ); +else + mark_pages = true; + }else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) {if (!(inode_state_read (inode) &I_DIRTY_PAGES )) {inode_state_clear (inode,I_PINNING_NETFS_WB ); wbc->unpinned_netfs_wb = true;
@@ -1858,6 +1872,9 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)spin_unlock (&inode->i_lock); +if (mark_pages) +__mark_inode_dirty (inode,I_DIRTY_PAGES ); +/* Don't write the inode if only I_DIRTY_PAGES was set */ if (dirty & ~I_DIRTY_PAGES ) {int err =write_inode (inode, wbc);
@@ -1946,22 +1963,31 @@ static int writeback_single_inode(struct inode *inode,* as it can be finally deleted at this moment. */ if (!(inode_state_read (inode) &I_FREEING )) { +enum inode_state_flags_enum istate =inode_state_read (inode); +/* -* If the inode is now fully clean, then it can be safely -* removed from its writeback list (if any). Otherwise the -* flusher threads are responsible for the writeback lists. +* __mark_inode_dirty() is responsible for promoting inode to +* the proper list (b_attached -> b_dirty_time -> b_dirty). +* Here we are responsible for demoting inode after some dirty +* bits were cleared. +* +* If the inode is now fully clean, then it can be safely moved +* to b_attached list. If the inode is dirty, we don't want to +* touch it - it should be already put to the dirty list by +* __mark_inode_dirty() and we'd just unnecessarily clobber the +* dirtied_when stamp (which is particularly problematic when +* we were called from sync_inode_metadata()). We also cannot +* touch the dirty list association when I_SYNC_QUEUED is set +* and flush worker is responsible for it. Otherwise move the +* inode to b_dirty_time list as that's the only remaining +* possibility. */ -if (!(inode_state_read (inode) &I_DIRTY_ALL )) +if (!(istate &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode_state_read (inode) &I_SYNC_QUEUED )) { -if ((inode_state_read (inode) &I_DIRTY )) -redirty_tail_locked (inode, wb); -else if (inode_state_read (inode) &I_DIRTY_TIME ) { - inode->dirtied_when = jiffies; -inode_io_list_move_locked (inode, - wb, - &wb->b_dirty_time); - } +else if (!(istate &I_SYNC_QUEUED ) && !(istate &I_DIRTY )) { +WARN_ON_ONCE (!(istate &I_DIRTY_TIME )); + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); } }
Signature · 1 line
2.53.0
Quoted 146 lines · Hongyu Jin <[email protected]> 于2026年10月29日周四 09:52写道:
From: Jan Kara <[email protected]>
f2fs periodically calls
sync_inode_metadata()for some inodes. The logic inwriteback_single_inode()thus periodically calls toredirty_tail()and the inode'sdirtied_whentimestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.The
redirty_tail()logic inwriteback_single_inode()actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes andwriteback_single_inode()is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove theredirty_tail()logic and add a comment explaining the rules.The
redirty_tail()did hide a race though, the one fixed by commit846a3351ddfe("writeback: Avoid skipping inode writeback").__writeback_single_inode()setsI_DIRTY_PAGESagain when the mapping is still tagged dirty. If the inode had noI_DIRTYbits (e.g.write_inode_now(inode, 0)orsync_inode_metadata(inode, 0)of an inode with onlyI_DIRTY_TIME), the dirty pages come from a racing writer, whose__mark_inode_dirty()then findsI_DIRTY_PAGESset and does not queue the inode, leaving it onb_dirty_timeorb_attached. Call__mark_inode_dirty()in that case instead, so that the inode gets queued onb_dirty.Fixes 846a3351ddfe ("writeback: Avoid skipping inode writeback")Reported-by Hongyu Jin <[email protected]>Signed-off-by Jan Kara <[email protected]>[hongyu.jin: let
__mark_inode_dirty()queue an inode whose pages were
dirtied while it had noI_DIRTYbits, update comments]Signed-off-by Hongyu Jin <[email protected]>--- fs/fs-writeback.c | 60 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 17 deletions(-)fs/fs-writeback.c +43
-18@@ -1780,7 +1780,9 @@ bool sync_lazytime(struct inode *inode)* * This doesn't remove the inode from the writeback list it is on, except * potentially to move it from b_dirty_time to b_dirty due to timestamp -* expiration. The caller is otherwise responsible for writeback list handling. +* expiration, or to queue it on b_dirty via __mark_inode_dirty() when its +* pages were dirtied while it had no I_DIRTY bits. The caller is otherwise +* responsible for writeback list handling. * * The caller is also responsible for setting the I_SYNC flag beforehand and * calling inode_sync_complete() to clear it afterwards. @@ -1790,6 +1792,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) {struct address_space *mapping = inode->i_mapping;long nr_to_write = wbc->nr_to_write; +bool mark_pages = false;unsigned dirty;int ret;@@ -1843,12 +1846,23 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)* still has dirty pages. The flag is reinstated after smp_mb() if * necessary. This guarantees that either __mark_inode_dirty() * sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY. +* +* If the inode had any I_DIRTY bits, __mark_inode_dirty() has already +* queued it (if it is to be queued at all) and we can just reinstate +* I_DIRTY_PAGES. Otherwise the pages were dirtied by a racing writer +* and the inode may sit on b_dirty_time or b_attached. Setting the +* flag here would make the writer's __mark_inode_dirty() bail out +* without queueing the inode, so let __mark_inode_dirty() set it and +* queue the inode instead. */ smp_mb (); -if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) -inode_state_set (inode,I_DIRTY_PAGES ); -else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) { +if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) { +if (dirty) +inode_state_set (inode,I_DIRTY_PAGES ); +else + mark_pages = true; + }else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) {if (!(inode_state_read (inode) &I_DIRTY_PAGES )) {inode_state_clear (inode,I_PINNING_NETFS_WB ); wbc->unpinned_netfs_wb = true;@@ -1858,6 +1872,9 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)spin_unlock (&inode->i_lock); +if (mark_pages) +__mark_inode_dirty (inode,I_DIRTY_PAGES ); +/* Don't write the inode if only I_DIRTY_PAGES was set */ if (dirty & ~I_DIRTY_PAGES ) {int err =write_inode (inode, wbc);@@ -1946,22 +1963,31 @@ static int writeback_single_inode(struct inode *inode,* as it can be finally deleted at this moment. */ if (!(inode_state_read (inode) &I_FREEING )) { +enum inode_state_flags_enum istate =inode_state_read (inode); +/* -* If the inode is now fully clean, then it can be safely -* removed from its writeback list (if any). Otherwise the -* flusher threads are responsible for the writeback lists. +* __mark_inode_dirty() is responsible for promoting inode to +* the proper list (b_attached -> b_dirty_time -> b_dirty). +* Here we are responsible for demoting inode after some dirty +* bits were cleared. +* +* If the inode is now fully clean, then it can be safely moved +* to b_attached list. If the inode is dirty, we don't want to +* touch it - it should be already put to the dirty list by +* __mark_inode_dirty() and we'd just unnecessarily clobber the +* dirtied_when stamp (which is particularly problematic when +* we were called from sync_inode_metadata()). We also cannot +* touch the dirty list association when I_SYNC_QUEUED is set +* and flush worker is responsible for it. Otherwise move the +* inode to b_dirty_time list as that's the only remaining +* possibility. */ -if (!(inode_state_read (inode) &I_DIRTY_ALL )) +if (!(istate &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode_state_read (inode) &I_SYNC_QUEUED )) { -if ((inode_state_read (inode) &I_DIRTY )) -redirty_tail_locked (inode, wb); -else if (inode_state_read (inode) &I_DIRTY_TIME ) { - inode->dirtied_when = jiffies; -inode_io_list_move_locked (inode, - wb, - &wb->b_dirty_time); - } +else if (!(istate &I_SYNC_QUEUED ) && !(istate &I_DIRTY )) { +WARN_ON_ONCE (!(istate &I_DIRTY_TIME )); + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); } } --
Quoted 2 lines
2.53.0
Hi maintainers, have any suggestions for this patch?
Christian Brauner
maintainerQuoted 29 lines · Hongyu Jin
Quoted 28 lines · Hongyu Jin <[email protected]> 于2026年10月29日周四 09:52写道:
From: Jan Kara <[email protected]>
f2fs periodically calls
sync_inode_metadata()for some inodes. The logic inwriteback_single_inode()thus periodically calls toredirty_tail()and the inode'sdirtied_whentimestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.The
redirty_tail()logic inwriteback_single_inode()actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes andwriteback_single_inode()is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove theredirty_tail()logic and add a comment explaining the rules.The
redirty_tail()did hide a race though, the one fixed by commit846a3351ddfe("writeback: Avoid skipping inode writeback").__writeback_single_inode()setsI_DIRTY_PAGESagain when the mapping is still tagged dirty. If the inode had noI_DIRTYbits (e.g.write_inode_now(inode, 0)orsync_inode_metadata(inode, 0)of an inode with onlyI_DIRTY_TIME), the dirty pages come from a racing writer, whose__mark_inode_dirty()then findsI_DIRTY_PAGESset and does not queue the inode, leaving it onb_dirty_timeorb_attached. Call__mark_inode_dirty()in that case instead, so that the inode gets queued onb_dirty.
Quoted 8 lines
Quoted 8 lines
Fixes 846a3351ddfe ("writeback: Avoid skipping inode writeback")Reported-by Hongyu Jin <[email protected]>Signed-off-by Jan Kara <[email protected]>[hongyu.jin: let
__mark_inode_dirty()queue an inode whose pages were
dirtied while it had noI_DIRTYbits, update comments]Signed-off-by Hongyu Jin <[email protected]>
Jan, you're good with this fix?
Jan Kara
reviewerQuoted 39 lines · Christian Brauner
Quoted 29 lines · Hongyu Jin
Quoted 28 lines · Hongyu Jin <[email protected]> 于2026年10月29日周四 09:52写道:
From: Jan Kara <[email protected]>
f2fs periodically calls
sync_inode_metadata()for some inodes. The logic inwriteback_single_inode()thus periodically calls toredirty_tail()and the inode'sdirtied_whentimestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.The
redirty_tail()logic inwriteback_single_inode()actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes andwriteback_single_inode()is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove theredirty_tail()logic and add a comment explaining the rules.The
redirty_tail()did hide a race though, the one fixed by commit846a3351ddfe("writeback: Avoid skipping inode writeback").__writeback_single_inode()setsI_DIRTY_PAGESagain when the mapping is still tagged dirty. If the inode had noI_DIRTYbits (e.g.write_inode_now(inode, 0)orsync_inode_metadata(inode, 0)of an inode with onlyI_DIRTY_TIME), the dirty pages come from a racing writer, whose__mark_inode_dirty()then findsI_DIRTY_PAGESset and does not queue the inode, leaving it onb_dirty_timeorb_attached. Call__mark_inode_dirty()in that case instead, so that the inode gets queued onb_dirty.Quoted 8 lines
Quoted 8 lines
Fixes 846a3351ddfe ("writeback: Avoid skipping inode writeback")Reported-by Hongyu Jin <[email protected]>Signed-off-by Jan Kara <[email protected]>[hongyu.jin: let
__mark_inode_dirty()queue an inode whose pages were
dirtied while it had noI_DIRTYbits, update comments]Signed-off-by Hongyu Jin <[email protected]>
Quoted 1 line
Jan, you're good with this fix?
Sorry no. It still looks too hacky to me but so far my attempts at coming up with something saner were not successful. :-| I'll look more into it today or tomorrow at latest.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Jan Kara
reviewerQuoted 27 lines · Hongyu Jin
From: Jan Kara <[email protected]>
f2fs periodically calls
sync_inode_metadata()for some inodes. The logic inwriteback_single_inode()thus periodically calls toredirty_tail()and the inode'sdirtied_whentimestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.The
redirty_tail()logic inwriteback_single_inode()actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes andwriteback_single_inode()is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove theredirty_tail()logic and add a comment explaining the rules.The
redirty_tail()did hide a race though, the one fixed by commit846a3351ddfe("writeback: Avoid skipping inode writeback").__writeback_single_inode()setsI_DIRTY_PAGESagain when the mapping is still tagged dirty. If the inode had noI_DIRTYbits (e.g.write_inode_now(inode, 0)orsync_inode_metadata(inode, 0)of an inode with onlyI_DIRTY_TIME), the dirty pages come from a racing writer, whose__mark_inode_dirty()then findsI_DIRTY_PAGESset and does not queue the inode, leaving it onb_dirty_timeorb_attached. Call__mark_inode_dirty()in that case instead, so that the inode gets queued onb_dirty.
Quoted 8 lines
Fixes 846a3351ddfe ("writeback: Avoid skipping inode writeback")Reported-by Hongyu Jin <[email protected]>Signed-off-by Jan Kara <[email protected]>[hongyu.jin: let
__mark_inode_dirty()queue an inode whose pages were
dirtied while it had noI_DIRTYbits, update comments]Signed-off-by Hongyu Jin <[email protected]>
I wasn't still happy with this solution so I was pondering for quite a while about a cleaner solution. Finally, I've come up with a patch I like and which should fix the race you have found. Some testing is still running on my side but I'm attaching it already now in case you want to run testing on your side as well. Thanks for your patience!
Honza
Quoted 112 lines
--- fs/fs-writeback.c | 60 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 17 deletions(-)fs/fs-writeback.c +43
-17@@ -1780,7 +1780,9 @@ bool sync_lazytime(struct inode *inode)* * This doesn't remove the inode from the writeback list it is on, except * potentially to move it from b_dirty_time to b_dirty due to timestamp -* expiration. The caller is otherwise responsible for writeback list handling. +* expiration, or to queue it on b_dirty via __mark_inode_dirty() when its +* pages were dirtied while it had no I_DIRTY bits. The caller is otherwise +* responsible for writeback list handling. * * The caller is also responsible for setting the I_SYNC flag beforehand and * calling inode_sync_complete() to clear it afterwards. @@ -1790,6 +1792,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) {struct address_space *mapping = inode->i_mapping;long nr_to_write = wbc->nr_to_write; +bool mark_pages = false;unsigned dirty;int ret;@@ -1843,12 +1846,23 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)* still has dirty pages. The flag is reinstated after smp_mb() if * necessary. This guarantees that either __mark_inode_dirty() * sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY. +* +* If the inode had any I_DIRTY bits, __mark_inode_dirty() has already +* queued it (if it is to be queued at all) and we can just reinstate +* I_DIRTY_PAGES. Otherwise the pages were dirtied by a racing writer +* and the inode may sit on b_dirty_time or b_attached. Setting the +* flag here would make the writer's __mark_inode_dirty() bail out +* without queueing the inode, so let __mark_inode_dirty() set it and +* queue the inode instead. */ smp_mb (); -if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) -inode_state_set (inode,I_DIRTY_PAGES ); -else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) { +if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) { +if (dirty) +inode_state_set (inode,I_DIRTY_PAGES ); +else + mark_pages = true; + }else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) {if (!(inode_state_read (inode) &I_DIRTY_PAGES )) {inode_state_clear (inode,I_PINNING_NETFS_WB ); wbc->unpinned_netfs_wb = true;@@ -1858,6 +1872,9 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)spin_unlock (&inode->i_lock); +if (mark_pages) +__mark_inode_dirty (inode,I_DIRTY_PAGES ); +/* Don't write the inode if only I_DIRTY_PAGES was set */ if (dirty & ~I_DIRTY_PAGES ) {int err =write_inode (inode, wbc);@@ -1946,22 +1963,31 @@ static int writeback_single_inode(struct inode *inode,* as it can be finally deleted at this moment. */ if (!(inode_state_read (inode) &I_FREEING )) { +enum inode_state_flags_enum istate =inode_state_read (inode); +/* -* If the inode is now fully clean, then it can be safely -* removed from its writeback list (if any). Otherwise the -* flusher threads are responsible for the writeback lists. +* __mark_inode_dirty() is responsible for promoting inode to +* the proper list (b_attached -> b_dirty_time -> b_dirty). +* Here we are responsible for demoting inode after some dirty +* bits were cleared. +* +* If the inode is now fully clean, then it can be safely moved +* to b_attached list. If the inode is dirty, we don't want to +* touch it - it should be already put to the dirty list by +* __mark_inode_dirty() and we'd just unnecessarily clobber the +* dirtied_when stamp (which is particularly problematic when +* we were called from sync_inode_metadata()). We also cannot +* touch the dirty list association when I_SYNC_QUEUED is set +* and flush worker is responsible for it. Otherwise move the +* inode to b_dirty_time list as that's the only remaining +* possibility. */ -if (!(inode_state_read (inode) &I_DIRTY_ALL )) +if (!(istate &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode_state_read (inode) &I_SYNC_QUEUED )) { -if ((inode_state_read (inode) &I_DIRTY )) -redirty_tail_locked (inode, wb); -else if (inode_state_read (inode) &I_DIRTY_TIME ) { - inode->dirtied_when = jiffies; -inode_io_list_move_locked (inode, - wb, - &wb->b_dirty_time); - } +else if (!(istate &I_SYNC_QUEUED ) && !(istate &I_DIRTY )) { +WARN_ON_ONCE (!(istate &I_DIRTY_TIME )); + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); } }Signature · 1 line
2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
From b6a15901f2e297d038751e1e91f4585238a31e64 Mon Sep 17 00:00:00 2001
From: Jan Kara <[email protected]>
Date: Mon, 26 Oct 2026 16:16:15 +0100
Subject: [PATCH] writeback: Avoid postponing periodic data writeback
indefinitely
Hongyu Jin has reported that f2fs periodically calls sync_inode_metadata() for some inodes. The logic in writeback_single_inode() thus periodically calls to redirty_tail() and the inode's dirtied_when timestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.
The redirty_tail() logic in writeback_single_inode() is only needed do place inode in the dirty list when the setting of I_DIRTY_PAGES in __writeback_single_inode() raced with filemap_dirty_folio(). So be more careful in __writeback_single_inode() to make sure __mark_inode_dirty() always places in the inode in the proper list and modify writeback_single_inode() to only demote inode to "less dirty" list based on dirty bits cleared as a result of writeback.
--- fs/fs-writeback.c | 74 ++++++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 26 deletions(-)
fs/fs-writeback.c +48 -26
@@ -1800,6 +1800,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)struct address_space *mapping = inode->i_mapping;long nr_to_write = wbc->nr_to_write;unsigned dirty; +bool pages_cleared = false;int ret;WARN_ON (!(inode_state_read_once (inode) &I_SYNC ));
@@ -1839,30 +1840,42 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)* after handling timestamp expiration, as that may dirty the inode too. */ spin_lock (&inode->i_lock); - dirty =inode_state_read (inode) &I_DIRTY ; + dirty =inode_state_read (inode) &I_DIRTY_INODE ;inode_state_clear (inode, dirty); +if (inode_state_read (inode) &I_DIRTY_PAGES && + !mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) { +inode_state_clear (inode,I_DIRTY_PAGES ); + pages_cleared = true; + }/* * Paired with smp_mb() in __mark_inode_dirty(). This allows * __mark_inode_dirty() to test i_state without grabbing i_lock - * either they see the I_DIRTY bits cleared or we see the dirtied -* inode. +* inode or folio tag. * -* I_DIRTY_PAGES is always cleared together above even if @mapping -* still has dirty pages. The flag is reinstated after smp_mb() if -* necessary. This guarantees that either __mark_inode_dirty() -* sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY. +* I_DIRTY_PAGES handling is hairy. The clearing above can race with +* filemap_dirty_folio() so we don't see dirty tag yet but +* __mark_inode_dirty() doesn't see I_DIRTY_PAGES cleared either. So we +* have to recheck after smp_mb() and possibly reinstate I_DIRTY_PAGES. +* We have to be careful with reinstating and only do that if we really +* cleared I_DIRTY_PAGES. Only in that case we are guaranteed the inode +* is already in the dirty list and so it doesn't need to be (nor +* should be) moved. If we didn't clear I_DIRTY_PAGES, then either the +* inode is already in the dirty list or we race with +* filemap_dirty_folio() which will eventually call +* __mark_inode_dirty() to set I_DIRTY_PAGES and place inode in +* appropriate dirty list. */ smp_mb (); -if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) +if (pages_cleared &&mapping_tagged (mapping,PAGECACHE_TAG_DIRTY ))inode_state_set (inode,I_DIRTY_PAGES ); -else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) { -if (!(inode_state_read (inode) &I_DIRTY_PAGES )) { -inode_state_clear (inode,I_PINNING_NETFS_WB ); - wbc->unpinned_netfs_wb = true; - dirty |=I_PINNING_NETFS_WB ;/* Cause write_inode */ - } +if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB ) && + !(inode_state_read (inode) &I_DIRTY_PAGES )) { +inode_state_clear (inode,I_PINNING_NETFS_WB ); + wbc->unpinned_netfs_wb = true; + dirty |=I_PINNING_NETFS_WB ;/* Cause write_inode */ }spin_unlock (&inode->i_lock);
@@ -1955,22 +1968,31 @@ static int writeback_single_inode(struct inode *inode,* as it can be finally deleted at this moment. */ if (!(inode_state_read (inode) &I_FREEING )) { +enum inode_state_flags_enum istate =inode_state_read (inode); +/* -* If the inode is now fully clean, then it can be safely -* removed from its writeback list (if any). Otherwise the -* flusher threads are responsible for the writeback lists. +* __mark_inode_dirty() is responsible for promoting inode to +* the proper list (b_attached -> b_dirty_time -> b_dirty). +* Here we are responsible for demoting inode after some dirty +* bits were cleared. +* +* If the inode is now fully clean, then it can be safely moved +* to b_attached list. If the inode is dirty, we don't want to +* touch it - it should be already put to the dirty list by +* __mark_inode_dirty() and we'd just unnecessarily clobber the +* dirtied_when stamp (which is particularly problematic when +* we were called from sync_inode_metadata()). We also cannot +* touch the dirty list association when I_SYNC_QUEUED is set +* and flush worker is responsible for it. Otherwise move the +* inode to b_dirty_time list as that's the only remaining +* possibility. */ -if (!(inode_state_read (inode) &I_DIRTY_ALL )) +if (!(istate &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode_state_read (inode) &I_SYNC_QUEUED )) { -if ((inode_state_read (inode) &I_DIRTY )) -redirty_tail_locked (inode, wb); -else if (inode_state_read (inode) &I_DIRTY_TIME ) { - inode->dirtied_when = jiffies; -inode_io_list_move_locked (inode, - wb, - &wb->b_dirty_time); - } +else if (!(istate &I_SYNC_QUEUED ) && !(istate &I_DIRTY )) { +WARN_ON_ONCE (!(istate &I_DIRTY_TIME )); + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); } }
Signature · 1 line
2.53.0
Quoted 38 lines · Jan Kara <[email protected]> 于2026年11月13日周五 02:05写道:
Quoted 27 lines · Hongyu Jin
From: Jan Kara <[email protected]>
f2fs periodically calls
sync_inode_metadata()for some inodes. The logic inwriteback_single_inode()thus periodically calls toredirty_tail()and the inode'sdirtied_whentimestamp never gets old enough for the inode to be eligible for periodic data writeback. Thus dirty data from it is only ever written on explicit request (fsync(2), sync(2), unmount) or on dirty limit pressure.The
redirty_tail()logic inwriteback_single_inode()actually should not be necessary. Since this function is used only for once-off writeback, there's no need for any livelock protection among inodes andwriteback_single_inode()is only responsible for demoting inode to "less dirty" list based on dirty bits cleared as a result of writeback. So remove theredirty_tail()logic and add a comment explaining the rules.The
redirty_tail()did hide a race though, the one fixed by commit846a3351ddfe("writeback: Avoid skipping inode writeback").__writeback_single_inode()setsI_DIRTY_PAGESagain when the mapping is still tagged dirty. If the inode had noI_DIRTYbits (e.g.write_inode_now(inode, 0)orsync_inode_metadata(inode, 0)of an inode with onlyI_DIRTY_TIME), the dirty pages come from a racing writer, whose__mark_inode_dirty()then findsI_DIRTY_PAGESset and does not queue the inode, leaving it onb_dirty_timeorb_attached. Call__mark_inode_dirty()in that case instead, so that the inode gets queued onb_dirty.Quoted 8 lines
Fixes 846a3351ddfe ("writeback: Avoid skipping inode writeback")Reported-by Hongyu Jin <[email protected]>Signed-off-by Jan Kara <[email protected]>[hongyu.jin: let
__mark_inode_dirty()queue an inode whose pages were
dirtied while it had noI_DIRTYbits, update comments]Signed-off-by Hongyu Jin <[email protected]>
Quoted 8 lines
I wasn't still happy with this solution so I was pondering for quite a while about a cleaner solution. Finally, I've come up with a patch I like and which should fix the race you have found. Some testing is still running on my side but I'm attaching it already now in case you want to run testing on your side as well. Thanks for your patience!
Honza
https://lore.kernel.org/all/j77bd4foxrzipxiyute77hoc6vgszevpre2vifpfnaqwetpavf@36z37lyzaz34/2-0001-writeback-Avoid-postponing-periodic-data-writeback-i.patch
Thank you for your efforts. I tested your newest patch and it worked fine
Quoted 115 lines
Quoted 110 lines
--- fs/fs-writeback.c | 60 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 17 deletions(-)fs/fs-writeback.c +43
-18@@ -1780,7 +1780,9 @@ bool sync_lazytime(struct inode *inode)* * This doesn't remove the inode from the writeback list it is on, except * potentially to move it from b_dirty_time to b_dirty due to timestamp -* expiration. The caller is otherwise responsible for writeback list handling. +* expiration, or to queue it on b_dirty via __mark_inode_dirty() when its +* pages were dirtied while it had no I_DIRTY bits. The caller is otherwise +* responsible for writeback list handling. * * The caller is also responsible for setting the I_SYNC flag beforehand and * calling inode_sync_complete() to clear it afterwards. @@ -1790,6 +1792,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) {struct address_space *mapping = inode->i_mapping;long nr_to_write = wbc->nr_to_write; +bool mark_pages = false;unsigned dirty;int ret;@@ -1843,12 +1846,23 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)* still has dirty pages. The flag is reinstated after smp_mb() if * necessary. This guarantees that either __mark_inode_dirty() * sees clear I_DIRTY_PAGES or we see PAGECACHE_TAG_DIRTY. +* +* If the inode had any I_DIRTY bits, __mark_inode_dirty() has already +* queued it (if it is to be queued at all) and we can just reinstate +* I_DIRTY_PAGES. Otherwise the pages were dirtied by a racing writer +* and the inode may sit on b_dirty_time or b_attached. Setting the +* flag here would make the writer's __mark_inode_dirty() bail out +* without queueing the inode, so let __mark_inode_dirty() set it and +* queue the inode instead. */ smp_mb (); -if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) -inode_state_set (inode,I_DIRTY_PAGES ); -else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) { +if (mapping_tagged (mapping,PAGECACHE_TAG_DIRTY )) { +if (dirty) +inode_state_set (inode,I_DIRTY_PAGES ); +else + mark_pages = true; + }else if (unlikely (inode_state_read (inode) &I_PINNING_NETFS_WB )) {if (!(inode_state_read (inode) &I_DIRTY_PAGES )) {inode_state_clear (inode,I_PINNING_NETFS_WB ); wbc->unpinned_netfs_wb = true;@@ -1858,6 +1872,9 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)spin_unlock (&inode->i_lock); +if (mark_pages) +__mark_inode_dirty (inode,I_DIRTY_PAGES ); +/* Don't write the inode if only I_DIRTY_PAGES was set */ if (dirty & ~I_DIRTY_PAGES ) {int err =write_inode (inode, wbc);@@ -1946,22 +1963,31 @@ static int writeback_single_inode(struct inode *inode,* as it can be finally deleted at this moment. */ if (!(inode_state_read (inode) &I_FREEING )) { +enum inode_state_flags_enum istate =inode_state_read (inode); +/* -* If the inode is now fully clean, then it can be safely -* removed from its writeback list (if any). Otherwise the -* flusher threads are responsible for the writeback lists. +* __mark_inode_dirty() is responsible for promoting inode to +* the proper list (b_attached -> b_dirty_time -> b_dirty). +* Here we are responsible for demoting inode after some dirty +* bits were cleared. +* +* If the inode is now fully clean, then it can be safely moved +* to b_attached list. If the inode is dirty, we don't want to +* touch it - it should be already put to the dirty list by +* __mark_inode_dirty() and we'd just unnecessarily clobber the +* dirtied_when stamp (which is particularly problematic when +* we were called from sync_inode_metadata()). We also cannot +* touch the dirty list association when I_SYNC_QUEUED is set +* and flush worker is responsible for it. Otherwise move the +* inode to b_dirty_time list as that's the only remaining +* possibility. */ -if (!(inode_state_read (inode) &I_DIRTY_ALL )) +if (!(istate &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode_state_read (inode) &I_SYNC_QUEUED )) { -if ((inode_state_read (inode) &I_DIRTY )) -redirty_tail_locked (inode, wb); -else if (inode_state_read (inode) &I_DIRTY_TIME ) { - inode->dirtied_when = jiffies; -inode_io_list_move_locked (inode, - wb, - &wb->b_dirty_time); - } +else if (!(istate &I_SYNC_QUEUED ) && !(istate &I_DIRTY )) { +WARN_ON_ONCE (!(istate &I_DIRTY_TIME )); + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); } } --Quoted 2 lines
2.53.0
--
Jan Kara <[email protected]>
SUSE Labs, CR