From: Greg Freemyer <greg.freemyer@gmail.com>
To: Andreas Dilger <adilger@sun.com>
Cc: Kazuya Mio <k-mio@sx.jp.nec.com>,
linux-ext4@vger.kernel.org, Theodore Tso <tytso@mit.edu>
Subject: Re: [PATCH 2/2] ext4: update donor file's ctime/mtime
Date: Wed, 14 Oct 2009 17:19:33 -0400 [thread overview]
Message-ID: <87f94c370910141419g38b4b371sa1470107953cc47f@mail.gmail.com> (raw)
In-Reply-To: <A1BDA448-5948-4D2E-B456-5AF6F87149DF@sun.com>
On Wed, Oct 14, 2009 at 2:10 PM, Andreas Dilger <adilger@sun.com> wrote:
> On 13-Oct-09, at 18:49, Kazuya Mio wrote:
>>
>> 2009/10/10 2:20, Andreas Dilger wrote::
>>>
>>> On 8-Oct-09, at 02:04, Kazuya Mio wrote:
>>>
>>>> EXT4_IOC_MOVE_EXT changes donor file data, but doesn't update
>>>> ctime/mtime. This patch fixes this problem.
>>>
>>> I would argue that just migrating the file data shouldn't update the
>>> ctime/mtime. Those are used to determine if the file has changed in some
>>> way, usually for the purpose of backup. Migrating the data does not change
>>> anything from user-space POV and shouldn't force a new backup of the file.
>>
>> EXT4_IOC_MOVE_EXT always changes the original actual contents of donor
>> file
>> if orig file and donor file aren't the same. It may be that some of
>> user-space implementations hide such a changing. For example, e4defrag
>> unlinks the donor file, and removes it by decreasing reference count after
>> calling EXT4_IOC_MOVE_EXT. But from the ioctl point of view,
>> EXT4_IOC_MOVE_EXT doesn't know whether donor file will be removed or not,
>> so I think we should update ctime/mtime.
>
> Maybe I am confused. Is EXT4_IOC_MOVE_EXT used for file defragmentation?
> I thought the goal of this ioctl was to copy the data from the donor inode
> to the target inode (using a new allocation in the target inode), and then
> once the whole donor file had been copied (defragmented) the target extents
> replace the entire donor file's extents?
>
> In this model it would be OK to change the mtime/ctime of the _target_ file,
> but when these extents move back to the donor file the mtime/ctime of the
> donor
> file should not be changed, I think, so that it does not force a full
> backup.
>
> If the caller has done something to change the actual data in the donor file
> it can always use utimes() to update the ctime/mtime, but it is not possible
> for userspace to revert the ctime after it has changed.
>
> Cheers, Andreas
> --
> Andreas Dilger
> Sr. Staff Engineer, Lustre Group
> Sun Microsystems of Canada, Inc.
You have it backwards.
The target file is the fragmented file containing good data. ie. It
is the target of the defragmentation process.
The donor file starts out as fallocated file with no valid data in it,
but the data blocks are less fragmented than the target hopefully.
The target file ends up using the data blocks provided by the donor,
but with the target files original data in them.
What the donor has at the end of the process, I don't know for sure.
I assume it is a zero length file that is in need of being deleted.
Having the donor's timestamps seems technically correct, but of little
real world consequence. Or maybe there will eventually be a use case
that reuses the donor file for some purpose.
Greg
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2009-10-14 21:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 8:04 [PATCH 2/2] ext4: update donor file's ctime/mtime Kazuya Mio
2009-10-09 17:20 ` Andreas Dilger
2009-10-14 1:49 ` Kazuya Mio
2009-10-14 18:10 ` Andreas Dilger
2009-10-14 21:19 ` Greg Freemyer [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=87f94c370910141419g38b4b371sa1470107953cc47f@mail.gmail.com \
--to=greg.freemyer@gmail.com \
--cc=adilger@sun.com \
--cc=k-mio@sx.jp.nec.com \
--cc=linux-ext4@vger.kernel.org \
--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).