[PATCH 2/2] xfs_db: interpret inode timestamps as signed integers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

The Linux kernel treats core.*time.sec as a signed integer value, so
xfs_db should do likewise, or else files will have inconsistent times
if the seconds count is negative.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 db/fprint.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/db/fprint.c b/db/fprint.c
index 261a31e..e8eb510 100644
--- a/db/fprint.c
+++ b/db/fprint.c
@@ -147,7 +147,8 @@ fp_time(
 	     i++, bitpos += size) {
 		if (array)
 			dbprintf("%d:", i + base);
-		t=(time_t)getbitval((char *)obj + byteize(bitpos), 0, sizeof(int32_t)*8, 0);
+		t = (time_t)getbitval((char *)obj + byteize(bitpos), 0,
+				sizeof(int32_t) * 8, BVSIGNED);
 		c = ctime(&t);
 		dbprintf("%24.24s", c);
 		if (i < count - 1)

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux