Skip to contentSkip to conversation

xfs: fix double IRELE in xfs_dqrele_inode

PATCH In review Christoph Hellwig 2 participants 2 messages Oct 12, 2009 – Oct 13, 2009 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: fix double IRELE in xfs_dqrele_inode

xfs_dqrele_inode calls xfs_iput to release the ilock and a reference and then also calls IRELE which does a second decrement of the reference count. This leads to a premature freeing of inodes when quotas were turned off while the filesystem was mounted.

Thanks to Utako Kusaka for reporting the bug and provinding a good testcase.

fs/xfs/quota/xfs_qm_syscalls.c +0 -1
Index: xfs/fs/xfs/quota/xfs_qm_syscalls.c
===================================================================
@@ -876,7 +876,6 @@ xfs_dqrele_inode(
 		ip->i_gdquot = NULL;
 	}
 	xfs_iput(ip, XFS_ILOCK_EXCL);
-	IRELE(ip);
 
 	return 0;
 }

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Christoph Hellwig

xfs_dqrele_inode calls xfs_iput to release the ilock and a reference and then also calls IRELE which does a second decrement of the reference count. This leads to a premature freeing of inodes when quotas were turned off while the filesystem was mounted.

Regression was caused by fe588ed32867b42e0d906db558ca92fd9f8b128e

Fix looks good. I'll push it to Linus tomorrow.

Quoted 4 lines

Thanks to Utako Kusaka for reporting the bug and provinding a good testcase.

Quoted 13 lines

Index: xfs/fs/xfs/quota/xfs_qm_syscalls.c
===================================================================

fs/xfs/quota/xfs_qm_syscalls.c +0 -1
@@ -876,7 +876,6 @@ xfs_dqrele_inode(
 		ip->i_gdquot = NULL;
 	}
 	xfs_iput(ip, XFS_ILOCK_EXCL);
-	IRELE(ip);
 
 	return 0;
 }
Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs