Skip to contentSkip to conversation

xfs: Fix quota type in quota structures when reusing quota file

PATCH In review Jan Kara 2 participants 4 messages Feb 17, 2015 – Feb 25, 2015 XFS filesystem

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 xfs: Fix quota type in quota structures when reusing quota file

For filesystems without separate project quota inode field in the superblock we just reuse project quota file for group quotas (and vice versa) if project quota file is allocated and we need group quota file. When we reuse the file, quota structures on disk suddenly have wrong type stored in d_flags though. Nobody really cares about this (although structure type reported to userspace was wrong as well) except that after commit 14bf61ffe6ac (quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units) assertion in xfs_qm_scall_getquota() started to trigger on xfs/106 test (apparently I was testing without XFS_DEBUG so I didn't notice when submitting the above commit).

Fix the problem by properly resetting ddq->d_flags when running quotacheck for a quota file.

---
 fs/xfs/xfs_qm.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/xfs/xfs_qm.c +5 -0
index 3e8186279541..dd0dcc7b76cd 100644
@@ -836,6 +836,11 @@ xfs_qm_reset_dqcounts(
 		 */
 		xfs_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR,
 			    "xfs_quotacheck");
+		/*
+		 * Reset type in case we are reusing group quota file for
+		 * project quotas or vice versa
+		 */
+		ddq->d_flags = type;
 		ddq->d_bcount = 0;
 		ddq->d_icount = 0;
 		ddq->d_rtbcount = 0;
Signature · 6 lines
2.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#1 lore raw

Ping? Can you guys please review / pick-up the fix? Thanks!

Honza

Quoted 41 lines · Jan Kara

For filesystems without separate project quota inode field in the superblock we just reuse project quota file for group quotas (and vice versa) if project quota file is allocated and we need group quota file. When we reuse the file, quota structures on disk suddenly have wrong type stored in d_flags though. Nobody really cares about this (although structure type reported to userspace was wrong as well) except that after commit 14bf61ffe6ac (quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units) assertion in xfs_qm_scall_getquota() started to trigger on xfs/106 test (apparently I was testing without XFS_DEBUG so I didn't notice when submitting the above commit).

Fix the problem by properly resetting ddq->d_flags when running quotacheck for a quota file.

---
 fs/xfs/xfs_qm.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/xfs/xfs_qm.c +5 -0
index 3e8186279541..dd0dcc7b76cd 100644
@@ -836,6 +836,11 @@ xfs_qm_reset_dqcounts(
 		 */
 		xfs_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR,
 			    "xfs_quotacheck");
+		/*
+		 * Reset type in case we are reusing group quota file for
+		 * project quotas or vice versa
+		 */
+		ddq->d_flags = type;
 		ddq->d_bcount = 0;
 		ddq->d_icount = 0;
 		ddq->d_rtbcount = 0;
Signature · 1 line
2.1.4
Signature · 7 lines
Jan Kara <[email protected]>
SUSE Labs, CR

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw
Quoted 2 lines · Jan Kara

Ping? Can you guys please review / pick-up the fix? Thanks!

Looks like this is in Dave's tree:

commit dfcc70a8c868fe03276fa59864149708fb41930b

Author: Jan Kara <[email protected]>
Date:   Mon Feb 23 22:34:17 2015 +1100

xfs: Fix quota type in quota structures when reusing quota file

...

Brian

Quoted 36 lines

Honza

Quoted 33 lines · Jan Kara

For filesystems without separate project quota inode field in the superblock we just reuse project quota file for group quotas (and vice versa) if project quota file is allocated and we need group quota file. When we reuse the file, quota structures on disk suddenly have wrong type stored in d_flags though. Nobody really cares about this (although structure type reported to userspace was wrong as well) except that after commit 14bf61ffe6ac (quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units) assertion in xfs_qm_scall_getquota() started to trigger on xfs/106 test (apparently I was testing without XFS_DEBUG so I didn't notice when submitting the above commit).

Fix the problem by properly resetting ddq->d_flags when running quotacheck for a quota file.

---
 fs/xfs/xfs_qm.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/xfs/xfs_qm.c +3 -0
index 3e8186279541..dd0dcc7b76cd 100644
@@ -836,6 +836,11 @@ xfs_qm_reset_dqcounts(
 		 */
 		xfs_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR,
 			    "xfs_quotacheck");
+		/*
+		 * Reset type in case we are reusing group quota file for
+		 * project quotas or vice versa
Quoted 16 lines
Quoted 8 lines
fs/xfs/xfs_qm.c +2 -0
+		 */
+		ddq->d_flags = type;
 		ddq->d_bcount = 0;
 		ddq->d_icount = 0;
 		ddq->d_rtbcount = 0;
Signature · 1 line
2.1.4
Signature · 7 lines
Jan Kara <[email protected]>
SUSE Labs, CR

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

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

author
#3 lore raw
Quoted 11 lines · Brian Foster
Quoted 2 lines · Jan Kara

Ping? Can you guys please review / pick-up the fix? Thanks!

Looks like this is in Dave's tree:

commit dfcc70a8c868fe03276fa59864149708fb41930b

Author: Jan Kara <[email protected]>
Date:   Mon Feb 23 22:34:17 2015 +1100

xfs: Fix quota type in quota structures when reusing quota file

Ah, sorry. I should have checked.

Honza

Quoted 50 lines
Quoted 50 lines · Jan Kara
Quoted 41 lines

For filesystems without separate project quota inode field in the superblock we just reuse project quota file for group quotas (and vice versa) if project quota file is allocated and we need group quota file. When we reuse the file, quota structures on disk suddenly have wrong type stored in d_flags though. Nobody really cares about this (although structure type reported to userspace was wrong as well) except that after commit 14bf61ffe6ac (quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units) assertion in xfs_qm_scall_getquota() started to trigger on xfs/106 test (apparently I was testing without XFS_DEBUG so I didn't notice when submitting the above commit).

Fix the problem by properly resetting ddq->d_flags when running quotacheck for a quota file.

---
 fs/xfs/xfs_qm.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/xfs/xfs_qm.c +5 -0
index 3e8186279541..dd0dcc7b76cd 100644
@@ -836,6 +836,11 @@ xfs_qm_reset_dqcounts(
 		 */
 		xfs_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR,
 			    "xfs_quotacheck");
+		/*
+		 * Reset type in case we are reusing group quota file for
+		 * project quotas or vice versa
+		 */
+		ddq->d_flags = type;
 		ddq->d_bcount = 0;
 		ddq->d_icount = 0;
 		ddq->d_rtbcount = 0;
Signature · 1 line
2.1.4
Signature · 7 lines
Jan Kara <[email protected]>
SUSE Labs, CR

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Signature · 7 lines
Jan Kara <[email protected]>
SUSE Labs, CR

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