* [PATCH] xfsprogs: xfs_quota: don't print invalid quota file inode number
@ 2011-09-28 11:15 Alex Elder
2011-09-29 11:05 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Alex Elder @ 2011-09-28 11:15 UTC (permalink / raw)
To: xfs; +Cc: Alex Elder
When the state of quota files is dumped, xfs_quota blindly shows
whatever inode number is returned by the kernel. If one of the
quota types is not enabled or enforced, the inode number provided
is an invalid value ((__u64) -1). Rather than print a meaningless
large integer, print "N/A" in its place to make interpreting the
result it a little more obvious.
Signed-off-by: Alex Elder <aelder@sgi.com>
---
quota/state.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/quota/state.c b/quota/state.c
index 3862e67..42bffc0 100644
--- a/quota/state.c
+++ b/quota/state.c
@@ -122,10 +122,13 @@ state_qfilestat(
mount->fs_dir, mount->fs_name);
fprintf(fp, _(" Accounting: %s\n"), accounting ? _("ON") : _("OFF"));
fprintf(fp, _(" Enforcement: %s\n"), enforcing ? _("ON") : _("OFF"));
- fprintf(fp, _(" Inode: #%llu (%llu blocks, %lu extents)\n"),
- (unsigned long long)qfs->qfs_ino,
- (unsigned long long)qfs->qfs_nblks,
- (unsigned long)qfs->qfs_nextents);
+ if (qfs->qfs_ino != (__u64) -1)
+ fprintf(fp, _(" Inode: #%llu (%llu blocks, %lu extents)\n"),
+ (unsigned long long)qfs->qfs_ino,
+ (unsigned long long)qfs->qfs_nblks,
+ (unsigned long)qfs->qfs_nextents);
+ else
+ fprintf(fp, _(" Inode: N/A\n"));
}
static void
--
1.7.6.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfsprogs: xfs_quota: don't print invalid quota file inode number
2011-09-28 11:15 [PATCH] xfsprogs: xfs_quota: don't print invalid quota file inode number Alex Elder
@ 2011-09-29 11:05 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2011-09-29 11:05 UTC (permalink / raw)
To: Alex Elder; +Cc: xfs
On Wed, Sep 28, 2011 at 06:15:37AM -0500, Alex Elder wrote:
> When the state of quota files is dumped, xfs_quota blindly shows
> whatever inode number is returned by the kernel. If one of the
> quota types is not enabled or enforced, the inode number provided
> is an invalid value ((__u64) -1). Rather than print a meaningless
> large integer, print "N/A" in its place to make interpreting the
> result it a little more obvious.
>
> Signed-off-by: Alex Elder <aelder@sgi.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-29 11:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28 11:15 [PATCH] xfsprogs: xfs_quota: don't print invalid quota file inode number Alex Elder
2011-09-29 11:05 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox