Bug 367691 - RW loopback mount does not update file mod time
RW loopback mount does not update file mod time
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-05 18:12 EST by Jonathan S. Shapiro
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-27 18:29:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan S. Shapiro 2007-11-05 18:12:46 EST
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 18:56:58 EST
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 18:29:33 EST
Reported upstream.

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