diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-02 21:26:30 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-02 21:26:30 -0800 |
commit | 8cb38e9921940f3775da841d6758e4500d99e8ab (patch) | |
tree | 044b0e4e4818feea97008291dbf2ac4e4e2307c3 /fs/quota/dquot.c | |
parent | 927c4dac34cf465089b8d3ff570147ae3ce1a984 (diff) | |
parent | 0414855fdc4a40da05221fc6062cccbc0c30f169 (diff) |
Merge 3.14-rc5 into usb-next
We want the fixes here too.
Diffstat (limited to 'fs/quota/dquot.c')
-rw-r--r-- | fs/quota/dquot.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 831d49a4111f..cfc8dcc16043 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -581,9 +581,17 @@ int dquot_scan_active(struct super_block *sb, dqstats_inc(DQST_LOOKUPS); dqput(old_dquot); old_dquot = dquot; - ret = fn(dquot, priv); - if (ret < 0) - goto out; + /* + * ->release_dquot() can be racing with us. Our reference + * protects us from new calls to it so just wait for any + * outstanding call and recheck the DQ_ACTIVE_B after that. + */ + wait_on_dquot(dquot); + if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { + ret = fn(dquot, priv); + if (ret < 0) + goto out; + } spin_lock(&dq_list_lock); /* We are safe to continue now because our dquot could not * be moved out of the inuse list while we hold the reference */ |