From: Jim Meyering <jim@meyering.net>
To: "jeff.liu" <jeff.liu@oracle.com>
Cc: Sunil Mushran <sunil.mushran@oracle.com>,
Paul Eggert <eggert@CS.UCLA.EDU>,
bug-coreutils@gnu.org, Joel Becker <Joel.Becker@oracle.com>,
Chris Mason <chris.mason@oracle.com>,
"linux-ext4\@vger.kernel.org" <linux-ext4@vger.kernel.org>,
Tao Ma <tao.ma@oracle.com>
Subject: Re: bug#6131: [PATCH]: fiemap support for efficient sparse file copy
Date: Fri, 11 Jun 2010 14:38:08 +0200 [thread overview]
Message-ID: <87typ9iw27.fsf@meyering.net> (raw)
In-Reply-To: <4C11F451.8040304@oracle.com> (jeff liu's message of "Fri, 11 Jun 2010 16:31:13 +0800")
jeff.liu wrote:
> Sunil Mushran wrote:
...
>> I guess we'll have to use FIEMAP_FLAG_SYNC.
> Hi Sunil,
>
> Thanks for the comments.
> So we can ensure the source file synced before mapping in this way.
>
> Hi Jim and Paul,
>
> How about the tiny patch below?
...
> Subject: [PATCH 1/1] copy.c: add FIEMAP_FLAG_SYNC to fiemap ioctl
>
> * src/copy.c (fiemap_copy): Force kernel to sync the source
> file before mapping.
>
> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
> ---
> src/copy.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/copy.c b/src/copy.c
> index f149be4..f48c74d 100644
> --- a/src/copy.c
> +++ b/src/copy.c
> @@ -191,6 +191,7 @@ fiemap_copy (int src_fd, int dest_fd, size_t buf_size,
> do
> {
> fiemap->fm_length = FIEMAP_MAX_OFFSET;
> + fiemap->fm_flags = FIEMAP_FLAG_SYNC;
> fiemap->fm_extent_count = count;
Thanks to both of you.
That patch looks fine, Jeff.
However, at least with ext4 and fedora 13, I require
this change to pass "make check". Note the new entry
in the "flags" column:
==> ff2 <==
Filesystem type is: ef53
File size of j2 is 2048 (1 block, blocksize 4096)
ext logical physical expected length flags
0 0 0 1 unknown,delalloc,eof
j2: 1 extent found
So I will apply the test-fixing patch first, then your change,
Jeff, and then rebase to the latest on master.
>From 484903dc41246cb3c774f178f695725561b105a0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 11 Jun 2010 14:34:03 +0200
Subject: [PATCH 1/2] tests: accommodate varying filefrag -v "flags" output
* tests/cp/sparse-fiemap: Accommodate values other than "eof"
in the "flags" column of filefrag -v output
---
tests/cp/sparse-fiemap | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index dc0cf60..b6b1103 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -68,10 +68,11 @@ $PERL -e 1 || skip_test_ 'skipping part of this test; you lack perl'
# Extract logical block number and length pairs from filefrag -v output.
# The initial sed is to remove the "eof" from the normally-empty "flags" field.
+# Similarly, remove flags values like "unknown,delalloc,eof".
# That is required when that final extent has no number in the "expected" field.
f()
{
- sed 's/ eof$//' $@ \
+ sed 's/ [a-z,][a-z,]*$//' $@ \
| awk '/^ *[0-9]/ {printf "%d %d ", $2 ,NF < 5 ? $NF : $5 } END {print ""}'
}
--
1.7.1.501.g23b46
next prev parent reply other threads:[~2010-06-11 12:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4BE41FFF.4020809@oracle.com>
[not found] ` <871vdho68j.fsf@meyering.net>
[not found] ` <4BEC0BCC.3080906@oracle.com>
[not found] ` <87k4qyl6lw.fsf@meyering.net>
[not found] ` <4BF683CC.3060407@oracle.com>
[not found] ` <4BF6ABE7.3020600@oracle.com>
[not found] ` <877hmpeivx.fsf@meyering.net>
[not found] ` <4BFF763A.9010205@oracle.com>
[not found] ` <8763286kni.fsf@meyering.net>
[not found] ` <4C0275FA.1030901@oracle.com>
[not found] ` <874ohpywri.fsf@meyering.net>
[not found] ` <87y6exuc5i.fsf@meyering.net>
[not found] ` <874ohdu5b8.fsf@meyering.net>
[not found] ` <87eighs1t9.fsf@meyering.net>
[not found] ` <4C0FA93C.6020205@oracle.com>
[not found] ` <87iq5sp7eg.fsf@meyering.net>
[not found] ` <4C108CB9.8010805@oracle.com>
[not found] ` <4C11798B.6090500@cs.ucla.edu>
2010-06-11 0:31 ` bug#6131: [PATCH]: fiemap support for efficient sparse file copy Sunil Mushran
2010-06-11 8:31 ` jeff.liu
2010-06-11 12:38 ` Jim Meyering [this message]
2010-06-11 14:03 ` Eric Sandeen
2010-06-13 3:37 ` jeff.liu
2010-06-15 21:09 ` Paul Eggert
2010-06-15 21:11 ` Paul Eggert
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=87typ9iw27.fsf@meyering.net \
--to=jim@meyering.net \
--cc=Joel.Becker@oracle.com \
--cc=bug-coreutils@gnu.org \
--cc=chris.mason@oracle.com \
--cc=eggert@CS.UCLA.EDU \
--cc=jeff.liu@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sunil.mushran@oracle.com \
--cc=tao.ma@oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.