Whamcloud - gitweb
LU-4310 kernel: missed unlock in quota patch 38/8438/2
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 29 Nov 2013 06:00:54 +0000 (23:00 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 2 Dec 2013 15:43:19 +0000 (15:43 +0000)
The quota-replace-dqptr-sem.patch introduced a regression which
could miss unlock inode->i_lock in __dquot_alloc_space().

Change-Id: If0f240fe76d661909c13b11e3d384e77da3ebbe5
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-on: http://review.whamcloud.com/8438
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11.patch
lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11sp2.patch

index 4aeb39e..be8ea4c 100644 (file)
@@ -234,7 +234,7 @@ diff -urp linux-2.6.32-53.7.orig/fs/quota/dquot.c linux-2.6.32.46-0/fs/quota/dqu
        }
  
        for (cnt = 0; cnt < MAXQUOTAS; cnt++)
-@@ -1513,9 +1517,11 @@ int __dquot_alloc_space(struct inode *in
+@@ -1523,36 +1529,40 @@ int __dquot_alloc_space(struct inode *int inode *in
  
        spin_lock(&dq_data_lock);
        for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
@@ -243,12 +243,14 @@ diff -urp linux-2.6.32-53.7.orig/fs/quota/dquot.c linux-2.6.32.46-0/fs/quota/dqu
 +              if (!dquot[cnt])
                        continue;
 -              if (check_bdq(inode->i_dquot[cnt], number, warn, warntype+cnt)
+-                  == NO_QUOTA) {
 +              atomic_inc(&dquot[cnt]->dq_count);
-+              if (check_bdq(dquot[cnt], number, warn, warntype+cnt)
-                   == NO_QUOTA) {
++              if (check_bdq(dquot[cnt], number, warn, warntype + cnt) ==
++                  NO_QUOTA) {
                        ret = NO_QUOTA;
                        spin_unlock(&dq_data_lock);
-@@ -1523,26 +1529,27 @@ int __dquot_alloc_space(struct inode *in
++                      spin_unlock(&inode->i_lock);
+                       goto out_flush_warn;
                }
        }
        for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
index add80d2..c880dac 100644 (file)
@@ -229,7 +229,7 @@ diff -urp linux-3.0.61-0.orig/fs/quota/dquot.c linux-3.0.61-0/fs/quota/dquot.c
  
        /*
         * First test before acquiring mutex - solves deadlocks when we
-@@ -1557,15 +1560,17 @@ int __dquot_alloc_space(struct inode *in
+@@ -1557,38 +1560,41 @@ int __dquot_alloc_space(struct inode *in
                goto out;
        }
  
@@ -245,12 +245,13 @@ diff -urp linux-3.0.61-0.orig/fs/quota/dquot.c linux-3.0.61-0/fs/quota/dquot.c
 +              if (!dquot[cnt])
                        continue;
 -              ret = check_bdq(inode->i_dquot[cnt], number, !warn,
+-                              warntype+cnt);
 +              atomic_inc(&dquot[cnt]->dq_count);
-+              ret = check_bdq(dquot[cnt], number, !warn,
-                               warntype+cnt);
++              ret = check_bdq(dquot[cnt], number, !warn, warntype + cnt);
                if (ret && !nofail) {
                        spin_unlock(&dq_data_lock);
-@@ -1573,22 +1578,23 @@ int __dquot_alloc_space(struct inode *in
++                      spin_unlock(&inode->i_lock);
+                       goto out_flush_warn;
                }
        }
        for (cnt = 0; cnt < MAXQUOTAS; cnt++) {