Skip to contentSkip to conversation

xfs: fix uflags detection at xfs_fs_rm_xquota

PATCH In review Jeff Liu 3 participants 6 messages Jul 15, 2014 – Jul 16, 2014 XFS filesystem

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 1/1 xfs: fix uflags detection at xfs_fs_rm_xquota

From: Jie Liu <[email protected]>

We are intended to check up uflags against FS_PROJ_QUOTA rather than FS_USER_UQUOTA once more, it looks to me like a typo, but might cause the project quota metadata space can not be removed.

---
 fs/xfs/xfs_quotaops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_quotaops.c +1 -1
index 4f7aecb..b238027 100644
@@ -123,7 +123,7 @@ xfs_fs_rm_xquota(
 		flags |= XFS_DQ_USER;
 	if (uflags & FS_GROUP_QUOTA)
 		flags |= XFS_DQ_GROUP;
-	if (uflags & FS_USER_QUOTA)
+	if (uflags & FS_PROJ_QUOTA)
 		flags |= XFS_DQ_PROJ;
 
 	return xfs_qm_scall_trunc_qfiles(mp, flags);
Signature · 6 lines
1.8.3.2

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jeff Liu

From: Jie Liu <[email protected]>

We are intended to check up uflags against FS_PROJ_QUOTA rather than FS_USER_UQUOTA once more, it looks to me like a typo, but might cause the project quota metadata space can not be removed.

This code was introduced by commit 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc which attempts to fix the broken quotarm code. Seems like we need a testcase for this functionality or just remove it. Physically removing the quota file never seems that useful to me to start with..

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

author
#2 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Jeff Liu

From: Jie Liu <[email protected]>

We are intended to check up uflags against FS_PROJ_QUOTA rather than FS_USER_UQUOTA once more, it looks to me like a typo, but might cause the project quota metadata space can not be removed.

Quoted 5 lines

This code was introduced by commit 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc which attempts to fix the broken quotarm code. Seems like we need a testcase for this functionality or just remove it. Physically removing the quota file never seems that useful to me to start with..

Is there an approach to verify that a particular quota file inode has been successfully removed? It seems we have to do this in a test case but am not yet figure out a way, or any thoughts for the test case?

Cheers,
-Jeff

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

#3 lore raw
Quoted 9 lines · Jeff Liu
Quoted 5 lines

This code was introduced by commit 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc which attempts to fix the broken quotarm code. Seems like we need a testcase for this functionality or just remove it. Physically removing the quota file never seems that useful to me to start with..

Is there an approach to verify that a particular quota file inode has been successfully removed? It seems we have to do this in a test case but am not yet figure out a way, or any thoughts for the test case?

umount the filesystem and check that the field in the superblock pointing to that kind of quota inode is zeroed out would be my suggestion.

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

author
#4 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 6 lines · Jeff Liu
Quoted 5 lines

This code was introduced by commit 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc which attempts to fix the broken quotarm code. Seems like we need a testcase for this functionality or just remove it. Physically removing the quota file never seems that useful to me to start with..

Quoted 7 lines
Quoted 3 lines

Is there an approach to verify that a particular quota file inode has been successfully removed? It seems we have to do this in a test case but am not yet figure out a way, or any thoughts for the test case?

umount the filesystem and check that the field in the superblock pointing to that kind of quota inode is zeroed out would be my suggestion.

Oh yes, after quota remove, the 'u' field of the quota inode will changed from u.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,16,1,0] to u = (empty) which can be used for the verification, thanks for your suggestion. :)

Cheers,
-Jeff

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

Reviewed-by on v1 1/1
#5 lore raw
In reply to Jeff Liu
Quoted 5 lines · Jeff Liu

From: Jie Liu <[email protected]>

We are intended to check up uflags against FS_PROJ_QUOTA rather than FS_USER_UQUOTA once more, it looks to me like a typo, but might cause the project quota metadata space can not be removed.

Ugh, mea culpa. Thanks for spotting. :(

Thankfully I don't think anyone uses this interface ;)

Quoted 11 lines
---
 fs/xfs/xfs_quotaops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_quotaops.c +0 -0
index 4f7aecb..b238027 100644

fs/xfs/xfs_quotaops.c xfs_fs_rm_xquota( · line 129

Quoted 8 lines
fs/xfs/xfs_quotaops.c +1 -1
@@ -123,7 +123,7 @@ xfs_fs_rm_xquota(
 		flags |= XFS_DQ_USER;
 	if (uflags & FS_GROUP_QUOTA)
 		flags |= XFS_DQ_GROUP;
-	if (uflags & FS_USER_QUOTA)
+	if (uflags & FS_PROJ_QUOTA)
 		flags |= XFS_DQ_PROJ;
 
 	return xfs_qm_scall_trunc_qfiles(mp, flags);

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