Re: [PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-04-21 Thread Jan Kara
think this is quite correct. IOCB_DSYNC gets set also for O_SYNC writes (in that case we also set IOCB_SYNC). And for those we cannot use the FUA optimization AFAICT (definitely IOMAP_F_DIRTY isn't a safe indicator of a need of full fsync for O_SYNC). Other than that the patch looks good to me.

Re: [RFC PATCH 00/79] Generic page write protection and a solution to page waitqueue

2018-04-19 Thread Jan Kara
ng as lookup > index. Usualy those flag are seldomly changed/accessed. Again the > overhead (ignoring code size) would only be for page which are KSM. > So maybe KSM will not make sense because perf overhead it has with > page->flags access (i don't think so but i haven't tested this). Yeah, sure, page->flags could be dealt with in a similar way but at this point I don't think it's worth it. And without page->flags I don't think abstracting page->private makes much sense - or am I missing something why you need page->private depend on the mapping? So what I wanted to suggest is that we leave page->private as is currently and just concentrate on page->mapping hacks... Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [RFC PATCH 00/79] Generic page write protection and a solution to page waitqueue

2018-04-18 Thread Jan Kara
ned long offset; > unsigned long private; > ... > }; Auch, the fact that we could share a page as data storage for several inode+offset combinations that are not sharing underlying storage just looks viciously twisted ;) But is it really that useful to warrant complications? In particular I'm afraid that filesystems expect consistency between their internal state (attached to page->private) and page state (e.g. page->flags) and when there are multiple internal states attached to the same page this could go easily wrong... Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

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

2018-04-18 Thread Jan Kara
On Tue 17-04-18 17:59:36, Luis R. Rodriguez wrote: > On Thu, Dec 21, 2017 at 12:03:29PM +0100, Jan Kara wrote: > > On Fri 01-12-17 22:13:27, Luis R. Rodriguez wrote: > > > > > > I'll note that its still not perfectly clear if really the semantics > > > beh

Re: sr: get/drop reference to device in revalidate and check_events

2018-04-11 Thread Jan Kara
seccomp_filter+0x28/0x230 > ? _raw_spin_unlock+0xa/0x20 > ? __handle_mm_fault+0x7d6/0x9b0 > ? list_lru_add+0xa8/0xc0 > ? _raw_spin_unlock+0xa/0x20 > ? __alloc_fd+0xaf/0x160 > ? do_sys_open+0x1a6/0x230 > do_sys_open+0x1a6/0x230 > do_syscall_6

Re: Hotplug

2018-04-11 Thread Jan Kara
Hello, On Wed 11-04-18 08:11:13, Jens Axboe wrote: > On 4/11/18 7:58 AM, Jan Kara wrote: > > On Tue 10-04-18 11:17:46, Jens Axboe wrote: > >> Been running some tests and I keep running into issues with hotplug. > >> This looks similar to what Bart posted the other

Re: Hotplug

2018-04-11 Thread Jan Kara
0 RCX: > 7fe63d6741f0 > [ 4677.112584] RDX: 0400 RSI: 55b1645c33e8 RDI: > 000f > [ 4677.121037] RBP: 55b1645c32b0 R08: 7fe63d65f008 R09: > 0430 > [ 4677.129489] R10: 55b1645c33d8 R11: 0246 R12: > 00000

Re: [PATCH 0/6 v2] block: Fix races in bdev - gendisk handling

2018-02-26 Thread Jan Kara
On Mon 26-02-18 09:04:40, Jens Axboe wrote: > On 2/26/18 5:01 AM, Jan Kara wrote: > > Hello, > > > > these patches fix races happening when devices are frequently destroyed and > > recreated in association of block device inode with corresponding gendisk. > >

Re: v4.16-rc2: virtio-block + ext4 lockdep splats / sleeping from invalid context

2018-02-26 Thread Jan Kara
On Mon 26-02-18 11:38:19, Mark Rutland wrote: > On Mon, Feb 26, 2018 at 11:52:56AM +0100, Jan Kara wrote: > > On Fri 23-02-18 15:47:36, Mark Rutland wrote: > > > Hi all, > > > > > > While fuzzing arm64/v4.16-rc2 with syzkaller, I simultaneously hit a >

[PATCH 4/6] genhd: Fix use after free in __blkdev_get()

2018-02-26 Thread Jan Kara
ted-by: Hou Tao <hout...@huawei.com> Signed-off-by: Jan Kara <j...@suse.cz> --- fs/block_dev.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 1dbbf847911a..fe41a76769fa 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1

[PATCH 2/6] genhd: Rename get_disk() to get_disk_and_module()

2018-02-26 Thread Jan Kara
Rename get_disk() to get_disk_and_module() to make sure what the function does. It's not a great name but at least it is now clear that put_disk() is not it's counterpart. Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 10 -- drivers/block/amiflop.c | 2 +- d

[PATCH 1/6] genhd: Fix leaked module reference for NVME devices

