From 8af0717122c679b10bfe7734b9dcc3a61355018f Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 9 Jun 2010 15:31:01 +0200 Subject: [PATCH] --- yaml --- r: 200622 b: refs/heads/master c: 29cb48594b873f6193d6327097e504bd3e2314de h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/fs-writeback.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 1b6da6984a9f..c1f07c5943a0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 334132ae921a14ac2b2ba48e174136f7f2c9aae1 +refs/heads/master: 29cb48594b873f6193d6327097e504bd3e2314de diff --git a/trunk/fs/fs-writeback.c b/trunk/fs/fs-writeback.c index 3a066e91ec8d..0609607d3955 100644 --- a/trunk/fs/fs-writeback.c +++ b/trunk/fs/fs-writeback.c @@ -534,19 +534,21 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc) static bool pin_sb_for_writeback(struct super_block *sb) { spin_lock(&sb_lock); + if (list_empty(&sb->s_instances)) { + spin_unlock(&sb_lock); + return false; + } + sb->s_count++; + spin_unlock(&sb_lock); + if (down_read_trylock(&sb->s_umount)) { - if (sb->s_root) { - spin_unlock(&sb_lock); + if (sb->s_root) return true; - } - /* - * umounted, drop rwsem again and fall through to failure - */ up_read(&sb->s_umount); } - sb->s_count--; - spin_unlock(&sb_lock); + + put_super(sb); return false; }