public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix the grace time in xfs_quota
@ 2007-02-15  7:39 Utako Kusaka
  2007-02-16  5:31 ` Donald Douwsma
  0 siblings, 1 reply; 2+ messages in thread
From: Utako Kusaka @ 2007-02-15  7:39 UTC (permalink / raw)
  To: xfs

Hi,

When a quota limit is reached at a soft limit, xfs_quota(8) shows the 
incorrect grace time.
Because, the subtraction with '__uint32_t' and 'time_t' are done in 
time_to_string(), and the result does not become a negative value, but
a huge value. This patch fixes it.

Example:
xfs_quota> report
User quota on /home/utako/mpnt (/dev/sda6)
                               Blocks
User ID          Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
root          3145728       1000       2000     00 [--none--]
utako            1000       1000       2000     00 [00:00:4294967286]  <--

Group quota on /home/utako/mpnt (/dev/sda6)
                               Blocks
Group ID         Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
root          3145728          0          0     00 [--------]
users            1000          0          0     00 [--------]


Signed-off-by: Utako Kusaka <utako@tnes.nec.co.jp>
---

--- xfsprogs-2.8.18-orgn/quota/quota.h	2006-12-13 13:57:23.000000000 +0900
+++ xfsprogs-2.8.18/quota/quota.h	2007-02-15 11:51:20.000000000 +0900
@@ -49,7 +49,7 @@ enum {
  */
 extern char *type_to_string(uint __type);
 extern char *form_to_string(uint __form);
-extern char *time_to_string(__uint32_t __time, uint __flags);
+extern char *time_to_string(time_t __time, uint __flags);
 extern char *bbs_to_string(__uint64_t __v, char *__c, uint __size);
 extern char *num_to_string(__uint64_t __v, char *__c, uint __size);
 extern char *pct_to_string(__uint64_t __v, __uint64_t __t, char *__c, uint __s);


--- xfsprogs-2.8.18-orgn/quota/util.c	2006-12-13 13:57:23.000000000 +0900
+++ xfsprogs-2.8.18/quota/util.c	2007-02-15 11:51:51.000000000 +0900
@@ -29,7 +29,7 @@
 
 char *
 time_to_string(
-	__uint32_t	origin,
+	time_t		origin,
 	uint		flags)
 {
 	static char	timestamp[32];

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-16  5:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-15  7:39 [PATCH] fix the grace time in xfs_quota Utako Kusaka
2007-02-16  5:31 ` Donald Douwsma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox