Re: [RFC PATCH V3 1/1] block: reject I/O for same fd if block size changed

2021-01-05 Thread Minwoo Im
Hello, On 21-01-05 08:50:09, Christoph Hellwig wrote: > On Tue, Jan 05, 2021 at 10:04:56AM +0900, Minwoo Im wrote: > > It was a point that I really would like to ask by RFC whether we can > > have backpointer to the gendisk from the request_queue. And I'd like to > > have it to simplify this rout

Re: [RFC PATCH V3 1/1] block: reject I/O for same fd if block size changed

2021-01-04 Thread Christoph Hellwig
On Tue, Jan 05, 2021 at 10:04:56AM +0900, Minwoo Im wrote: > It was a point that I really would like to ask by RFC whether we can > have backpointer to the gendisk from the request_queue. And I'd like to > have it to simplify this routine and for future usages also. I think it is the right thing

Re: [RFC PATCH V3 1/1] block: reject I/O for same fd if block size changed

2021-01-04 Thread Minwoo Im
Hello Christoph, Thanks for your review. On 21-01-04 18:11:41, Christoph Hellwig wrote: > On Mon, Jan 04, 2021 at 06:11:08PM +0100, Christoph Hellwig wrote: > > On Mon, Jan 04, 2021 at 10:06:59PM +0900, Minwoo Im wrote: > > > + if (q->backing_dev_info && q->backing_dev_info->owner && > > > +

Re: [RFC PATCH V3 1/1] block: reject I/O for same fd if block size changed

2021-01-04 Thread Christoph Hellwig
On Mon, Jan 04, 2021 at 06:11:08PM +0100, Christoph Hellwig wrote: > On Mon, Jan 04, 2021 at 10:06:59PM +0900, Minwoo Im wrote: > > + if (q->backing_dev_info && q->backing_dev_info->owner && > > + limits->logical_block_size != size) { > > + bdev = blkdev_get_no_open(q-

Re: [RFC PATCH V3 1/1] block: reject I/O for same fd if block size changed

2021-01-04 Thread Christoph Hellwig
On Mon, Jan 04, 2021 at 10:06:59PM +0900, Minwoo Im wrote: > + if (q->backing_dev_info && q->backing_dev_info->owner && > + limits->logical_block_size != size) { > + bdev = blkdev_get_no_open(q->backing_dev_info->owner->devt); > + bdev->bd_disk->flags

[RFC PATCH V3 1/1] block: reject I/O for same fd if block size changed

2021-01-04 Thread Minwoo Im
This patch fixes I/O errors during BLKRRPART ioctl() behavior right after format operation that changed logical block size of the block device with a same file descriptor opened. This issue can be easily reproduced with a single format command in case of NVMe (logical block size 512B to 4096B).