[PATCH 11/11] block: Fix oops scsi_disk_get()

2017-03-13 Thread Jan Kara
-by: Lekshmi Pillai <lekshmicpil...@in.ibm.com> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block

[PATCH 02/11] block: Fix race of bdev open with gendisk shutdown

2017-03-13 Thread Jan Kara
eusing the device number. Also add a warning that will tell us about unexpected inconsistencies between bdi associated with the bdev inode and bdi associated with the disk. Signed-off-by: Jan Kara <j...@suse.cz> --- fs/block_dev.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) dif

[PATCH 06/11] bdi: Shutdown writeback on all cgwbs in cgwb_bdi_destroy()

2017-03-13 Thread Jan Kara
. To make that safe with concurrent shutdown from cgwb_release_workfn(), we also have to make sure wb_shutdown() returns only after the bdi_writeback structure is really shutdown. Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- include/linux/backing-dev-defs.

[PATCH 0/11 v4] block: Fix block device shutdown related races

2017-03-13 Thread Jan Kara
Hello, this is a series with the remaining patches (on top of 4.11-rc2) to fix several different races and issues I've found when testing device shutdown and reuse. The first two patches fix possible (theoretical) problems when opening of a block device races with shutdown of a gendisk structure.

[PATCH 01/11] block: Fix bdi assignment to bdev inode when racing with disk delete

2017-03-13 Thread Jan Kara
i later when __blkdev_get() is already guaranteed to succeed. Acked-by: Tejun Heo <t...@kernel.org> Reviewed-by: Hannes Reinecke <h...@suse.com> Signed-off-by: Jan Kara <j...@suse.cz> --- fs/block_dev.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/f

[PATCH 08/11] bdi: Rename cgwb_bdi_destroy() to cgwb_bdi_unregister()

2017-03-13 Thread Jan Kara
Rename cgwb_bdi_destroy() to cgwb_bdi_unregister() as it gets called from bdi_unregister() which is not necessarily called from bdi_destroy() and thus the name is somewhat misleading. Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- mm/backing-dev.c |

[PATCH 04/11] bdi: Make wb->bdi a proper reference

2017-03-13 Thread Jan Kara
Make wb->bdi a proper refcounted reference to bdi for all bdi_writeback structures except for the one embedded inside struct backing_dev_info. That will allow us to simplify bdi unregistration. Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- mm/bac

[PATCH 10/11] kobject: Export kobject_get_unless_zero()

2017-03-13 Thread Jan Kara
Make the function available for outside use and fortify it against NULL kobject. CC: Greg Kroah-Hartman <gre...@linuxfoundation.org> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> ---

[PATCH 03/11] bdi: Mark congested->bdi as internal

2017-03-13 Thread Jan Kara
di to itself and the reference gets cleared from bdi_unregister() making it impossible to reference a freed bdi. Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- include/linux/backing-dev-defs.h | 4 +++- mm/backing-dev.c | 10 +- 2 files cha

[PATCH] axonram: Fix gendisk handling

2017-03-08 Thread Jan Kara
ter <dan.carpen...@oracle.com> Signed-off-by: Jan Kara <j...@suse.cz> --- arch/powerpc/sysdev/axonram.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) Warning: The patch is not tested in any way. I just based the fix on Smatch warning and how things should be... diff --git

Re: [PATCH 0/13 v2] block: Fix block device shutdown related races

2017-03-08 Thread Jan Kara
On Tue 07-03-17 08:28:23, Omar Sandoval wrote: > On Tue, Mar 07, 2017 at 02:57:30PM +0100, Jan Kara wrote: > > On Mon 06-03-17 12:38:18, Omar Sandoval wrote: > > > Unfortunately, this patch actually seems to have introduced a > > > regression. Reverting the patch fixes i

Re: [bdi_unregister] 165a5e22fa INFO: task swapper:1 blocked for more than 120 seconds.

2017-03-06 Thread Jan Kara
On Mon 06-03-17 06:35:21, James Bottomley wrote: > On Mon, 2017-03-06 at 13:01 +0100, Jan Kara wrote: > > On Mon 06-03-17 11:27:33, Jan Kara wrote: > > > Hi, > > > > > > On Sun 05-03-17 10:21:11, Wu Fengguang wrote: > > > > FYI next-201703

Re: [bdi_unregister] 165a5e22fa INFO: task swapper:1 blocked for more than 120 seconds.

2017-03-06 Thread Jan Kara
On Mon 06-03-17 07:44:55, James Bottomley wrote: > On Mon, 2017-03-06 at 16:14 +0100, Jan Kara wrote: > > On Mon 06-03-17 06:35:21, James Bottomley wrote: > > > On Mon, 2017-03-06 at 13:01 +0100, Jan Kara wrote: > > > > On Mon 06-03-17 11:27:33

[PATCH 05/11] bdi: Move removal from bdi->wb_list into wb_shutdown()

2017-03-06 Thread Jan Kara
ack shutdown in cgwb_bdi_destroy(). Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- mm/backing-dev.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 37cd1adae979..4dffae6e2d7b

[PATCH 02/11] block: Fix race of bdev open with gendisk shutdown

2017-03-06 Thread Jan Kara
. Also add a warning that will tell us about unexpected inconsistencies between bdi associated with the bdev inode and bdi associated with the disk. Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 7 ++- fs/block_dev.c | 5 - 2 files changed, 10 insertions(+), 2 deletions(-)

[PATCH 07/11] bdi: Do not wait for cgwbs release in bdi_unregister()

2017-03-06 Thread Jan Kara
ack directly. Signed-off-by: Jan Kara <j...@suse.cz> --- include/linux/backing-dev-defs.h | 1 - mm/backing-dev.c | 18 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index 8af

[PATCH 10/11] kobject: Export kobject_get_unless_zero()

2017-03-06 Thread Jan Kara
Make the function available for outside use and fortify it against NULL kobject. CC: Greg Kroah-Hartman <gre...@linuxfoundation.org> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> ---

[PATCH 11/11] block: Fix oops scsi_disk_get()

2017-03-06 Thread Jan Kara
-by: Lekshmi Pillai <lekshmicpil...@in.ibm.com> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block

[PATCH 06/11] bdi: Shutdown writeback on all cgwbs in cgwb_bdi_destroy()

2017-03-06 Thread Jan Kara
. To make that safe with concurrent shutdown from cgwb_release_workfn(), we also have to make sure wb_shutdown() returns only after the bdi_writeback structure is really shutdown. Signed-off-by: Jan Kara <j...@suse.cz> --- include/linux/backing-dev-defs.h | 1 + mm/backing-dev.c

[PATCH 04/11] bdi: Make wb->bdi a proper reference

2017-03-06 Thread Jan Kara
Make wb->bdi a proper refcounted reference to bdi for all bdi_writeback structures except for the one embedded inside struct backing_dev_info. That will allow us to simplify bdi unregistration. Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- mm/bac

[PATCH 0/11 v3] block: Fix block device shutdown related races

2017-03-06 Thread Jan Kara
Hello, this is a series with the remaining patches (on top of 3.11-rc1) to fix several different races and issues I've found when testing device shutdown and reuse. The first two patches fix possible (theoretical) problems when opening of a block device races with shutdown of a gendisk structure.

[PATCH 03/11] bdi: Mark congested->bdi as internal

2017-03-06 Thread Jan Kara
di to itself and the reference gets cleared from bdi_unregister() making it impossible to reference a freed bdi. Acked-by: Tejun Heo <t...@kernel.org> Signed-off-by: Jan Kara <j...@suse.cz> --- include/linux/backing-dev-defs.h | 4 +++- mm/backing-dev.c | 10 +- 2 files cha

[PATCH 01/11] block: Fix bdi assignment to bdev inode when racing with disk delete

2017-03-06 Thread Jan Kara
i later when __blkdev_get() is already guaranteed to succeed. Signed-off-by: Jan Kara <j...@suse.cz> --- fs/block_dev.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 2eca00ec4370..53e2389ae4d4 100644 --- a/fs/block_dev.c ++

Re: [PATCH 0/13 v2] block: Fix block device shutdown related races

2017-03-07 Thread Jan Kara
On Mon 06-03-17 12:38:18, Omar Sandoval wrote: > On Wed, Mar 01, 2017 at 04:11:09PM +0100, Jan Kara wrote: > > On Tue 28-02-17 23:26:53, Omar Sandoval wrote: > > > On Tue, Feb 28, 2017 at 11:25:28PM -0800, Omar Sandoval wrote: > > > > On Wed, Feb 22, 2017 at 11

Re: [bdi_unregister] 165a5e22fa INFO: task swapper:1 blocked for more than 120 seconds.

2017-03-07 Thread Jan Kara
On Mon 06-03-17 09:25:42, James Bottomley wrote: > On Mon, 2017-03-06 at 17:13 +0100, Jan Kara wrote: > > On Mon 06-03-17 07:44:55, James Bottomley wrote: ... > > > > Sure. The call trace is: > > > > > > > > [ 41.919244] [ cut here ]---

[PATCH] block: Initialize bd_bdi on inode initialization

2017-03-02 Thread Jan Kara
gt; Fixes: b1d2dc5659b41741f5a29b2ade76ffb4e5bb13d8 Signed-off-by: Jan Kara <j...@suse.cz> --- fs/block_dev.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 77c30f15a02c..2eca00ec4370 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @

