Skip to contentSkip to conversation

ext3: Fix hang on umount with quotas when journal is aborted

PATCH New Jan Kara 1 participant 1 message Apr 2, 2008

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 ext3: Fix hang on umount with quotas when journal is aborted

Call dquot_drop() from ext3_dquot_drop() even if we fail to start a transaction. Otherwise we never get to dropping references to quota structures from the inode and umount will hang indefinitely. Thanks to Payphone LIOU for spotting the problem.

CC Payphone LIOU <[email protected]>
---
 fs/ext3/super.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
fs/ext3/super.c +7 -1
index ad53606..77e9702 100644
@@ -2639,8 +2639,14 @@ static int ext3_dquot_drop(struct inode *inode)
 
 	/* We may delete quota structure so we need to reserve enough blocks */
 	handle = ext3_journal_start(inode, 2*EXT3_QUOTA_DEL_BLOCKS(inode->i_sb));
-	if (IS_ERR(handle))
+	if (IS_ERR(handle)) {
+		/*
+		 * We call dquot_drop() anyway to at least release references
+		 * to quota structures so that umount does not hang.
+		 */
+		dquot_drop(inode);
 		return PTR_ERR(handle);
+	}
 	ret = dquot_drop(inode);
 	err = ext3_journal_stop(handle);
 	if (!ret)
Signature · 1 line
1.5.2.4