From: Andreas Dilger Date: Fri, 29 Nov 2013 06:00:54 +0000 (-0700) Subject: LU-4310 kernel: missed unlock in quota patch X-Git-Tag: 2.5.52~3 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=645d1e9b51ce8dc08e4f7820070d39168a32f9c5 LU-4310 kernel: missed unlock in quota patch 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 Signed-off-by: Andreas Dilger Reviewed-on: http://review.whamcloud.com/8438 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Johann Lombardi Reviewed-by: James Simmons --- diff --git a/lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11.patch b/lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11.patch index 4aeb39e..be8ea4c 100644 --- a/lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11.patch +++ b/lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11.patch @@ -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++) { diff --git a/lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11sp2.patch b/lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11sp2.patch index add80d2..c880dac 100644 --- a/lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11sp2.patch +++ b/lustre/kernel_patches/patches/quota-replace-dqptr-sem-sles11sp2.patch @@ -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++) {