Re: [PATCH] block: Make writeback throttling defaults consistent for SQ devices

2017-04-19 Thread Jan Kara
On Wed 19-04-17 11:33:27, Jan Kara wrote: > When CFQ is used as an elevator, it disables writeback throttling > because they don't play well together. Later when a different elevator > is chosen for the device, writeback throttling doesn't get enabled > again as it should. Make sure

[PATCH] block: Make writeback throttling defaults consistent for SQ devices

2017-04-19 Thread Jan Kara
by default) when we switch from it to another IO scheduler. Signed-off-by: Jan Kara <j...@suse.cz> --- block/blk-sysfs.c | 19 +-- block/blk-wbt.c | 19 +++ block/blk-wbt.h | 4 block/elevator.c | 3 +++ 4 files changed, 27 insertions(+), 18 deletions(-)

Re: [PATCH v3 04/20] fs: check for writeback errors after syncing out buffers in generic_file_fsync

2017-04-24 Thread Jan Kara
out the buffers. That > will be sufficient for this case, and help other callers detect > these errors properly as well. > > With that, we don't need to twiddle it in ext2. > > Suggested-by: Jan Kara <j...@suse.cz> > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good to me. Y

Re: [PATCH v3 08/20] mm: ensure that we set mapping error if writeout() fails

2017-04-24 Thread Jan Kara
On Mon 24-04-17 09:22:47, Jeff Layton wrote: > If writepage fails during a page migration, then we need to ensure that > fsync will see it by flagging the mapping. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good to me. You can add: Reviewed-by: Jan

Re: [PATCH v3 09/20] 9p: set mapping error when writeback fails in launder_page

2017-04-24 Thread Jan Kara
On Mon 24-04-17 09:22:48, Jeff Layton wrote: > launder_page is just writeback under the page lock. We still need to > mark the mapping for errors there when they occur. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good. You can add: Reviewed-by: Jan

Re: [PATCH v3 06/20] dax: set errors in mapping when writeback fails

2017-04-24 Thread Jan Kara
reporting through the mapping. After improving the changelog you can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > fs/dax.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > d

Re: [PATCH v3 10/20] fuse: set mapping error in writepage_locked when it fails

2017-04-24 Thread Jan Kara
+ b/fs/fuse/file.c > @@ -1669,6 +1669,7 @@ static int fuse_writepage_locked(struct page *page) > err_free: > fuse_request_free(req); > err: > + mapping_set_error(page->mapping, error); > end_page_writeback(page); > return error; > } > -- > 2.9.3 > > -- Jan Kara <j...@suse.com> SUSE Labs, CR

[PATCH] block: Add comment to submit_bio_wait()

2017-08-02 Thread Jan Kara
submit_bio_wait() does not consume bio reference. Add comment about that. Signed-off-by: Jan Kara <j...@suse.cz> --- block/bio.c | 4 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index 9a63597aaacc..e241bbc49f14 100644 --- a/block/bio.c +++ b/block/bio.c @@

Re: [PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-08-10 Thread Jan Kara
sed for amount of writes/reads > performed. However, only one is used. This will not work with > pread()/pwrite() calls though because of the limitation of return values. > > Finally, what if the EWOULDBLOCK is returned for an earlier bio (say > offset 128k) for a 1MB pwrite(), while the rest of the 7 128K are > successful. What short return value should the system call return? This is indeed tricky. If an application submits 1MB write, I don't think we can afford to just write arbitrary subset of it. That just IMHO too much violates how writes traditionally behaved. Even short writes trigger bugs in various applications but I'm willing to require that applications using NOWAIT IO can handle these. However writing arbitrary subset looks like a nasty catch. IMHO we should not submit further bios until we are sure current one does not return EWOULDBLOCK when splitting a larger one... Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 17/17] block/cfq: cache rightmost rb_node

