Re: [PATCH -v2 2/3] mke2fs: print extra information about existing ext2/3/4 file systemsGjj

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

 



On Wed, May 07, 2014 at 03:43:09PM +0200, Lukáš Czerner wrote:
> so the whole thing should look like:
> 
>  +      if (sb->s_mtime) {
>  +              tm = sb->s_mtime;
>  +              if (sb->s_last_mounted[0]) {
>  +                      memset(buf, 0, sizeof(buf));
>  +                      strncpy(buf, sb->s_last_mounted,
>  +                              sizeof(sb->s_last_mounted));
>  +                      printf(_("\tlast mounted on %s on %s"), buf,
>  +                             ctime(&tm));
>  +              } else
>  +                      printf(_("\tlast mounted on %s"), ctime(&tm));
>  +      } else if (sb->s_mkfs_time) {
>  +              tm = sb->s_mkfs_time;
>  +              printf(_("\tcreated on %s"), ctime(&tm));
>  +      } else if (sb->s_wtime) {
>  +              tm = sb->s_wtime;
>  +              printf(_("\tlast modified on %s"), ctime(&tm));
>  +      }

Sorry, that's in fact what I have.

> Also I wonder whether we need to use 'tm' variable, can't we use the
> sb->s_*time directly ? But that's nitpicking.

That's because sb->s_mkfs_time is a __u32, and time_t isn't
necessarily be a 32-bit type (and in fact isn't on x86_64, x32,
apropos of current discussion happening on ksummit-discuss.)  Yes,
that means the ext4 superblock has a 2038 problem, but that's a
separate issue that we should fix one of these days....

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




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux