Re: [dm-devel] [RFC PATCH] block: add meaningful macro for flush op flags

2023-05-14 Thread Coly Li
oup { > STAT_READ, > STAT_WRITE, > -- Personally I like current explicit way, it is simpler than an extra macro. This is just my own points, FYI. Thanks. Coly Li -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH v2] Avoid deadlock for recursive I/O on dm-thin when used as swap

2023-02-27 Thread Coly Li
happens on dm-thin volume when it is used as swap. Note: this change depends on commit a666e5c05e7c ("dm: fix deadlock when swapping to encrypted device") Signed-off-by: Coly Li Cc: Mikulas Patocka Cc: Mike Snitzer Cc: sta...@vger.kernel.org --- Changelog, v2: fix typo in commit l

[dm-devel] [PATCH] Avoid deadlock for recursive I/O on dm-thin when used as swap

2023-02-27 Thread Coly Li
happens on dm-thin volume when it is used as swap. NOTE: this change depends on commit a666e5c05e7c ("dm: fix deadlock when swapping to encrypted device") Signed-off-by: Coly Li Cc: Signed-off-by: Mikulas Patocka Cc: Mike Snitzer Cc: sta...@vger.kernel.org --- drivers/md/dm-thin.c |

Re: [dm-devel] [PATCH] block: remove bio_set_op_attrs

2022-12-06 Thread Coly Li
> 2022年12月6日 22:40,Christoph Hellwig 写道: > > This macro is obsolete, so replace the last few uses with open coded > bi_opf assignments. > > Signed-off-by: Christoph Hellwig Acked-by: Coly Li mailto:col...@suse.de>> BTW, may I ask why bio_set_op_attrs() is remo

Re: [dm-devel] [PATCH] block: remove bio_set_op_attrs

2022-12-06 Thread Coly Li
> 2022年12月6日 22:49,Christoph Hellwig 写道: > > On Tue, Dec 06, 2022 at 10:46:31PM +0800, Coly Li wrote: >> BTW, may I ask why bio_set_op_attrs() is removed. Quite long time ago it was >> added to avoid open code, and now we remove it to use open coded >> assignme

Re: [dm-devel] A kernel panic (or soft lockup) due to stack overflow by recursive dm-table reload

2022-08-25 Thread Coly Li
well. > > Since the 'kernel stack size' is limit - the amount of recursive calls is > also limited - so having such limitation exposed on 'creation' time seems > like fair path - compared with crashing kernel during chaing processing Although I don’t have deep understand to device mapper, I agree that it sounds as a simple and working way to fix. Thanks. Coly Li -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] A kernel panic (or soft lockup) due to stack overflow by recursive dm-table reload

2022-08-24 Thread Coly Li
dm-table reload, is it a bug or just as-designed ? Thanks in advance. Coly Li [1] The kernel panic on Linux v5.3, [ 3974.375341] BUG: stack guard page was hit at 94b9add1 (stack is 2345b2aa..1e32dd11) [ 3974.375361] kernel stack overflow (double-fault): [#1] SMP

Re: [dm-devel] [PATCH 26/27] block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

2022-04-09 Thread Coly Li
. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Ryusuke Konishi [nifs2] Acked-by: Coly Li [drbd] Hi Christoph, My ACK is for bcache, not drbd here. Thanks. Coly Li Acked-by: David Sterba [btrfs] -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com

Re: [dm-devel] [PATCH 4/5] block: turn bio_kmalloc into a simple kmalloc wrapper

2022-04-07 Thread Coly Li
[snipped] For bcache part, Acked-by: Coly Li Coly Li -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 22/27] block: refactor discard bio size limiting

2022-04-07 Thread Coly Li
On 4/6/22 2:05 PM, Christoph Hellwig wrote: Move all the logic to limit the discard bio size into a common helper so that it is better documented. Signed-off-by: Christoph Hellwig Acked-by: Coly Li Thanks for the change. Coly Li --- block/blk-lib.c | 59

Re: [dm-devel] [PATCH 26/27] block: uncouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

2022-04-07 Thread Coly Li
, Acked-by: Coly Li Thanks. Coly Li --- block/blk-core.c| 2 +- block/blk-lib.c | 64 - block/blk-mq-debugfs.c | 1 - block/blk-settings.c| 16 +++- block/fops.c

Re: [dm-devel] [PATCH 23/27] block: add a bdev_max_discard_sectors helper