2017-07-19 Thread Jan Kara
qg, cfqq_class(cfqq), cfqq_type(cfqq)); > if (cfq_class_idle(cfqq)) { > rb_key = CFQ_IDLE_DELAY; > - parent = rb_last(>rb.rb_root); > + parent = st->rb_rightmost; > if (parent && parent != >rb_node) { > __cfqq = rb_entry(parent, struct cfq_queue, rb_node); > rb_key += __cfqq->rb_key; > -- > 2.12.0 > -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 10/17] block/cfq: replace cfq_rb_root leftmost caching

2017-07-19 Thread Jan Kara
dlohr Bueso <dbu...@suse.de> Looks good to me. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > block/cfq-iosched.c | 70 > +++-- > 1 file changed

[PATCH 01/19] bcache: Fix leak of bdev reference

2017-06-30 Thread Jan Kara
If blkdev_get_by_path() in register_bcache() fails, we try to lookup the block device using lookup_bdev() to detect which situation we are in to properly report error. However we never drop the reference returned to us from lookup_bdev(). Fix that. Signed-off-by: Jan Kara <j...@suse.cz> C

[PATCH 01/19] bcache: Fix leak of bdev reference

2017-06-30 Thread Jan Kara
If blkdev_get_by_path() in register_bcache() fails, we try to lookup the block device using lookup_bdev() to detect which situation we are in to properly report error. However we never drop the reference returned to us from lookup_bdev(). Fix that. Signed-off-by: Jan Kara <j...@suse.cz> C

Re: [PATCH v3 10/20] fuse: set mapping error in writepage_locked when it fails

2017-04-25 Thread Jan Kara
On Mon 24-04-17 13:14:36, Jeff Layton wrote: > On Mon, 2017-04-24 at 18:04 +0200, Jan Kara wrote: > > On Mon 24-04-17 09:22:49, Jeff Layton wrote: > > > This ensures that we see errors on fsync when writeback fails. > > > > > > Signed-off-by: Jeff Layton <j

Re: [PATCH v3 10/20] fuse: set mapping error in writepage_locked when it fails

2017-04-25 Thread Jan Kara
On Tue 25-04-17 06:35:13, Jeff Layton wrote: > On Tue, 2017-04-25 at 10:17 +0200, Jan Kara wrote: > > On Mon 24-04-17 13:14:36, Jeff Layton wrote: > > > On Mon, 2017-04-24 at 18:04 +0200, Jan Kara wrote: > > > > On Mon 24-04-17 09:22:49, Jeff Layton wrote: > > &

Re: [PATCH v4 15/27] fs: retrofit old error reporting API onto new infrastructure

2017-05-15 Thread Jan Kara
d this is not a problem specific to f2fs. For example ext2 also uses this scheme where block devices' mapping is the metadata mapping). And we need to merge error information from these two mappings so for the stamping scheme to work, we'd need two stamps stored in struct file. One for data mapping and one for metadata mapping. Or maybe there's some more clever scheme but for now I don't see one... Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH v4 21/27] mm: clean up error handling in write_one_page

2017-05-15 Thread Jan Kara
ack error since then. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good to me. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > mm/page-writeback.c | 11 +-- > 1

Re: [PATCH v4 19/27] buffer: set errors in mapping at the time that the error occurs

2017-05-15 Thread Jan Kara
check this flag in order to set the error in the > mapping. > > This sets the error in the mapping earlier, at the time that it's first > detected. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good to me. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Sma

Re: [PATCH 04/10] fs: Introduce RWF_NOWAIT

2017-05-15 Thread Jan Kara
pr_debug("EFAULT: aio_key\n"); I think you need to also check here that the IO is write. So that NOWAIT reads don't silently pass. Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH v4 11/27] fuse: set mapping error in writepage_locked when it fails

2017-05-10 Thread Jan Kara
On Tue 09-05-17 11:49:14, Jeff Layton wrote: > This ensures that we see errors on fsync when writeback fails. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> > Reviewed-by: Christoph Hellwig <h...@lst.de> Looks good to me. You can add: Reviewed-by

Re: [PATCH v4 13/27] lib: add errseq_t type and infrastructure for handling it

