Re: [Cluster-devel] [PATCH v7 0/5] iomap and gfs2 fixes

2019-04-29 Thread Darrick J. Wong
On Tue, Apr 30, 2019 at 12:09:29AM +0200, Andreas Gruenbacher wrote: > Here's another update of this patch queue, hopefully with all wrinkles > ironed out now. > > Darrick, I think Linus would be unhappy seeing the first four patches in > the gfs2 tree; could you put them into the xfs tree

[Cluster-devel] [PATCH v7 2/5] fs: Turn __generic_write_end into a void function

2019-04-29 Thread Andreas Gruenbacher
The VFS-internal __generic_write_end helper always returns the value of its @copied argument. This can be confusing, and it isn't very useful anyway, so turn __generic_write_end into a function returning void instead. Signed-off-by: Andreas Gruenbacher --- fs/buffer.c | 6 +++---

[Cluster-devel] [PATCH v7 5/5] gfs2: Fix iomap write page reclaim deadlock

2019-04-29 Thread Andreas Gruenbacher
Since commit 64bc06bb32ee ("gfs2: iomap buffered write support"), gfs2 is doing buffered writes by starting a transaction in iomap_begin, writing a range of pages, and ending that transaction in iomap_end. This approach suffers from two problems: (1) Any allocations necessary for the write are

[Cluster-devel] [PATCH v7 4/5] iomap: Add a page_prepare callback

2019-04-29 Thread Andreas Gruenbacher
Move the page_done callback into a separate iomap_page_ops structure and add a page_prepare calback to be called before the next page is written to. In gfs2, we'll want to start a transaction in page_prepare and end it in page_done. Other filesystems that implement data journaling will require

[Cluster-devel] [PATCH v7 3/5] iomap: Fix use-after-free error in page_done callback

2019-04-29 Thread Andreas Gruenbacher
In iomap_write_end, we're not holding a page reference anymore when calling the page_done callback, but the callback needs that reference to access the page. To fix that, move the put_page call in __generic_write_end into the callers of __generic_write_end. Then, in iomap_write_end, put the page

[Cluster-devel] [PATCH v7 1/5] iomap: Clean up __generic_write_end calling

2019-04-29 Thread Andreas Gruenbacher
From: Christoph Hellwig Move the call to __generic_write_end into iomap_write_end instead of duplicating it in each of the three branches. This requires open coding the generic_write_end for the buffer_head case. Signed-off-by: Christoph Hellwig Signed-off-by: Andreas Gruenbacher

[Cluster-devel] [PATCH v7 0/5] iomap and gfs2 fixes

2019-04-29 Thread Andreas Gruenbacher
Here's another update of this patch queue, hopefully with all wrinkles ironed out now. Darrick, I think Linus would be unhappy seeing the first four patches in the gfs2 tree; could you put them into the xfs tree instead like we did some time ago already? Thanks, Andreas Andreas Gruenbacher (4):

Re: [Cluster-devel] [PATCH v6 1/4] iomap: Clean up __generic_write_end calling

2019-04-29 Thread Jan Kara
On Mon 29-04-19 18:32:36, Andreas Gruenbacher wrote: > From: Christoph Hellwig > > Move the call to __generic_write_end into iomap_write_end instead of > duplicating it in each of the three branches. This requires open coding > the generic_write_end for the buffer_head case. > > Signed-off-by:

Re: [Cluster-devel] [PATCH v6 3/4] iomap: Add a page_prepare callback

2019-04-29 Thread Jan Kara
On Mon 29-04-19 18:32:38, Andreas Gruenbacher wrote: > Move the page_done callback into a separate iomap_page_ops structure and > add a page_prepare calback to be called before the next page is written > to. In gfs2, we'll want to start a transaction in page_prepare and end > it in page_done.

Re: [Cluster-devel] [PATCH v6 3/4] iomap: Add a page_prepare callback

2019-04-29 Thread Christoph Hellwig
> +static int gfs2_iomap_page_prepare(struct inode *inode, loff_t pos, > +unsigned len, struct iomap *iomap) > +{ > + return 0; > +} Now that we check for each callback there is no need to add a dummy one in this patch. But given that that won't change the end

Re: [Cluster-devel] [PATCH v6 2/4] iomap: Fix use-after-free error in page_done callback

2019-04-29 Thread Christoph Hellwig
Or we could merge the dropping of the __generic_write_end return value into this one if you prefer. Either way: Reviewed-by: Christoph Hellwig

Re: [Cluster-devel] [PATCH v6 1/4] iomap: Clean up __generic_write_end calling

2019-04-29 Thread Christoph Hellwig
On Mon, Apr 29, 2019 at 07:46:29PM +0200, Andreas Gruenbacher wrote: > On Mon, 29 Apr 2019 at 18:32, Andreas Gruenbacher wrote: > > From: Christoph Hellwig > > > > Move the call to __generic_write_end into iomap_write_end instead of > > duplicating it in each of the three branches. This

[Cluster-devel] [PATCH v6 3/4] iomap: Add a page_prepare callback

2019-04-29 Thread Andreas Gruenbacher
Move the page_done callback into a separate iomap_page_ops structure and add a page_prepare calback to be called before the next page is written to. In gfs2, we'll want to start a transaction in page_prepare and end it in page_done. Other filesystems that implement data journaling will require

[Cluster-devel] [PATCH v6 2/4] iomap: Fix use-after-free error in page_done callback

2019-04-29 Thread Andreas Gruenbacher
In iomap_write_end, we're not holding a page reference anymore when calling the page_done callback, but the callback needs that reference to access the page. To fix that, move the put_page call in __generic_write_end into the callers of __generic_write_end. Then, in iomap_write_end, put the page

[Cluster-devel] [PATCH v6 4/4] gfs2: Fix iomap write page reclaim deadlock

2019-04-29 Thread Andreas Gruenbacher
Since commit 64bc06bb32ee ("gfs2: iomap buffered write support"), gfs2 is doing buffered writes by starting a transaction in iomap_begin, writing a range of pages, and ending that transaction in iomap_end. This approach suffers from two problems: (1) Any allocations necessary for the write are

[Cluster-devel] [PATCH v6 1/4] iomap: Clean up __generic_write_end calling

2019-04-29 Thread Andreas Gruenbacher
From: Christoph Hellwig Move the call to __generic_write_end into iomap_write_end instead of duplicating it in each of the three branches. This requires open coding the generic_write_end for the buffer_head case. Signed-off-by: Christoph Hellwig Signed-off-by: Andreas Gruenbacher ---

Re: [Cluster-devel] [PATCH v5 1/3] iomap: Fix use-after-free error in page_done callback

2019-04-29 Thread Jan Kara
On Fri 26-04-19 15:11:25, Andreas Gruenbacher wrote: > In iomap_write_end, we are not holding a page reference anymore when > calling the page_done callback, but the callback needs that reference to > access the page. > > To fix that, move the put_page call in __generic_write_end into the >