2022-04-06 Thread Coly Li
is done e.g. for write zeroes as well. Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li Thanks. Coly Li --- block/blk-core.c| 2 +- block/blk-lib.c | 2 +- block/ioctl.c | 3 +-- drivers/block/drbd

Re: [dm-devel] [PATCH 25/27] block: remove QUEUE_FLAG_DISCARD

2022-04-06 Thread Coly Li
, even if the default stacking rules would allow for it. Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li Thanks. Coly Li --- arch/um/drivers/ubd_kern.c| 2 -- block/blk-mq-debugfs.c| 1 - drivers/block/drbd/drbd_nl.c | 15

Re: [dm-devel] [PATCH 01/29] bcache: remove bdev_sectors

2021-10-12 Thread Coly Li
On 10/13/21 1:10 PM, Christoph Hellwig wrote: Use the equivalent block layer helper instead. Signed-off-by: Christoph Hellwig Acked-by: Coly Li Thanks. Coly Li --- drivers/md/bcache/super.c | 2 +- drivers/md/bcache/util.h | 4 drivers/md/bcache/writeback.c | 2 +- 3

Re: [dm-devel] [PATCH 09/15] bcache: use bvec_virt

2021-08-04 Thread Coly Li
ooks good to me. Reviewed-by: Coly Li Thanks. Coly Li > --- > drivers/md/bcache/btree.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c > index 183a58c89377..0595559de174 100644 > --- a/drivers/

Re: [dm-devel] [PATCH] md: use BLK_STS_OK instead of hardcode

2021-06-22 Thread Coly Li
t the only one example is, 871 if (s->iop.status) 872 continue_at_nobarrier(cl, cached_dev_read_error, bcache_wq); Maybe you should change to         if (s->iop.status != BLK_STS_OK)                     continue_at_nobarrier(cl, cached_dev_read_error, bcache_wq); Just FYI. Coly Li -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 12/26] bcache: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-23 Thread Coly Li
On 5/21/21 1:51 PM, Christoph Hellwig wrote: > Convert the bcache driver to use the blk_alloc_disk and blk_cleanup_disk > helpers to simplify gendisk and request_queue allocation. > > Signed-off-by: Christoph Hellwig Acked-by: Coly Li Thanks. Coly Li > --- > drivers/md/b

Re: [dm-devel] [PATCH 12/26] bcache: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-21 Thread Coly Li
"bcache: fix refcount underflow in bcache_device_free()"). Maybe add a parameter to blk_cleanup_disk() or checking (disk->flags & GENHD_FL_UP) inside blk_cleanup_disk() ? Coly Li > } > > bioset_exit(>bio_split); > @@ -946,7 +942,7 @@ static int bcache_device_init(s

Re: [dm-devel] dm thin-volume hung as swap: bug or as-design ?

2021-01-29 Thread Coly Li
On 1/29/21 9:57 PM, Alasdair G Kergon wrote: > On Fri, Jan 29, 2021 at 06:40:06PM +0800, Coly Li wrote: >> Recently I receive a report that whole system hung and no response after >> a while with I/O load. The special configuration is the dm thin-pool >> volume is used

[dm-devel] dm thin-volume hung as swap: bug or as-design ?

2021-01-29 Thread Coly Li
se and kernel information for 1 hour+ before I reset the machine. My questions are, - Can a thin-pool volume be used as swap device? - The above description is a bug, or an already know issue which should be avoided ? Thanks in advance. Coly Li -- dm-devel mailing list dm-devel@redhat.com https://w

Re: [dm-devel] [PATCH 13/45] block: add a bdev_kobj helper

2020-11-24 Thread Coly Li
On 11/24/20 9:27 PM, Christoph Hellwig wrote: > Add a little helper to find the kobject for a struct block_device. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Jan Kara > Reviewed-by: Johannes Thumshirn For the bcache part, Acked-by

Re: [dm-devel] [PATCH 23/45] block: remove i_bdev

2020-11-24 Thread Coly Li
ra reference in the inode and can generally > simplify handling of struct block_device to keep the lookups contained > in the core block layer code. > > Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li Thanks. Coly Li > --- > block/ioctl.c

Re: [dm-devel] [PATCH 30/45] block: remove the nr_sects field in struct hd_struct

2020-11-24 Thread Coly Li
for torn writes. By only using the block_device field > this problem also gets fixed. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Greg Kroah-Hartman For the bcache part, Acked-by: Coly Li Thanks. Coly Li > --- > block/bio.c| 4 +- > blo

Re: [dm-devel] [PATCH 38/45] block: switch partition lookup to use struct block_device

2020-11-24 Thread Coly Li
the bcache part, Acked-by: Coly Li > --- > block/bio.c| 4 +- > block/blk-core.c | 66 ++ > block/blk-flush.c | 2 +- > block/blk-mq.c | 9 ++-- > block/blk-mq.h

Re: [dm-devel] [PATCH 19/20] bcache: remove a superflous lookup_bdev all

2020-11-18 Thread Coly Li
On 11/18/20 5:10 PM, Greg KH wrote: > On Wed, Nov 18, 2020 at 04:54:51PM +0800, Coly Li wrote: >> On 11/18/20 4:47 PM, Christoph Hellwig wrote: >>> Don't bother to call lookup_bdev for just a slightly different error >>> message without any functional change. >&

Re: [dm-devel] [PATCH 19/20] bcache: remove a superflous lookup_bdev all

2020-11-18 Thread Coly Li
and observed, and distinct a busy device and an already registered device is important (the first one is critical error and second one is not). Remove such error message will be a functional regression. Coly Li > --- > drivers/md/bcache/super.c | 44 +-- > 1 file

Re: [dm-devel] [PATCH 07/13] block: lift setting the readahead size into the block layer

2020-09-22 Thread Coly Li
s there as well by applying the same scheme based on > max_sectors. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Johannes Thumshirn For the bcache part, Acked-by: Coly Li Thanks. Coly Li > --- > block/blk-settings.c | 5 ++--- > block/blk-sysfs.c

Re: [dm-devel] [PATCH 03/13] bcache: inherit the optimal I/O size

2020-09-22 Thread Coly Li
On 2020/9/21 16:07, Christoph Hellwig wrote: > Inherit the optimal I/O size setting just like the readahead window, > as any reason to do larger I/O does not apply to just readahead. > > Signed-off-by: Christoph Hellwig Acked-by: Coly Li Thanks. Coly Li > --- > drivers

Re: [dm-devel] [PATCH 03/13] bcache: inherit the optimal I/O size

2020-09-21 Thread Coly Li
On 2020/9/21 22:00, Christoph Hellwig wrote: > On Mon, Sep 21, 2020 at 05:54:59PM +0800, Coly Li wrote: >> I am not sure whether virtual bcache device's optimal request size can >> be simply set like this. >> >> Most of time inherit backing device's o

Re: [dm-devel] [PATCH 03/13] bcache: inherit the optimal I/O size

2020-09-21 Thread Coly Li
l request size of the virtual bcache device as the least common multiple of cache device's and backing device's optimal request sizes ? [snipped] Thanks. Coly Li -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH] dax: fix for do not print error message for non-persistent memory block device

2020-09-10 Thread Coly Li
: error: unaligned partition for dax > kernel: sda3: error: unaligned partition for dax > Aha, yes you are right, I agree with you. Coly Li > Reviewed-by: John Pittman > > On Thu, Sep 3, 2020 at 12:12 PM Coly Li wrote: >> >> On 2020/9/4 00:06, Ira Weiny wrote: >&

[dm-devel] [PATCH v4] dax: fix for do not print error message for non-persistent memory block device

2020-09-03 Thread Coly Li
purpose. Fixes: c2affe920b0e ("dax: do not print error message for non-persistent memory block device") Signed-off-by: Coly Li Reviewed-and-tested-by: Adrian Huang Reviewed-by: Ira Weiny Reviewed-by: Mike Snitzer Reviewed-by: Pankaj Gupta Cc: Jan Kara Cc: Vishal Verma --- Cha

Re: [dm-devel] [PATCH v2] dax: fix for do not print error message for non-persistent memory block device

2020-09-03 Thread Coly Li
On 2020/9/4 00:00, Mike Snitzer wrote: > On Thu, Sep 03 2020 at 11:28am -0400, > Coly Li wrote: > >> When calling __generic_fsdax_supported(), a dax-unsupported device may >> not have dax_dev as NULL, e.g. the dax related code block is not enabled >>

Re: [dm-devel] [PATCH] dax: fix for do not print error message for non-persistent memory block device

