From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Jorg Schummer <ext-jorg.2.schummer@nokia.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
jorg@ml1.net
Subject: Re: [PATCH take 3][RFC] fat: Save FAT root directory timestamps to volume label
Date: Fri, 18 Sep 2009 20:33:06 +0900 [thread overview]
Message-ID: <878wgcsd1p.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <1252420448-7282-1-git-send-email-ext-jorg.2.schummer@nokia.com> (Jorg Schummer's message of "Tue, 8 Sep 2009 17:34:08 +0300")
Jorg Schummer <ext-jorg.2.schummer@nokia.com> writes:
> Standard FAT implementations cannot store any of the FAT root directory's
> timestamps. This commit adds the mount option 'rootts', which allows saving
> the FAT root directory timestamps as the timestamps of the FAT volume label
> directory entry. At least Mac OS X is known to support the same mechanism
> and interoperate with this commit.
>
> When mounting, the following values can be specified for the 'rootts' mount
> option:
>
> "rootts=ignore" ignores root directory timestamps. All timestamps are
> reset to 0 (1/1/1970). This has been the FAT behaviour
> prior to this patch.
>
> "rootts=preserve" tries to load and save the root directory's timestamps
> if a volume label entry exists. The mtime and atime are
> corrected based on root directory entries' ctime. This
> is the default.
>
> "rootts=save" tries to load and save the root directory's timestamps.
> The mtime and atime are corrected based on root
> directory entries' ctime. If the root directory was
> accessed but no volume label entry exists, the label
> "NO NAME" is created.
Um..., I'm still not sure though. rootts=save may not be needed for
this, because it seems a bit complex, and it can do on userland...
And some quick review of implement..
> + if (inode->i_ino == MSDOS_ROOT_INO) {
> + if (sbi->options.root_ts == FAT_ROOT_TS_IGNORE)
> + return 0;
> +
> + /* Write the timestamps of a FAT file system's root directory
> + * as the timestamps of the file system's label dir entry. */
> +
> + if (!MSDOS_I(inode)->i_pos) {
> + struct buffer_head *bh;
> + struct msdos_dir_entry *de;
> + loff_t i_pos;
> +
> + if (sbi->options.root_ts != FAT_ROOT_TS_SAVE)
> + /* No label present, but we should not
> + create one. Thus not complaining. */
> + return 0;
> +
> + printk(KERN_INFO "FAT: creating volume label "
> + "on %s to save root dir timestamps\n",
> + sb->s_id);
> +
> + err = fat_add_label_entry(inode, NULL);
> + if (err)
> + return err;
> + err = fat_get_label_entry(inode, &bh, &de, &i_pos);
> + if (err)
> + return err;
In this path, we don't have inode->i_mutex, so to look directry up is
wrong. I think adding label may move to userland.
I guess we should do all of preparation in fill_super().
> + remove_inode_hash(inode);
> + fat_attach(inode, i_pos);
> + insert_inode_hash(inode);
> + brelse(bh);
Root inode should never change the position, so this shouldn't be
needed.
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2009-09-18 11:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 15:00 [PATCH][RFC] fat: Save FAT root directory timestamps to volume label Jorg Schummer
2009-07-24 9:43 ` [PATCH take 2][RFC] " Jorg Schummer
2009-07-25 5:48 ` OGAWA Hirofumi
2009-07-27 10:47 ` Jörg Schummer
2009-07-27 11:47 ` OGAWA Hirofumi
2009-07-27 13:03 ` Jörg Schummer
2009-07-27 14:56 ` Jörg Schummer
2009-07-27 15:10 ` OGAWA Hirofumi
2009-08-04 8:42 ` Jörg Schummer
2009-08-04 10:32 ` OGAWA Hirofumi
2009-09-08 14:28 ` [PATCH take 3][RFC] " Jörg Schummer
2009-09-08 14:34 ` Jorg Schummer
2009-09-08 15:39 ` Jamie Lokier
2009-09-09 7:47 ` Jörg Schummer
2009-09-15 11:03 ` Jörg Schummer
2009-09-18 11:33 ` OGAWA Hirofumi [this message]
2009-09-18 12:14 ` jorg
2009-09-19 14:46 ` OGAWA Hirofumi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878wgcsd1p.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=ext-jorg.2.schummer@nokia.com \
--cc=jorg@ml1.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox