Commit 1b43ef91 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

writeback: fix comment, use helper function

There's a comment in there which claims that the inode is left on s_io
if nfs chickened out of writing some data.

But that's not been true for three years.
9290280ced13c85689adeffa587e9a53bd3a5873 fixed a livelock by moving these
inodes back onto s_dirty.  Fix the comment.

In the second leg of the `if', use redirty_tail() rather than open-coding it.

Add weaselly comment indicating lack of confidence in the code and lack of the
fortitude which would be needed to fiddle with it.

Cc: Mike Waychison <mikew@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c986d1e2
...@@ -201,7 +201,6 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -201,7 +201,6 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
{ {
unsigned dirty; unsigned dirty;
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
struct super_block *sb = inode->i_sb;
int wait = wbc->sync_mode == WB_SYNC_ALL; int wait = wbc->sync_mode == WB_SYNC_ALL;
int ret; int ret;
...@@ -237,7 +236,16 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -237,7 +236,16 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
/* /*
* We didn't write back all the pages. nfs_writepages() * We didn't write back all the pages. nfs_writepages()
* sometimes bales out without doing anything. Redirty * sometimes bales out without doing anything. Redirty
* the inode. It is still on sb->s_io. * the inode. It is moved from s_io onto s_dirty.
*/
/*
* akpm: if the caller was the kupdate function we put
* this inode at the head of s_dirty so it gets first
* consideration. Otherwise, move it to the tail, for
* the reasons described there. I'm not really sure
* how much sense this makes. Presumably I had a good
* reasons for doing it this way, and I'd rather not
* muck with it at present.
*/ */
if (wbc->for_kupdate) { if (wbc->for_kupdate) {
/* /*
...@@ -257,8 +265,7 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -257,8 +265,7 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
* all the other files. * all the other files.
*/ */
inode->i_state |= I_DIRTY_PAGES; inode->i_state |= I_DIRTY_PAGES;
inode->dirtied_when = jiffies; redirty_tail(inode);
list_move(&inode->i_list, &sb->s_dirty);
} }
} else if (inode->i_state & I_DIRTY) { } else if (inode->i_state & I_DIRTY) {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment