I have just noticed that a file whose content is modified under a VFAT loopback mount does not end up with a revised modification time. It may be that updating the mod time on the file whenever a block write occurs is impractical for some reason, but it should surely be possible to update it at unmount time if any write to the FS has occurred, or if writes are not tracked then to modify it at unmount time on the presumption that something was modified, even if it was only the last mount time.
Some followup. Poking at the loopback support code, it looks as if the mtime ought to be getting back propagated, so there is definitely a bug here. Repeat by: find a convenient dos floppy image check the mod time with ls --full-time mount -o loop FILRNAME /some/mnt/point cat - > /some/mnt/point/foobar.txt hi there ^D umount /some/mnt/point check mod time with ls --full-time, notice no change. Following patch provided by mpm@selenic looks to fix the issue: --- l.orig/drivers/block/loop.c 2007-11-05 17:50:07.000000000 -0600 +++ l/drivers/block/loop.c 2007-11-05 17:50:16.000000000 -0600 @@ -299,6 +299,7 @@ static int __do_lo_send_write(struct fil set_fs(get_ds()); bw = file->f_op->write(file, buf, len, &pos); + file_update_time(file); set_fs(old_fs); if (likely(bw == len)) return 0;
Reported upstream.