2017-05-10 Thread Jan Kara
Jeff Layton <jlay...@redhat.com> The patch looks good to me. Feel free to add: Reviewed-by: Jan Kara <j...@suse.cz> Just two nits below: ... > +int errseq_check_and_advance(errseq_t *eseq, errseq_t *since) > +{ > + int err = 0; > + errseq_t old, new;

Re: [PATCH v4 14/27] fs: new infrastructure for writeback error handling and reporting

2017-05-10 Thread Jan Kara
> > The new behavior is still consistent with the POSIX spec, and is more > reliable for application developers. This patch just adds some basic > infrastructure for doing this. Later patches will change the existing > code to use this new infrastructure. > > Signed-off

Re: [PATCH v4 01/27] fs: remove unneeded forward definition of mm_struct from fs.h

2017-05-10 Thread Jan Kara
On Tue 09-05-17 11:49:04, Jeff Layton wrote: > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > include/linux/fs.h | 2 -- > 1 f

Re: [PATCH v4 12/27] cifs: set mapping error when page writeback fails in writepage or launder_pages

2017-05-10 Thread Jan Kara
On Tue 09-05-17 11:49:15, Jeff Layton wrote: > Signed-off-by: Jeff Layton <jlay...@redhat.com> > Reviewed-by: Christoph Hellwig <h...@lst.de> Looks good to me. You can add: Reviewed-by: Jan Kara <j...@suse.cz>

Re: [PATCH 16/25] fuse: Convert to separately allocated bdi

2017-05-16 Thread Jan Kara
On Mon 15-05-17 23:34:00, Rakesh Pandit wrote: > Hi Jan, Miklos, > > On Wed, Apr 12, 2017 at 12:24:40PM +0200, Jan Kara wrote: > > Allocate struct backing_dev_info separately instead of embedding it > > inside the superblock. This unifies handling of bdi among users. >

Re: [PATCH 6/8] nowait aio: ext4

2017-05-09 Thread Jan Kara
t allocated at the write location > > Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> The patch looks good. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > fs/ext4/file.c | 20 +++

Re: [PATCH v7 05/22] jbd2: don't clear and reset errors after waiting on writeback

2017-06-20 Thread Jan Kara
attempt to > re-set the error flag if it fails. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good to me. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > fs/jbd2/commit.c

Re: [PATCH v7 01/22] fs: remove call_fsync helper function

2017-06-20 Thread Jan Kara
On Fri 16-06-17 15:34:06, Jeff Layton wrote: > Requested-by: Christoph Hellwig <h...@infradead.org> > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good. You can add: Reviewed-by: Jan Kara <j...@suse.cz>

Re: [PATCH 02/10] fs: Introduce filemap_range_has_page()

2017-05-25 Thread Jan Kara
writeback of previous > writes. > > Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> > Reviewed-by: Christoph Hellwig <h...@lst.de> Looks good. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza

Re: [PATCH 04/10] fs: Introduce RWF_NOWAIT

2017-05-25 Thread Jan Kara
ristoph Hellwig <h...@lst.de> Looks good now. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > fs/9p/vfs_file.c| 3 +++ > fs/aio.c| 13 + > fs/ceph/file.c

Re: [PATCH 03/10] fs: Use RWF_* flags for AIO operations

2017-05-25 Thread Jan Kara
-by: Christoph Hellwig <h...@lst.de> Looks good. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > fs/aio.c | 8 +++- > include/uapi/linux/aio_abi.h | 2 +- > 2 files change

Re: [PATCH 06/10] fs: Introduce IOMAP_NOWAIT

2017-05-25 Thread Jan Kara
y: Christoph Hellwig <h...@lst.de> Looks good. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > fs/iomap.c| 2 ++ > include/linux/iomap.h | 1 + > 2 files changed, 3 insert

Re: [PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags

2017-05-25 Thread Jan Kara
On Wed 24-05-17 11:41:41, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues <rgold...@suse.com> > > Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> > Reviewed-by: Christoph Hellwig <h...@lst.de> Looks good. You can add: Revie

Re: [PATCH 05/10] fs: return if direct write will trigger writeback

2017-05-25 Thread Jan Kara
y such as page locks, dirty throttling logic, page loading > from disk etc. which cannot be taken care of. > > Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> > Reviewed-by: Christoph Hellwig <h...@lst.de> Looks good

Re: [PATCH 09/10] xfs: nowait aio support

2017-05-29 Thread Jan Kara
ly user? I > understand the block layer can block if it has too many requests though. Well, submitting such write will have to wait for read of metadata from disk. That is certainly considered blocking so Christoph is right that we must return EAGAIN in such case. Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 09/10] xfs: nowait aio support

2017-05-31 Thread Jan Kara
eturned if io submission would block. Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 0/10 v12] No wait AIO

2017-06-16 Thread Jan Kara
e also have a customer that is working on testing the series with their workload however that will take some time given it requires updating their software stack. If you are looking for some synthetic benchmark results, I suppose we can put something together however it's going to be just a synthetic benchmark and as such the relevance is limited. Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

[PATCH] nfs: Fix bdi handling for cloned superblocks

2017-05-04 Thread Jan Kara
ount+0x158/0xc7c) [] (do_mount) from [] (SyS_mount+0x8c/0xb4) [] (SyS_mount) from [] (ret_fast_syscall+0x0/0x3c) Fix the problem by always creating new bdi for a superblock as we used to do. Reported-and-tested-by: Corentin Labbe <clabbe.montj...@gmail.com> Fixes: 0d3b12584972ce5781179ad3f15cca3cdb5ca

Treat REQ_FUA and REQ_PREFLUSH as synchronous

2017-05-02 Thread Jan Kara
nc() since callers cannot rely on this anyway... Thoughts? Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: BUG: KASAN: use-after-free in scsi_exit_rq

