aboutsummaryrefslogtreecommitdiffstats
path: root/fs/quota/dquot.c
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-10-23 18:57:10 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-10-23 18:57:10 +0200
commitde04df3a2555ac04d19c3ad6528503d5bf4ab0e7 (patch)
treefb3c0b36662106c463ad73b2ed5f1c48d325484a /fs/quota/dquot.c
parent25fbe5ca4d0f37170451b682bd150a70f944aca0 (diff)
downloadkernel_samsung_smdk4412-de04df3a2555ac04d19c3ad6528503d5bf4ab0e7.zip
kernel_samsung_smdk4412-de04df3a2555ac04d19c3ad6528503d5bf4ab0e7.tar.gz
kernel_samsung_smdk4412-de04df3a2555ac04d19c3ad6528503d5bf4ab0e7.tar.bz2
getting newer filesystem code working
Diffstat (limited to 'fs/quota/dquot.c')
-rw-r--r--fs/quota/dquot.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 5b572c8..3d5d717 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -580,9 +580,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 */