diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-10-16 23:30:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 08:43:01 -0700 |
commit | 6610a0bc8dcc120daa1d93807d470d5cbf777c39 (patch) | |
tree | e98afd34fa859877286c9f67d2b99fc7022c94af /kernel/kthread.c | |
parent | 2b0172e1c6e6aea0a4efcfaaab38d4a02046f45a (diff) | |
download | op-kernel-dev-6610a0bc8dcc120daa1d93807d470d5cbf777c39.zip op-kernel-dev-6610a0bc8dcc120daa1d93807d470d5cbf777c39.tar.gz |
writeback: fix time-ordering of the per-superblock dirty-inode lists
When writeback has finished writing back an inode it looks to see if that
inode is still dirty. If it is, that means that a process redirtied the inode
while its writeback was in progress.
What we need to do here is to refile the redirtied inode onto the s_dirty
list.
But we're doing that wrongly: it could be that this inode was redirtied
_before_ the last inode on s_dirty. We're blindly appending this inode to the
list, after an inode which might be less-recently-dirtied, thus violating the
list's ordering.
So we must either insertion-sort this inode into the correct place, or we must
update this inode's dirtied_when field when appending it to the reverse-sorted
s_dirty list, to preserve the reverse-time-ordering.
This patch does the latter: if this inode was dirtied less recently than the
tail inode then copy the tail inode's timestamp into this inode.
This means that in rare circumstances, some inodes will be writen back later
than they should have been. But the time slip will be small.
Cc: Mike Waychison <mikew@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/kthread.c')
0 files changed, 0 insertions, 0 deletions