2017-05-02 Thread Jan Kara
are of any particular breakage this would cause. However logically the freeing of request mempools really belongs to blk_release_queue() so it seems a bit dumb to move blk_exit_rl() just because SCSI stores the fact from which slab cache it has allocated the sense buffer in a structure (shost) that it frees under its hands by the time blk_release_queue() is called. :-| Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: Treat REQ_FUA and REQ_PREFLUSH as synchronous

2017-05-02 Thread Jan Kara
On Tue 02-05-17 08:18:15, Christoph Hellwig wrote: > On Tue, May 02, 2017 at 05:15:58PM +0200, Jan Kara wrote: > > in generic_make_request_checks()? Or just set it unconditionally in that > > function if we see REQ_FUA | REQ_PREFLUSH set? > > Just add REQ_FUA and REQ

Re: Treat REQ_FUA and REQ_PREFLUSH as synchronous

2017-05-02 Thread Jan Kara
On Tue 02-05-17 08:49:14, Jens Axboe wrote: > On 05/02/2017 08:45 AM, Christoph Hellwig wrote: > > On Tue, May 02, 2017 at 12:21:23PM +0200, Jan Kara wrote: > >> it makes sense to treat REQ_FUA and REQ_PREFLUSH ops as synchronous in > >> op_is_sync() since callers

Re: [PATCH 3/4] fs: support RWF_NOWAIT for buffered reads

2017-08-24 Thread Jan Kara
ig <h...@lst.de> Looks good. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > fs/aio.c | 6 -- > fs/btrfs/file.c| 6 +- > fs/ext4/file.c | 6 +++--- > fs/xfs/xfs

Re: [PATCH 4/4] block_dev: support RFW_NOWAIT on block device nodes

2017-08-24 Thread Jan Kara
On Tue 22-08-17 18:17:12, Christoph Hellwig wrote: > All support is already there in the generic code, we just need to wire > it up. > > Signed-off-by: Christoph Hellwig <h...@lst.de> Looks good. You can add: Reviewed-by: Jan

Re: [PATCH 1/4] fs: pass iocb to do_generic_file_read

2017-08-24 Thread Jan Kara
On Tue 22-08-17 18:17:09, Christoph Hellwig wrote: > And rename it to the more descriptive generic_file_buffered_read while > at it. > > Signed-off-by: Christoph Hellwig <h...@lst.de> Looks good. You can add: Reviewed-by: Jan

Re: [PATCH 2/4] fs: support IOCB_NOWAIT in generic_file_buffered_read

2017-08-24 Thread Jan Kara
goto page_ok; And wait_on_page_locked_killable() above does not seem to be handled in your patch. I would just check IOCB_NOWAIT in !PageUptodate(page) branch above and bail - which also removes the need for the two checks below... Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH v2] block/laptop_mode: Convert timers to use timer_setup()

2017-10-09 Thread Jan Kara
laptop_mode); > -} > - > -/* > - * We're in laptop mode and we've just synced. The sync's writes will have > - * caused another writeback to be scheduled by laptop_io_completion. > - * Nothing needs to be written back anymore, so we unschedule the writeback. > - */ > -void laptop_sync_completion(void) > -{ > - struct backing_dev_info *bdi; > - > - rcu_read_lock(); > - > - list_for_each_entry_rcu(bdi, _list, bdi_list) > - del_timer(>laptop_mode_wb_timer); > - > - rcu_read_unlock(); > -} > -#endif > - > /* > * If ratelimit_pages is too high then we can get into dirty-data overload > * if a large number of processes all perform writes at the same time. > -- > 2.14.1 > -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 1/3] lockdep: Apply crossrelease to PG_locked locks

2017-11-24 Thread Jan Kara
; >make clean > >echo 3 > drop_caches > >time make -j4 > > Maybe FS people will help you find a more representative workload. E.g. > linear cache cold file read should be good as well. Maybe there are some > tests in fstests (or how they call xfstests these days).

Re: [PATCH 03/11] fs: add frozen sb state helpers

2017-11-30 Thread Jan Kara
e cleanup if freezing of all superblocks fails in the middle. So I'm not 100% this works out nicely in the end. But it's certainly worth a consideration. Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 07/11] xfs: remove not needed freezing calls

2017-11-30 Thread Jan Kara
spin_unlock(>xa_lock); > > if (tout) > - freezable_schedule_timeout(msecs_to_jiffies(tout)); > + schedule_timeout(msecs_to_jiffies(tout)); > > __set_current_state(TASK_RUNNING); > > - try_to_freeze(); > - > tout = xfsaild_push(ailp); > } > > -- > 2.15.0 > -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 05/11] fs: add iterate_supers_excl() and iterate_supers_reverse_excl()