2018-02-26 Thread Jan Kara
s put_disk() is *not* the counterpart of get_disk() but let's fix that in the follow up commit since that will be more intrusive. Fixes: 8ddcd653257c18a669fcb75ee42c37054908e0d6 CC: Christoph Hellwig <h...@lst.de> Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 3 +++ 1 file changed, 3 insertions(

[PATCH 6/6] blockdev: Avoid two active bdev inodes for one device

2018-02-26 Thread Jan Kara
reference. That way we make sure gendisk can get associated only with visible bdev inodes. Tested-by: Hou Tao <hout...@huawei.com> Signed-off-by: Jan Kara <j...@suse.cz> --- fs/block_dev.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/fs/bloc

[PATCH 0/6 v2] block: Fix races in bdev - gendisk handling

2018-02-26 Thread Jan Kara
Hello, these patches fix races happening when devices are frequently destroyed and recreated in association of block device inode with corresponding gendisk. Generally when such race happen it results in use-after-free issues, block device page cache inconsistencies, or other problems. I have

[PATCH 5/6] genhd: Fix BUG in blkdev_open()

2018-02-26 Thread Jan Kara
ath as if it is completely run after new device is created). Reported-and-analyzed-by: Hou Tao <hout...@huawei.com> Tested-by: Hou Tao <hout...@huawei.com> Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 21 - include/linux/genhd.h | 1 + 2 files changed

[PATCH 3/6] genhd: Add helper put_disk_and_module()

2018-02-26 Thread Jan Kara
Add a proper counterpart to get_disk_and_module() - put_disk_and_module(). Currently it is opencoded in several places. Signed-off-by: Jan Kara <j...@suse.cz> --- block/blk-cgroup.c| 11 ++- block/genhd.c | 20 fs/block_dev.c

Re: v4.16-rc2: virtio-block + ext4 lockdep splats / sleeping from invalid context

2018-02-26 Thread Jan Kara
On Fri 23-02-18 15:47:36, Mark Rutland wrote: > Hi all, > > While fuzzing arm64/v4.16-rc2 with syzkaller, I simultaneously hit a > number of splats in the block layer: > > * inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-R} usage in > jbd2_trans_will_send_data_barrier > > * BUG: sleeping function

Re: [PATCH 5/6] genhd: Fix BUG in blkdev_open()

2018-02-14 Thread Jan Kara
On Tue 13-02-18 10:11:37, Hou Tao wrote: > Hi Jan, > > On 2018/2/7 0:05, Jan Kara wrote: > > When two blkdev_open() calls for a partition race with device removal > > and recreation, we can hit BUG_ON(!bd_may_claim(bdev, whole, holder)) in > > blkdev_open(). The

Re: [PATCH v2 2/2] block: Fix a race between the throttling code and request queue initialization

2018-02-07 Thread Jan Kara
for driver lock; > > (3) override driver lock with internal lock; > > (4) unlock driver lock; > > (5) can take driver lock now; > > (6) but unlock internal lock. > > > > If we get blkg->q->queue_lock to local first like blk_cleanup_queue, > >

Re: [LSF/MM TOPIC] get_user_pages() and filesystems

2018-02-06 Thread Jan Kara
Hello, On Fri 02-02-18 15:04:11, Liu Bo wrote: > On Thu, Jan 25, 2018 at 12:57:27PM +0100, Jan Kara wrote: > > Hello, > > > > this is about a problem I have identified last month and for which I still > > don't have good solution. Some discussion of the problem happe

[PATCH 1/6] genhd: Fix leaked module reference for NVME devices

2018-02-06 Thread Jan Kara
s put_disk() is *not* the counterpart of get_disk() but let's fix that in the follow up commit since that will be more intrusive. Fixes: 8ddcd653257c18a669fcb75ee42c37054908e0d6 CC: Christoph Hellwig <h...@lst.de> Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 3 +++ 1 file changed, 3 insertions(

[PATCH 5/6] genhd: Fix BUG in blkdev_open()

2018-02-06 Thread Jan Kara
ath as if it is completely run after new device is created). Reported-and-analyzed-by: Hou Tao <hout...@huawei.com> Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 21 - include/linux/genhd.h | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/

[PATCH 0/6] block: Fix races in bdev - gendisk handling

2018-02-06 Thread Jan Kara
Hello, these patches fix races happening when devices are frequently destroyed and recreated in association of block device inode with corresponding gendisk. Generally when such race happen it results in use-after-free issues, block device page cache inconsistencies, or other problems. I have

[PATCH 2/6] genhd: Rename get_disk() to get_disk_and_module()

2018-02-06 Thread Jan Kara
Rename get_disk() to get_disk_and_module() to make sure what the function does. It's not a great name but at least it is now clear that put_disk() is not it's counterpart. Signed-off-by: Jan Kara <j...@suse.cz> --- block/genhd.c | 10 -- drivers/block/amiflop.c | 2 +- d

[PATCH 6/6] blockdev: Avoid two active bdev inodes for one device

2018-02-06 Thread Jan Kara
reference. That way we make sure gendisk can get associated only with visible bdev inodes. Signed-off-by: Jan Kara <j...@suse.cz> --- fs/block_dev.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index fe41a7

