From 56d0c2f8f96e35109cbd16a674e6f74d32e39cbd Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 13 Jan 2011 15:45:47 -0800 Subject: [PATCH] --- yaml --- r: 230701 b: refs/heads/master c: aa373cf550994623efb5d49a4d8775bafd10bbc1 h: refs/heads/master i: 230699: 79c1b134a27aeff32279ea9c72d4beeb32a21bf7 v: v3 --- [refs] | 2 +- trunk/fs/fs-writeback.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e2058eb1a817..94a98f3fe597 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 71927e84e0aebfbe5a91565c3b207af25a4e9162 +refs/heads/master: aa373cf550994623efb5d49a4d8775bafd10bbc1 diff --git a/trunk/fs/fs-writeback.c b/trunk/fs/fs-writeback.c index 482de0a92ca7..9e72d04e706e 100644 --- a/trunk/fs/fs-writeback.c +++ b/trunk/fs/fs-writeback.c @@ -650,6 +650,16 @@ static long wb_writeback(struct bdi_writeback *wb, if (work->nr_pages <= 0) break; + /* + * Background writeout and kupdate-style writeback may + * run forever. Stop them if there is other work to do + * so that e.g. sync can proceed. They'll be restarted + * after the other works are all done. + */ + if ((work->for_background || work->for_kupdate) && + !list_empty(&wb->bdi->work_list)) + break; + /* * For background writeout, stop when we are below the * background dirty threshold