2017-11-30 Thread Jan Kara
his but also also captures any errors encountered. > > Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> The patch looks good to me. You can add: Reviewed-by: Jan Kara <j...@suse.cz>

Re: [PATCH 02/11] fs: provide unlocked helper thaw_super()

2017-11-30 Thread Jan Kara
active count management. > > This change has no functional changes. > > Suggested-by: Dave Chinner <da...@fromorbit.com> > Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> Looks good to me. You can ad

Re: [PATCH 01/11] fs: provide unlocked helper for freeze_super()

2017-11-30 Thread Jan Kara
g and active count management. > > This change has no functional changes. > > Suggested-by: Dave Chinner <da...@fromorbit.com> > Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> Looks good to me. You can ad

Re: [PATCH 02/11] block: Fix race of bdev open with gendisk shutdown

2017-11-20 Thread Jan Kara
Hi Tao! On Fri 17-11-17 14:51:18, Hou Tao wrote: > On 2017/3/13 23:14, Jan Kara wrote: > > blkdev_open() may race with gendisk shutdown in two different ways. > > Either del_gendisk() has already unhashed block device inode (and thus > > bd_acquire() will end up creating n

Re: [PATCH v2 2/3] bdi: add error handle for bdi_debug_register

2017-11-01 Thread Jan Kara
gt; Looks good to me. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > mm/backing-dev.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/mm/backing-dev.c b/mm/backin

Re: [PATCH 03/11] fs: add frozen sb state helpers

2017-12-01 Thread Jan Kara
On Thu 30-11-17 20:05:48, Luis R. Rodriguez wrote: > On Thu, Nov 30, 2017 at 06:13:10PM +0100, Jan Kara wrote: > > ... I dislike the _by_user() suffix as there may be different places that > > call freeze_super() (e.g. device mapper does this during some operations). >

Re: [PATCH 1/4] bdi: add check for bdi_debug_root

2017-10-30 Thread Jan Kara
s; > - bdi_debug_init(); > + ret = bdi_debug_init(); > + if (ret) { > + class_destroy(bdi_class); > + bdi_class = NULL; > + return ret; > + } > > return 0; > } > -- > 2.14.2 > -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 2/4] bdi: convert bdi_debug_register to int

2017-10-30 Thread Jan Kara
On Fri 27-10-17 01:35:57, weiping zhang wrote: > Convert bdi_debug_register to int and then do error handle for it. > > Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> This patch looks good to me. You can add: Reviewed-by: Jan Kar

Re: [PATCH 3/4] bdi: add error handle for bdi_debug_register

2017-10-30 Thread Jan Kara
*bdi, const char > *fmt, ...) > va_start(args, fmt); > ret = bdi_register_va(bdi, fmt, args); > va_end(args); > + if (ret) > + bdi_put(bdi); Why do you drop bdi reference here in case of error? We didn't do it previously if bdi_register_va() failed fo

Re: [PATCH 4/4] block: add WARN_ON if bdi register fail

2017-10-30 Thread Jan Kara
referencing it from bdev */ > bdi = disk->queue->backing_dev_info; > - bdi_register_owner(bdi, disk_to_dev(disk)); > + retval = bdi_register_owner(bdi, disk_to_dev(disk)); > + if (retval) > + WARN_ON(1); Just a nit: You can do WA

Re: [PATCH 03/11] fs: add frozen sb state helpers

2017-12-21 Thread Jan Kara
Hello, I think I owe you a reply here... Sorry that it took so long. On Fri 01-12-17 22:13:27, Luis R. Rodriguez wrote: > On Fri, Dec 01, 2017 at 12:47:24PM +0100, Jan Kara wrote: > > On Thu 30-11-17 20:05:48, Luis R. Rodriguez wrote: > > > > In fact, what might

Re: [PATCH] bdi: Fix oops in wb_workfn()

2018-05-09 Thread Jan Kara
On Fri 04-05-18 07:55:58, Dave Chinner wrote: > On Thu, May 03, 2018 at 06:26:26PM +0200, Jan Kara wrote: > > Syzbot has reported that it can hit a NULL pointer dereference in > > wb_workfn() due to wb->bdi->dev being NULL. This indicates that > > wb_workfn() was called

Re: [PATCH] bdi: Fix oops in wb_workfn()

2018-05-09 Thread Jan Kara
On Thu 03-05-18 18:26:26, Jan Kara wrote: > Syzbot has reported that it can hit a NULL pointer dereference in > wb_workfn() due to wb->bdi->dev being NULL. This indicates that > wb_workfn() was called for an already unregistered bdi which should not > happen as wb_shut

Re: [PATCH] bdi: Fix oops in wb_workfn()