[PATCH 3/6] genhd: Add helper put_disk_and_module()

2018-02-06 Thread Jan Kara
Add a proper counterpart to get_disk_and_module() - put_disk_and_module(). Currently it is opencoded in several places. Signed-off-by: Jan Kara <j...@suse.cz> --- block/blk-cgroup.c| 11 ++- block/genhd.c | 20 fs/block_dev.c

Re: blkdev loop UAF

2018-02-05 Thread Jan Kara
On Thu 01-02-18 19:58:45, Eric Biggers wrote: > On Thu, Jan 11, 2018 at 06:00:08PM +0100, Jan Kara wrote: > > On Thu 11-01-18 19:22:39, Hou Tao wrote: > > > Hi, > > > > > > On 2018/1/11 16:24, Dan Carpenter wrote: > > > > Thanks for your report and

[LSF/MM TOPIC] get_user_pages() and filesystems

2018-01-25 Thread Jan Kara
and possibly some input from FS / MM / RDMA folks about what might be acceptable. Honza [1] https://www.spinics.net/lists/linux-xfs/msg14468.html -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: Panic with ext4,nbd,qemu-img,block

2018-01-25 Thread Jan Kara
would be on BUG_ON(!buffer_mapped(bh)); but I'm not sure... Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: blkdev loop UAF

2018-01-11 Thread Jan Kara
se { > + if (bdev->bd_disk != disk) { > + ret = -ENXIO; > + goto out_unlock_bdev; > + } > + > if (bdev->bd_contains == bdev) { > ret = 0; > if (bdev->

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

[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 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 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 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 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

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 +++

[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

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: 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

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: [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 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-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

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 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 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 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 5/8] nowait aio: return on congested block device

2017-04-20 Thread Jan Kara
REQ_IDLE flags have nothing to do with the ability of the block layer to submit the bio without blocking... Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [PATCH 2/8] nowait aio: Introduce RWF_NOWAIT

2017-04-19 Thread Jan Kara
ay be complicated in the current implementation but IMO it makes sense to ask for such functionality (see e.g. patches for non-blocking buffered reads that were flying around year or two ago). So I agree with Christoph that EOPNOTSUPP is more logical. Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

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 4/8] nowait-aio: Introduce IOMAP_NOWAIT

2017-04-19 Thread Jan Kara
(1 << 2) /* report extent status, e.g. FIEMAP */ > #define IOMAP_FAULT (1 << 3) /* mapping for page fault */ > #define IOMAP_DIRECT (1 << 4) /* direct I/O */ > +#define IOMAP_NOWAIT (1 << 5) /* Don't wait for writeback */ > > struct iomap_ops { > /* > -- > 2.12.0 > -- Jan Kara <j...@suse.com> SUSE Labs, CR

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

2017-04-18 Thread Jan Kara
Hello Bart, On Fri 14-04-17 15:42:53, Bart Van Assche wrote: > On Wed, 2017-04-12 at 10:23 +0200, Jan Kara wrote: > > +#ifndef CONFIG_BLK_WBT_MQ > > + if (q->mq_ops) > > + return; > > +#endif > > +#ifndef CONFIG_BLK_WBT_SQ > > + if (q->re

[PATCH 25/25] bdi: Drop 'parent' argument from bdi_register[_va]()

2017-04-12 Thread Jan Kara
Drop 'parent' argument of bdi_register() and bdi_register_va(). It is always NULL. Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Jan Kara <j...@suse.cz> --- drivers/mtd/mtdcore.c | 2 +- fs/super.c | 2 +- include/linux/backing-dev.h | 9 +

[PATCH 06/25] lustre: Convert to separately allocated bdi

2017-04-12 Thread Jan Kara
.@lists.lustre.org Reviewed-by: Andreas Dilger <andreas.dil...@intel.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Jan Kara <j...@suse.cz> --- .../staging/lustre/lustre/include/lustre_disk.h| 4 drivers/staging/lustre/lustre/llite/llite_lib.c| 24 +++---

[PATCH 24/25] block: Remove unused functions

2017-04-12 Thread Jan Kara
Now that all backing_dev_info structure are allocated separately, we can drop some unused functions. Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Jan Kara <j...@suse.cz> --- include/linux/backing-dev.h | 5 mm/backing-dev.c

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

2017-04-12 Thread Jan Kara
<h...@lst.de> Signed-off-by: Jan Kara <j...@suse.cz> --- fs/fuse/dev.c| 8 fs/fuse/fuse_i.h | 3 --- fs/fuse/inode.c | 42 +- 3 files changed, 17 insertions(+), 36 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index b6

[PATCH 23/25] fs: Remove SB_I_DYNBDI flag

2017-04-12 Thread Jan Kara
Now that all bdi structures filesystems use are properly refcounted, we can remove the SB_I_DYNBDI flag. Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Jan Kara <j...@suse.cz> --- drivers/mtd/mtdsuper.c | 1 - fs/gfs2/ops_fstype.c | 1 - fs/nfs/super.c | 1

<    1   2   3   4   5   >