From: Liu Bo <bo.li.liu@oracle.com>
To: Mark Fasheh <mfasheh@suse.de>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
David Sterba <dsterba@suse.cz>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/5] btrfs: pass unaligned length to btrfs_cmp_data()
Date: Thu, 25 Jun 2015 11:04:01 +0800 [thread overview]
Message-ID: <20150625030400.GC23794@localhost.localdomain> (raw)
In-Reply-To: <1435094920-22442-2-git-send-email-mfasheh@suse.de>
On Tue, Jun 23, 2015 at 02:28:36PM -0700, Mark Fasheh wrote:
> In the case that we dedupe the tail of a file, we might expand the dedupe
> len out to the end of our last block. We don't want to compare data past
> i_size however, so pass the original length to btrfs_cmp_data().
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
>
> Signed-off-by: Mark Fasheh <mfasheh@suse.de>
> Reviewed-by: David Sterba <dsterba@suse.cz>
> ---
> fs/btrfs/ioctl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 2d24ff4..2deea1f 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -2933,7 +2933,8 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
> goto out_unlock;
> }
>
> - ret = btrfs_cmp_data(src, loff, dst, dst_loff, len);
> + /* pass original length for comparison so we stay within i_size */
> + ret = btrfs_cmp_data(src, loff, dst, dst_loff, olen);
> if (ret == 0)
> ret = btrfs_clone(src, dst, loff, olen, len, dst_loff);
>
> --
> 2.1.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-06-25 3:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 21:28 [PATCH 0/5] btrfs: dedupe fixes, features V3 Mark Fasheh
2015-06-23 21:28 ` [PATCH 1/5] btrfs: pass unaligned length to btrfs_cmp_data() Mark Fasheh
2015-06-25 3:04 ` Liu Bo [this message]
2015-06-23 21:28 ` [PATCH 2/5] btrfs: fix deadlock with extent-same and readpage Mark Fasheh
2015-06-25 3:16 ` Liu Bo
2015-06-23 21:28 ` [PATCH 3/5] btrfs: fix clone / extent-same deadlocks Mark Fasheh
2015-06-23 21:28 ` [PATCH 4/5] btrfs: allow dedupe of same inode Mark Fasheh
2015-06-23 21:28 ` [PATCH 5/5] btrfs: add no_mtime flag to btrfs-extent-same Mark Fasheh
-- strict thread matches above, loose matches on Subject: below --
2015-06-30 21:42 [PATCH 0/5] btrfs: dedupe fixes, features V5 Mark Fasheh
2015-06-30 21:42 ` [PATCH 1/5] btrfs: pass unaligned length to btrfs_cmp_data() Mark Fasheh
2015-06-26 21:00 [PATCH 0/5] btrfs: dedupe fixes, features V4 Mark Fasheh
2015-06-26 21:00 ` [PATCH 1/5] btrfs: pass unaligned length to btrfs_cmp_data() Mark Fasheh
2015-06-22 22:47 [PATCH 0/5] btrfs: dedupe fixes, features V2 Mark Fasheh
2015-06-22 22:47 ` [PATCH 1/5] btrfs: pass unaligned length to btrfs_cmp_data() Mark Fasheh
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=20150625030400.GC23794@localhost.localdomain \
--to=bo.li.liu@oracle.com \
--cc=clm@fb.com \
--cc=dsterba@suse.cz \
--cc=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mfasheh@suse.de \
/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