From: Dave Chinner <david@fromorbit.com>
To: Theodore Ts'o <tytso@mit.edu>, Pavel Machek <pavel@ucw.cz>,
adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
kernel list <linux-kernel@vger.kernel.org>,
jack@suse.cz
Subject: Re: [4.1-rc] File was modified, but mtime stayed the same (according to unison)
Date: Wed, 10 Jun 2015 08:13:19 +1000 [thread overview]
Message-ID: <20150609221319.GA24666@dastard> (raw)
In-Reply-To: <20150609151209.GR19168@thunk.org>
On Tue, Jun 09, 2015 at 11:12:09AM -0400, Theodore Ts'o wrote:
> On Tue, Jun 09, 2015 at 12:43:30PM +0200, Pavel Machek wrote:
> >
> > Hi!
> >
> > Today, I got strange warning from unison:
> >
> > pavel/.config/chromium/Default/Extension State/LOG.old — transport
> > failure
> > • The source file /data/pavel/.config/chromium/Default/Extension
> > State/LOG.old
> > has been modified but the fast update detection mechanism
> > failed to detect it. Try running once with the fastcheck
> > option set to 'no'.
>
> What does this mean, precisely? Is Unison checking that files have
> been modified using some kind of a checksum or file comparison
> mechanism? And I assume that the "fast update detection mechanism"
> using mtime?
>
> And if it has modified, how was it modified (can you do a diff with
> what the other side of the synchronization setup had for that file),
> and do you know by which process. and what was it trying to do? And
> how is unison being run?
>
> One thing that could be going on is that if you have a file which is
> mmap'ed, the mtime field is set the first time the page is modified
> (when the page table entry is set to read/write from read-only). If
> unison then takes a snapshot of the file, and then file is
> subsequently modified via a write to the mmap'ed page, the mtime field
> will not be updated again.
That's not right: when dirty mmap pages are cleaned by writeback the
PTEs are cleaned, too. Hence on the next modification of that page
we will get a new write page fault that modifies the mtime. IOWs, if
the "snapshot" involves writing back the file, then it will be
marked clean and the next page fault will cause the mtime to be
updated.
In general, this means that constantly dirtied mmap files will have
the mtime updated at least every 30s and background writeback cleans
dirty pages. Usually, however, it is much more often than that as
each clean page that is dirtied will cause the mtime to be updated
due to traversal through the ->page_mkwrite -> ext4_page_mkwrite()
-> file_update_time() path.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2015-06-09 22:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 10:43 [4.1-rc] File was modified, but mtime stayed the same (according to unison) Pavel Machek
2015-06-09 15:12 ` Theodore Ts'o
2015-06-09 15:34 ` Pavel Machek
2015-06-09 16:04 ` Theodore Ts'o
2015-06-09 22:13 ` Dave Chinner [this message]
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=20150609221319.GA24666@dastard \
--to=david@fromorbit.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).