Bug 367691 - RW loopback mount does not update file mod time
Summary: RW loopback mount does not update file mod time
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 7
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-05 23:12 UTC by Jonathan S. Shapiro
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-27 23:29:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jonathan S. Shapiro 2007-11-05 23:12:46 UTC
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.

Comment 1 Jonathan S. Shapiro 2007-11-05 23:56:58 UTC
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;

Comment 2 Chuck Ebbert 2007-11-27 23:29:33 UTC
Reported upstream.


Note You need to log in before you can comment on or make changes to this bug.