2020-09-03 Thread Coly Li
On 2020/9/4 00:06, Ira Weiny wrote: > On Thu, Sep 03, 2020 at 07:55:49PM +0800, Coly Li wrote: >> When calling __generic_fsdax_supported(), a dax-unsupported device may >> not have dax_dev as NULL, e.g. the dax related code block is not enabled >> by Kco

[dm-devel] [PATCH v3] dax: fix for do not print error message for non-persistent memory block device

2020-09-03 Thread Coly Li
for the above purpose, - if (!dax_dev && !bdev_dax_supported(bdev, blocksize)) { + if (!dax_dev || !bdev_dax_supported(bdev, blocksize)) { Fixes: c2affe920b0e ("dax: do not print error message for non-persistent memory block device") Signed-off-by: Coly Li R

[dm-devel] [PATCH v2] dax: fix for do not print error message for non-persistent memory block device

2020-09-03 Thread Coly Li
for the above purpose, - if (!dax_dev && !bdev_dax_supported(bdev, blocksize)) { + if (!dax_dev || !bdev_dax_supported(bdev, blocksize)) { Fixes: c2affe920b0e ("dax: do not print error message for non-persistent memory block device") Signed-off-by: Coly Li R

[dm-devel] [PATCH] dax: fix for do not print error message for non-persistent memory block device

2020-09-03 Thread Coly Li
for the above purpose, - if (!dax_dev && !bdev_dax_supported(bdev, blocksize)) { + if (!dax_dev || !bdev_dax_supported(bdev, blocksize)) { Fixes: c2affe920b0e ("dax: do not print error message for non-persistent memory block device") Signed-off-by: Coly Li Cc

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 00:51, Mike Snitzer wrote: > On Wed, Sep 02 2020 at 12:46pm -0400, > Coly Li wrote: > >> On 2020/9/3 00:44, Mike Snitzer wrote: >>> On Wed, Sep 02 2020 at 12:40pm -0400, >>> Coly Li wrote: >>> >>>> On 2020/9/3 00:04, Mike Snit

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 07:05, Verma, Vishal L wrote: > On Thu, 2020-09-03 at 00:40 +0800, Coly Li wrote: >> On 2020/9/3 00:04, Mike Snitzer wrote: >>> 5.9 commit 231609785cbfb ("dax: print error message by pr_info() in >>> __generic_fsdax_supported()"

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 00:51, Mike Snitzer wrote: > On Wed, Sep 02 2020 at 12:46pm -0400, > Coly Li wrote: > >> On 2020/9/3 00:44, Mike Snitzer wrote: >>> On Wed, Sep 02 2020 at 12:40pm -0400, >>> Coly Li wrote: >>> >>>> On 2020/9/3 00:04, Mike Snit

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 00:44, Mike Snitzer wrote: > On Wed, Sep 02 2020 at 12:40pm -0400, > Coly Li wrote: > >> On 2020/9/3 00:04, Mike Snitzer wrote: >>> 5.9 commit 231609785cbfb ("dax: print error message by pr_info() in >>> __generic_fsdax_supported()

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
iled (-95) > [66567.503693] dm-2: error: dax access failed (-95) > > commit 231609785cbfb must be reverted. > > Please advise, thanks. Adrian Huang from Lenovo posted a patch, which titled: dax: do not print error message for non-persistent memory block device It fixes the issue, but

Re: [dm-devel] [PATCH 1/1] block: move the PAGE_SECTORS definition into

2020-08-21 Thread Coly Li
On 2020/8/21 14:48, Leizhen (ThunderTown) wrote: > > > On 8/21/2020 12:11 PM, Coly Li wrote: >> On 2020/8/21 10:03, Zhen Lei wrote: >>> There are too many PAGE_SECTORS definitions, and all of them are the >>> same. It looks a bit of a mess. So why not move

Re: [dm-devel] [PATCH 1/1] block: move the PAGE_SECTORS definition into

2020-08-20 Thread Coly Li
gt; 4KB: currently in bcache code the sector size is assumed to be 512 sectors, if kernel page > 4KB, it is possible that PAGE_SECTORS in bcache will be a number > 8 ? Thanks. Coly Li > --- > drivers/block/brd.c | 1 - > drivers/block/null_blk_main.c | 1 - > drivers/md/

Re: [dm-devel] [PATCH 17/20] block: rename generic_make_request to submit_bio_noacct

2020-07-02 Thread Coly Li
ic_make_request(). Anyway, if it is decided, for bcache part, Acked-by: Coly Li > --- > Documentation/block/biodoc.rst| 2 +- > .../fault-injection/fault-injection.rst | 2 +- > Documentation/trace/ftrace.rst| 4 +-- > block/bio.c

Re: [dm-devel] [PATCH 16/20] block: move ->make_request_fn to struct block_device_operations

2020-07-02 Thread Coly Li
Also remove the request_queue argument to it, as > the queue can be derived pretty trivially from the bio. > > Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li > --- > Documentation/block/biodoc.rst| 2 +- > .../block/writeback_

Re: [dm-devel] [PATCH 09/20] bcache: stop setting ->queuedata

2020-07-02 Thread Coly Li
On 2020/7/1 16:59, Christoph Hellwig wrote: > Nothing in bcache actually uses the ->queuedata field. > > Signed-off-by: Christoph Hellwig Acked-by: Coly Li > --- > drivers/md/bcache/super.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/md/bcache/

Re: [dm-devel] [PATCH 4/4] writeback: remove bdi->congested_fn

2020-07-01 Thread Coly Li
_fn stacking infrastructure. > > Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li Thanks. Coly Li > --- > drivers/block/drbd/drbd_main.c | 59 > drivers/md/bcache/request.c | 43 --- &

Re: [dm-devel] [PATCH 05/16] bcache: use bio_{start,end}_io_acct

2020-05-25 Thread Coly Li
On 2020/5/25 19:30, Christoph Hellwig wrote: > Switch bcache to use the nicer bio accounting helpers, and call the > routines where we also sample the start time to give coherent accounting > results. > > Signed-off-by: Christoph Hellwig Acked-by: Coly Li Coly Li > --- &g

Re: [dm-devel] [PATCH 1/3] bcache: remove a duplicate ->make_request_fn assignment

2020-04-26 Thread Coly Li
ed-off-by: Christoph Hellwig It looks good to me. Reviewed-by: Coly Li Thanks. Coly Li > --- > drivers/md/bcache/request.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c > index 71a90fbec314b..77d1a26975174 1006

Re: [dm-devel] [PATCH] bcache: never writeback a discard operation

2019-01-22 Thread Coly Li
use in this function); did you mean ‘REQ_DISCARD’? >> >> >> How should we proceed with this patch? > > The patch seems reasonably easy to backport. Compile-tested only, and > only against v4.4.171. I don't have idea whether stable kernels accept rebased patches, for

Re: [dm-devel] [PATCH] bcache: never writeback a discard operation

2019-01-19 Thread Coly Li
t; --- a/drivers/md/bcache/writeback.h > +++ b/drivers/md/bcache/writeback.h > @@ -71,6 +71,9 @@ static inline bool should_writeback(struct cached_dev *dc, > struct bio *bio, > in_use > bch_cutoff_writeback_sync) > return false; > > + if (bio_op(bio) == REQ_OP_DISCARD) > + return false; > + > if (dc->partial_stripes_expensive && > bcache_dev_stripe_dirty(dc, bio->bi_iter.bi_sector, > bio_sectors(bio))) > Hi Daniel, Nice catch! I add this one to my for-next directory, for v5.1 merge window. Thanks. -- Coly Li -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 2/6] bcache: don't clone bio in bch_data_verify

2018-06-19 Thread Coly Li
On 2018/6/19 12:52 PM, Christoph Hellwig wrote: > We immediately overwrite the biovec array, so instead just allocate > a new bio and copy over the disk, setor and size. > > Signed-off-by: Christoph Hellwig It looks good to me. Acked-by: Coly Li Thanks. Coly Li > --- >

Re: [dm-devel] [PATCH 01/11] block_dev: Support checking inode permissions in lookup_bdev()

2017-12-23 Thread Coly Li
k.io> Hi Dongsu, Could you please use a macro like NO_PERMISSION_CHECK to replace hard coded 0 ? At least for me, I don't need to check what does 0 mean in the new lookup_bdev(). Thanks. Coly Li > --- > drivers/md/bcache/super.c | 2 +- > drivers/md/dm-table.c | 2 +- > dr

Re: [dm-devel] [PATCH] dm bio prison: use rb_entry()

2017-01-20 Thread Coly Li
> while (*new) { > struct dm_bio_prison_cell *cell = > - container_of(*new, struct dm_bio_prison_cell, node); > + rb_entry(*new, struct dm_bio_prison_cell, node); > > r = cmp_keys(key, >key); > > Acked-