2018-05-09 Thread Jan Kara
On Fri 04-05-18 07:35:34, Tetsuo Handa wrote: > Jan Kara wrote: > > Make wb_workfn() use wakeup_wb() for requeueing the work which takes all > > the necessary precautions against racing with bdi unregistration. > > Yes, this patch will solve NULL pointer dereference bug. Bu

Re: write call hangs in kernel space after virtio hot-remove

2018-05-09 Thread Jan Kara
On Thu 03-05-18 10:48:20, Matthew Wilcox wrote: > On Thu, May 03, 2018 at 12:05:14PM -0400, Jeff Layton wrote: > > On Thu, 2018-05-03 at 16:42 +0200, Jan Kara wrote: > > > On Wed 25-04-18 17:07:48, Fabiano Rosas wrote: > > > > I'm looking into an issue where removing

Re: [PATCH] loop: remember whether sysfs_create_group() succeeded

2018-05-09 Thread Jan Kara
;gre...@linuxfoundation.org> > Cc: Jens Axboe <ax...@kernel.dk> Looks good to me. You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > drivers/block/loop.c | 11 ++- > drivers/block/loop

Re: [PATCH] bdi: Fix oops in wb_workfn()

2018-05-21 Thread Jan Kara
On Sat 19-05-18 23:27:09, Tetsuo Handa wrote: > Tetsuo Handa wrote: > > Jan Kara wrote: > > > Make wb_workfn() use wakeup_wb() for requeueing the work which takes all > > > the necessary precautions against racing with bdi unregistration. > > > >

[PATCH] bdi: Fix another oops in wb_workfn()

2018-06-18 Thread Jan Kara
ase_workfn() using a new mutex. That way we also no longer need synchronization using WB_shutting_down as the mutex provides it for CONFIG_CGROUP_WRITEBACK case and without CONFIG_CGROUP_WRITEBACK wb_shutdown() can be called only once from bdi_unregister(). Reported-by: syzbot Signed-off-by: Jan

Re: [PATCH] bdi: Fix another oops in wb_workfn()

2018-06-11 Thread Jan Kara
is the most robust way. What do you think about attached patch Tejun? So far only compile tested... Possible problem with it is that now cgwb_bdi_unregister() will wait for all wb references to be dropped so it adds some implicit dependencies to bdi shutdown path.

Re: [PATCH] bdi: Fix another oops in wb_workfn()

2018-06-11 Thread Jan Kara
On Mon 11-06-18 09:01:31, Tejun Heo wrote: > Hello, > > On Mon, Jun 11, 2018 at 11:12:48AM +0200, Jan Kara wrote: > > However this is wrong and so is the patch. The problem is in > > cgwb_bdi_unregister() which does cgwb_kill() and thus drops bdi's > > reference to

Re: general protection fault in wb_workfn (2)

2018-05-28 Thread Jan Kara
On Sun 27-05-18 09:47:54, Tetsuo Handa wrote: > Forwarding > http://lkml.kernel.org/r/201805251915.fgh64517.hvfjoolffmq...@i-love.sakura.ne.jp > . > > Jan Kara wrote: > > > void delayed_work_timer_fn(struct timer_list *t) > > > { > > > struct delaye

Re: [PATCH 1/3] fs: move documentation for thaw_super() where appropriate

2018-05-03 Thread Jan Kara
lt;mcg...@kernel.org> Looks good (modulo the -- which is probably worth fixing when touching the comment anyway). You can add: Reviewed-by: Jan Kara <j...@suse.cz> Honza > --- > fs/super.c | 12 ++-- >

Re: [PATCH 2/4] iomap: iomap_dio_rw() handles all sync writes

2018-05-03 Thread Jan Kara
-Original Message- > From: Dave Chinner <da...@fromorbit.com> > Sent: Tuesday, May 1, 2018 9:46 PM > To: Jan Kara <j...@suse.cz> > Cc: linux-...@vger.kernel.org; linux-fsde...@vger.kernel.org; > linux-block@vger.kernel.org; h...@lst.de; Robert Dorr <rd...@microsof

Re: write call hangs in kernel space after virtio hot-remove

2018-05-03 Thread Jan Kara
hat I think we should do is that we'll prevent dirtying of new pages when we know the underlying device is gone. Because that will fix your problem and also make sure user sees the IO errors directly instead of just in the kernel log. The question is how to make this happen in the least painful way. I think we could intercept writes in grab_cache_page_write_begin() (which however requires that function to return a proper error code and not just NULL / non-NULL). And we should also intercept write faults to not allow page dirtying via mmap - probably somewhere in do_shared_fault() and do_wp_page(). I've added Jeff to CC since he's dealing with IO error handling a lot these days. Jeff, what do you think? Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

<    1   2   3   4   5   >