diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-10-17 02:30:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:43:02 -0400 |
commit | 1b43ef91d40190b16ba10218e66d5c2c4ba11de3 (patch) | |
tree | 21d46e09ae07ae8a7ea0b0d9927b1dafb8787155 | |
parent | c986d1e2a460cbce79d631c51519ae82c778c6c5 (diff) |
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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/fs-writeback.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index eb8dc1f22775..a3d7a829137d 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -201,7 +201,6 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc) | |||
201 | { | 201 | { |
202 | unsigned dirty; | 202 | unsigned dirty; |
203 | struct address_space *mapping = inode->i_mapping; | 203 | struct address_space *mapping = inode->i_mapping; |
204 | struct super_block *sb = inode->i_sb; | ||
205 | int wait = wbc->sync_mode == WB_SYNC_ALL; | 204 | int wait = wbc->sync_mode == WB_SYNC_ALL; |
206 | int ret; | 205 | int ret; |
207 | 206 | ||
@@ -237,7 +236,16 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc) | |||
237 | /* | 236 | /* |
238 | * We didn't write back all the pages. nfs_writepages() | 237 | * We didn't write back all the pages. nfs_writepages() |
239 | * sometimes bales out without doing anything. Redirty | 238 | * sometimes bales out without doing anything. Redirty |
240 | * the inode. It is still on sb->s_io. | 239 | * the inode. It is moved from s_io onto s_dirty. |
240 | */ | ||
241 | /* | ||
242 | * akpm: if the caller was the kupdate function we put | ||
243 | * this inode at the head of s_dirty so it gets first | ||
244 | * consideration. Otherwise, move it to the tail, for | ||
245 | * the reasons described there. I'm not really sure | ||
246 | * how much sense this makes. Presumably I had a good | ||
247 | * reasons for doing it this way, and I'd rather not | ||
248 | * muck with it at present. | ||
241 | */ | 249 | */ |
242 | if (wbc->for_kupdate) { | 250 | if (wbc->for_kupdate) { |
243 | /* | 251 | /* |
@@ -257,8 +265,7 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc) | |||
257 | * all the other files. | 265 | * all the other files. |
258 | */ | 266 | */ |
259 | inode->i_state |= I_DIRTY_PAGES; | 267 | inode->i_state |= I_DIRTY_PAGES; |
260 | inode->dirtied_when = jiffies; | 268 | redirty_tail(inode); |
261 | list_move(&inode->i_list, &sb->s_dirty); | ||
262 | } | 269 | } |
263 | } else if (inode->i_state & I_DIRTY) { | 270 | } else if (inode->i_state & I_DIRTY) { |
264 | /* | 271 | /* |