public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs <linux-xfs@vger.kernel.org>,
	stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH STABLE] xfs: trim IO to found COW exent limit
Date: Wed, 23 Sep 2020 15:59:39 -0700	[thread overview]
Message-ID: <20200923225939.GY7955@magnolia> (raw)
In-Reply-To: <34c164fb-d616-1467-c96a-77c99e436421@redhat.com>

On Wed, Sep 23, 2020 at 05:37:39PM -0500, Eric Sandeen wrote:
> Here's a reproducer for the bug.
> 
> Requires sufficient privs to mount a loopback fs.

Please turn this into an fstest case, but otherwise this looks
reasonable.

--D

> 
> ======
> 
> #!/bin/bash
> 
> mkdir -p mnt
> umount mnt &>/dev/null
> 
> # Create 8g fs image
> mkfs.xfs -f -dfile,name=fsfile.img,size=8g &>/dev/null
> mount -o loop fsfile.img mnt
> 
> # Make all files w/ 1m hints; create original 2m file
> xfs_io -c "extsize 1048576" mnt
> xfs_io -c "cowextsize 1048576" mnt
> 
> echo "Create file mnt/b"
> xfs_io -f -c "pwrite -S 0x0 0 2m" -c fsync mnt/b &>/dev/null
> 
> # Make a reflinked copy
> echo "Reflink copy from mnt/b to mnt/a"
> cp --reflink=always mnt/b mnt/a
> 
> echo "Contents of mnt/b"
> hexdump -C mnt/b
> 
> # Cycle mount to get stuff out of cache
> umount mnt
> mount -o loop fsfile.img mnt
> 
> # Create a 1m-hinted IO at offset 0, then
> # do another IO that overlaps but extends past the 1m hint
> echo "Write to mnt/a"
> xfs_io -c "pwrite -S 0xa 0k -b 4k 4k" \
>        -c "pwrite -S 0xa 4k -b 1m 1m" \
>        mnt/a &>/dev/null
> 
> xfs_io -c fsync mnt/a
> 
> echo "Contents of mnt/b now:"
> hexdump -C mnt/b
> 
> umount mnt
> 

  reply	other threads:[~2020-09-23 23:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 22:35 [PATCH STABLE] xfs: trim IO to found COW exent limit Eric Sandeen
2020-09-23 22:37 ` Eric Sandeen
2020-09-23 22:59   ` Darrick J. Wong [this message]
2020-09-23 23:53     ` Eric Sandeen
2020-09-23 22:58 ` Darrick J. Wong
2020-09-24  4:03 ` Christoph Hellwig

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=20200923225939.GY7955@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=stable@vger.kernel.org \
    /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