From: Chris Mason <chris.mason@fusionio.com>
To: Steve French <smfrench@gmail.com>, Zach Brown <zab@redhat.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
"linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>,
"J. Bruce Fields" <bfields@fieldses.org>
Subject: Re: [RFC v0 1/4] vfs: add copy_range syscall and vfs entry point
Date: Wed, 15 May 2013 16:16:14 -0400 [thread overview]
Message-ID: <20130515201614.24668.83788@localhost.localdomain> (raw)
In-Reply-To: <CAH2r5mtA54fM-M1X7MS0FNeuXFh91UoarJ5QiKTk=vdSXHWFHg@mail.gmail.com>
Quoting Steve French (2013-05-15 16:08:16)
> On Wed, May 15, 2013 at 2:36 PM, Zach Brown <zab@redhat.com> wrote:
> > On Wed, May 15, 2013 at 12:50:13PM -0500, Steve French wrote:
> >> Doesn't the new syscall have to invalidate the page cache pages that
> >> the server is about to overwrite as btrfs does with the following line
> >> in fs/btrfs/ioctl.c
> >>
> >> truncate_inode_pages_range(&inode->i_data, destoff,
> >> PAGE_CACHE_ALIGN(destoff + len) - 1);
> >
> > The file_operations ->copy_range implementation is responsible for this,
> > yeah, similar to ->write being responsible for invalidating around
> > O_DIRECT writes.
> >
> >> (and doesn't truncate_inode_pages_range handle page cache alignment
> >> anyway
> >
> > No, it bugs if given an end offset that isn't page aligned:
> >
> > BUG_ON((lend & (PAGE_CACHE_SIZE - 1)) != (PAGE_CACHE_SIZE - 1));
> >
> > Lukas is working on a patch series to fix this:
> >
> > http://marc.info/?l=linux-fsdevel&m=136854986101843&w=2
> >
> >> - and also why did btrfs use truncate_inode_pages_range instead
> >> of invalidate?)
> >
> > I'm not sure. Maybe they can have racing dirty pages and want them
> > thrown away rather than having invalidation fail?
truncate_inode_pages_range ends with invalidate. It just locks the page
first and makes sure to wait for writeback if it was already in
progress.
Looking at the btrfs side, I think we should add some locking on the
destination extents as well.
next prev parent reply other threads:[~2013-05-15 20:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 17:50 [RFC v0 1/4] vfs: add copy_range syscall and vfs entry point Steve French
2013-05-15 18:54 ` J. Bruce Fields
[not found] ` <20130515185429.GA25994-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2013-05-15 19:39 ` Zach Brown
[not found] ` <CAH2r5ms0P8Hgv1mUpyHA32Er38iiaC1HHC4fhxvz2SBFy6Sucw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-15 19:36 ` Zach Brown
[not found] ` <20130515193600.GA318-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2013-05-15 20:08 ` Steve French
2013-05-15 20:16 ` Chris Mason [this message]
[not found] ` <20130515201614.24668.83788-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2013-05-15 20:21 ` Steve French
2013-05-15 20:25 ` Chris Mason
-- strict thread matches above, loose matches on Subject: below --
2013-05-14 21:15 [RFC v0 0/4] sys_copy_range() rough draft Zach Brown
2013-05-14 21:15 ` [RFC v0 1/4] vfs: add copy_range syscall and vfs entry point Zach Brown
2013-05-15 19:44 ` Eric Wong
2013-05-15 20:03 ` Zach Brown
2013-05-16 21:16 ` Ric Wheeler
2013-05-21 19:47 ` Eric Wong
2013-05-21 19:50 ` Zach Brown
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=20130515201614.24668.83788@localhost.localdomain \
--to=chris.mason@fusionio.com \
--cc=bfields@fieldses.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=smfrench@gmail.com \
--cc=zab@redhat.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 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).