Re: s_last_mounted in EXT2

Theodore Y. Ts'o (tytso@MIT.EDU)
Tue, 10 Mar 1998 03:07:22 -0500


From: Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
Date: Tue, 10 Mar 1998 08:41:13 +0100 (MET)

Shouldn't we actually start using s_last_mounted field in ext2 filesystems?

Yes!

I am not sure if it is a good idea to write s_last_mounted even if
s_rev_level is EXT2_GOOD_OLD_REV, but if it is EXT2_DYNAMIC_REV and up, I
think we must fill it - with dentries it is fairly easy.

No, it's safe to do it all the time. With older revisions, that part of
the superblock was empty. So it's safe to do it all the time.

The main reason why it hadn't been up until now was that before
dentries, the ext2 mount code never had access to the mount-path, and it
was hard to do it right. With the dcache code, it is quite easy now.

a) whether someone wrote it already

I don't think so --- go for it!

b) how to actually do it: I think it is best to update it at umount time,
but at the time of put_super it is too late (s_root is lost already).
So one solution might be e.g. to add another super_operation, something like
note_last_mounted(sb) which would be called from d_umount.

It's probably best to do it at mount time, actually. We have the
information then, and we have to write out the superblock anyway to mark
it as unclean (so that it's properly marked as unclean if we crash
without unmounting it).

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu