linux-btrace.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/9] block: use right accessor to read nr_sects
@ 2019-07-02 17:42 Chaitanya Kulkarni
  2019-07-02 17:42 ` [PATCH V3 1/9] block: add a helper function to read nr_setcs Chaitanya Kulkarni
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

Hi,

In the blk-zoned, bcache, f2fs, target-pscsi, xen and blktrace
implementation block device->hd_part->number of sectors field is
accessed directly without any appropriate locking or accessor function. 
There is an existing accessor function present in the in 
include/linux/genhd.h which should be used to read the
bdev->hd_part->nr_sects.

From ${KERN_DIR}/include/linux/genhd.h:-
<snip>
714 /*
715  * Any access of part->nr_sects which is not protected by partition
716  * bd_mutex or gendisk bdev bd_mutex, should be done using this
717  * accessor function.
718  *
719  * Code written along the lines of i_size_read() and i_size_write().
720  * CONFIG_PREEMPT case optimizes the case of UP kernel with preemption
721  * on.
722  */
723 static inline sector_t part_nr_sects_read(struct hd_struct *part)
724 {
<snip>

This patch series introduces a helper function on the top of the
part_nr_sects_read() and removes the all direct accesses to the
bdev->hd_part->nr_sects.

This series is based on :-

1. Repo :-
   git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git.
2. Branch :- for-next.

Please consider this for 5.3.

Changes from V2:-

1. Add target-pscsi patch.
2. Get rid of extra variable in the bdev_nr_setcs().
3. Add compile only patch for xen/blkback.

Chaitanya Kulkarni (9):
  block: add a helper function to read nr_setcs
  blk-zoned: update blkdev_nr_zones() with helper
  blk-zoned: update blkdev_report_zone() with helper
  blk-zoned: update blkdev_reset_zones() with helper
  bcache: update cached_dev_init() with helper
  f2fs: use helper in init_blkz_info()
  blktrace: use helper in blk_trace_setup_lba()
  target/pscsi: use helper in pscsi_get_blocks()
  xen/blkback: use helper in vbd_sz()

 block/blk-zoned.c                  | 12 ++++++------
 drivers/block/xen-blkback/common.h |  2 +-
 drivers/md/bcache/super.c          |  2 +-
 drivers/target/target_core_pscsi.c |  2 +-
 fs/f2fs/super.c                    |  2 +-
 include/linux/blkdev.h             |  6 ++++++
 kernel/trace/blktrace.c            |  2 +-
 7 files changed, 17 insertions(+), 11 deletions(-)

-- 
2.19.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH V3 1/9] block: add a helper function to read nr_setcs
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  2019-07-03  0:19   ` Minwoo Im
  2019-07-03 15:03   ` Bart Van Assche
  2019-07-02 17:42 ` [PATCH V3 2/9] blk-zoned: update blkdev_nr_zones() with helper Chaitanya Kulkarni
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

This patch introduces helper function to read the number of sectors
from struct block_device->bd_part member. For more details Please refer
to the comment in the include/linux/genhd.h for part_nr_sects_read().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/linux/blkdev.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 592669bcc536..be7ee5a0b0dd 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1475,6 +1475,12 @@ static inline void put_dev_sector(Sector p)
 	put_page(p.v);
 }
 
+/* Helper function to read the bdev->bd_part->nr_sects */
+static inline sector_t bdev_nr_sects(struct block_device *bdev)
+{
+	return part_nr_sects_read(bdev->bd_part);
+}
+
 int kblockd_schedule_work(struct work_struct *work);
 int kblockd_schedule_work_on(int cpu, struct work_struct *work);
 int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay);
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH V3 2/9] blk-zoned: update blkdev_nr_zones() with helper
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
  2019-07-02 17:42 ` [PATCH V3 1/9] block: add a helper function to read nr_setcs Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  2019-07-03  0:20   ` Minwoo Im
  2019-07-02 17:42 ` [PATCH V3 3/9] blk-zoned: update blkdev_report_zone() " Chaitanya Kulkarni
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

This patch updates the blkdev_nr_zones() with newly introduced helper
function to read the nr_sects from block device's hd_parts with the
help if part_nr_sects_read().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-zoned.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index ae7e91bd0618..5051db35c3fd 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -90,7 +90,7 @@ unsigned int blkdev_nr_zones(struct block_device *bdev)
 	if (!blk_queue_is_zoned(q))
 		return 0;
 
-	return __blkdev_nr_zones(q, bdev->bd_part->nr_sects);
+	return __blkdev_nr_zones(q, bdev_nr_sects(bdev));
 }
 EXPORT_SYMBOL_GPL(blkdev_nr_zones);
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH V3 3/9] blk-zoned: update blkdev_report_zone() with helper
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
  2019-07-02 17:42 ` [PATCH V3 1/9] block: add a helper function to read nr_setcs Chaitanya Kulkarni
  2019-07-02 17:42 ` [PATCH V3 2/9] blk-zoned: update blkdev_nr_zones() with helper Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  2019-07-03  0:21   ` Minwoo Im
  2019-07-02 17:42 ` [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() " Chaitanya Kulkarni
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

This patch updates the blkdev_report_zone(s)() with newly introduced
helper function to read the nr_sects from block device's hd_parts with
the help of part_nr_sects_read().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-zoned.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 5051db35c3fd..9faf4488339d 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -106,7 +106,7 @@ static bool blkdev_report_zone(struct block_device *bdev, struct blk_zone *rep)
 		return false;
 
 	rep->start -= offset;
-	if (rep->start + rep->len > bdev->bd_part->nr_sects)
+	if (rep->start + rep->len > bdev_nr_sects(bdev))
 		return false;
 
 	if (rep->type = BLK_ZONE_TYPE_CONVENTIONAL)
@@ -176,13 +176,13 @@ int blkdev_report_zones(struct block_device *bdev, sector_t sector,
 	if (WARN_ON_ONCE(!bdev->bd_disk->fops->report_zones))
 		return -EOPNOTSUPP;
 
-	if (!*nr_zones || sector >= bdev->bd_part->nr_sects) {
+	if (!*nr_zones || sector >= bdev_nr_sects(bdev)) {
 		*nr_zones = 0;
 		return 0;
 	}
 
 	nrz = min(*nr_zones,
-		  __blkdev_nr_zones(q, bdev->bd_part->nr_sects - sector));
+		  __blkdev_nr_zones(q, bdev_nr_sects(bdev) - sector));
 	ret = blk_report_zones(bdev->bd_disk, get_start_sect(bdev) + sector,
 			       zones, &nrz, gfp_mask);
 	if (ret)
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() with helper
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
                   ` (2 preceding siblings ...)
  2019-07-02 17:42 ` [PATCH V3 3/9] blk-zoned: update blkdev_report_zone() " Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  2019-07-03  0:23   ` Minwoo Im
  2019-07-02 17:42 ` [PATCH V3 5/9] bcache: update cached_dev_init() " Chaitanya Kulkarni
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

This patch updates the blkdev_reset_zones() with newly introduced
helper function to read the nr_sects from block device's hd_parts with
the help of part_nr_sects_read().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-zoned.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 9faf4488339d..e7f2874b5d37 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -229,7 +229,7 @@ int blkdev_reset_zones(struct block_device *bdev,
 	if (bdev_read_only(bdev))
 		return -EPERM;
 
-	if (!nr_sectors || end_sector > bdev->bd_part->nr_sects)
+	if (!nr_sectors || end_sector > bdev_nr_sects(bdev))
 		/* Out of range */
 		return -EINVAL;
 
@@ -239,7 +239,7 @@ int blkdev_reset_zones(struct block_device *bdev,
 		return -EINVAL;
 
 	if ((nr_sectors & (zone_sectors - 1)) &&
-	    end_sector != bdev->bd_part->nr_sects)
+	    end_sector != bdev_nr_sects(bdev))
 		return -EINVAL;
 
 	blk_start_plug(&plug);
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH V3 5/9] bcache: update cached_dev_init() with helper
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
                   ` (3 preceding siblings ...)
  2019-07-02 17:42 ` [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() " Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  2019-07-02 17:42 ` [PATCH V3 6/9] f2fs: use helper in init_blkz_info() Chaitanya Kulkarni
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

In the bcache when initializing the cached device we don't actually
use any sort of locking when reading the number of sectors from the
part. This patch updates the cached_dev_init() with newly introduced
helper function to read the nr_sects from block device's hd_parts with
the help of part_nr_sects_read().

Acked-by: Coly Li <colyli@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/md/bcache/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 1b63ac876169..6a29ba89dae1 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1263,7 +1263,7 @@ static int cached_dev_init(struct cached_dev *dc, unsigned int block_size)
 			q->limits.raid_partial_stripes_expensive;
 
 	ret = bcache_device_init(&dc->disk, block_size,
-			 dc->bdev->bd_part->nr_sects - dc->sb.data_offset);
+			 bdev_nr_sects(dc->bdev) - dc->sb.data_offset);
 	if (ret)
 		return ret;
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH V3 6/9] f2fs: use helper in init_blkz_info()
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
                   ` (4 preceding siblings ...)
  2019-07-02 17:42 ` [PATCH V3 5/9] bcache: update cached_dev_init() " Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  2019-07-02 17:42 ` [PATCH V3 7/9] blktrace: use helper in blk_trace_setup_lba() Chaitanya Kulkarni
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

This patch updates the init_blkz_info() with newly introduced helper
function to read the nr_sects from block device's hd_parts with the
help of part_nr_sects_read().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 6b959bbb336a..24e2848afcf5 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2798,7 +2798,7 @@ static int init_percpu_info(struct f2fs_sb_info *sbi)
 static int init_blkz_info(struct f2fs_sb_info *sbi, int devi)
 {
 	struct block_device *bdev = FDEV(devi).bdev;
-	sector_t nr_sectors = bdev->bd_part->nr_sects;
+	sector_t nr_sectors = bdev_nr_sects(bdev);
 	sector_t sector = 0;
 	struct blk_zone *zones;
 	unsigned int i, nr_zones;
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH V3 7/9] blktrace: use helper in blk_trace_setup_lba()
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
                   ` (5 preceding siblings ...)
  2019-07-02 17:42 ` [PATCH V3 6/9] f2fs: use helper in init_blkz_info() Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  2019-07-02 17:42 ` [COMPILE TEST ONLY PATCH V3 8/9] target/pscsi: use helper in pscsi_get_blocks() Chaitanya Kulkarni
  2019-07-02 17:42 ` [COMPILE TEST ONLY PATCH V3 9/9] xen/blkback: use helper in vbd_sz() Chaitanya Kulkarni
  8 siblings, 0 replies; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

This patch updates the blk_trace_setup_lba() with newly introduced
helper function to read the nr_sects from block device's hd_parts with
the help of part_nr_sects_read().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 kernel/trace/blktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index e1c6d79fb4cc..35ff49503b85 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -461,7 +461,7 @@ static void blk_trace_setup_lba(struct blk_trace *bt,
 
 	if (part) {
 		bt->start_lba = part->start_sect;
-		bt->end_lba = part->start_sect + part->nr_sects;
+		bt->end_lba = part->start_sect + bdev_nr_sects(bdev);
 	} else {
 		bt->start_lba = 0;
 		bt->end_lba = -1ULL;
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [COMPILE TEST ONLY PATCH V3 8/9] target/pscsi: use helper in pscsi_get_blocks()
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
                   ` (6 preceding siblings ...)
  2019-07-02 17:42 ` [PATCH V3 7/9] blktrace: use helper in blk_trace_setup_lba() Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  2019-07-02 17:42 ` [COMPILE TEST ONLY PATCH V3 9/9] xen/blkback: use helper in vbd_sz() Chaitanya Kulkarni
  8 siblings, 0 replies; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

This patch updates the pscsi_get_blocks() with newly introduced helper
function to read the nr_sects from block device's hd_parts with the
help of part_nr_sects_read().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/target/target_core_pscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index c9d92b3e777d..da481edab2de 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -1030,7 +1030,7 @@ static sector_t pscsi_get_blocks(struct se_device *dev)
 	struct pscsi_dev_virt *pdv = PSCSI_DEV(dev);
 
 	if (pdv->pdv_bd && pdv->pdv_bd->bd_part)
-		return pdv->pdv_bd->bd_part->nr_sects;
+		return bdev_nr_sects(pdv->pdv_bd);
 
 	return 0;
 }
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [COMPILE TEST ONLY PATCH V3 9/9] xen/blkback: use helper in vbd_sz()
  2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
                   ` (7 preceding siblings ...)
  2019-07-02 17:42 ` [COMPILE TEST ONLY PATCH V3 8/9] target/pscsi: use helper in pscsi_get_blocks() Chaitanya Kulkarni
@ 2019-07-02 17:42 ` Chaitanya Kulkarni
  8 siblings, 0 replies; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-02 17:42 UTC (permalink / raw)
  To: linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	bvanassche, linux-scsi, Chaitanya Kulkarni

This patch updates the vbd_sz() macro with newly introduced helper
function to read the nr_sects from block device's hd_parts with the
help of part_nr_sects_read().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/block/xen-blkback/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index 1d3002d773f7..f96cb8d1cb99 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -359,7 +359,7 @@ struct pending_req {
 
 
 #define vbd_sz(_v)	((_v)->bdev->bd_part ? \
-			 (_v)->bdev->bd_part->nr_sects : \
+			  bdev_nr_sects((_v)->bdev) : \
 			  get_capacity((_v)->bdev->bd_disk))
 
 #define xen_blkif_get(_b) (atomic_inc(&(_b)->refcnt))
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 1/9] block: add a helper function to read nr_setcs
  2019-07-02 17:42 ` [PATCH V3 1/9] block: add a helper function to read nr_setcs Chaitanya Kulkarni
@ 2019-07-03  0:19   ` Minwoo Im
  2019-07-03 15:03   ` Bart Van Assche
  1 sibling, 0 replies; 17+ messages in thread
From: Minwoo Im @ 2019-07-03  0:19 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, colyli, linux-bcache, linux-btrace, xen-devel,
	kent.overstreet, yuchao0, jaegeuk, damien.lemoal, konrad.wilk,
	roger.pau, bvanassche, linux-scsi, Minwoo Im

On 19-07-02 10:42:27, Chaitanya Kulkarni wrote:
> This patch introduces helper function to read the number of sectors
> from struct block_device->bd_part member. For more details Please refer
> to the comment in the include/linux/genhd.h for part_nr_sects_read().

Without bd_mutex locked, this helper seems useful to have.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 2/9] blk-zoned: update blkdev_nr_zones() with helper
  2019-07-02 17:42 ` [PATCH V3 2/9] blk-zoned: update blkdev_nr_zones() with helper Chaitanya Kulkarni
@ 2019-07-03  0:20   ` Minwoo Im
  0 siblings, 0 replies; 17+ messages in thread
From: Minwoo Im @ 2019-07-03  0:20 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, colyli, linux-bcache, linux-btrace, xen-devel,
	kent.overstreet, yuchao0, jaegeuk, damien.lemoal, konrad.wilk,
	roger.pau, bvanassche, linux-scsi, Minwoo Im

On 19-07-02 10:42:28, Chaitanya Kulkarni wrote:
> This patch updates the blkdev_nr_zones() with newly introduced helper
> function to read the nr_sects from block device's hd_parts with the
> help if part_nr_sects_read().

It looks good to me.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 3/9] blk-zoned: update blkdev_report_zone() with helper
  2019-07-02 17:42 ` [PATCH V3 3/9] blk-zoned: update blkdev_report_zone() " Chaitanya Kulkarni
@ 2019-07-03  0:21   ` Minwoo Im
  0 siblings, 0 replies; 17+ messages in thread
From: Minwoo Im @ 2019-07-03  0:21 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, colyli, linux-bcache, linux-btrace, xen-devel,
	kent.overstreet, yuchao0, jaegeuk, damien.lemoal, konrad.wilk,
	roger.pau, bvanassche, linux-scsi, Minwoo Im

On 19-07-02 10:42:29, Chaitanya Kulkarni wrote:
> This patch updates the blkdev_report_zone(s)() with newly introduced
> helper function to read the nr_sects from block device's hd_parts with
> the help of part_nr_sects_read().

It looks good to me.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() with helper
  2019-07-02 17:42 ` [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() " Chaitanya Kulkarni
@ 2019-07-03  0:23   ` Minwoo Im
  2019-07-03  2:29     ` Chaitanya Kulkarni
  0 siblings, 1 reply; 17+ messages in thread
From: Minwoo Im @ 2019-07-03  0:23 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, colyli, linux-bcache, linux-btrace, xen-devel,
	kent.overstreet, yuchao0, jaegeuk, damien.lemoal, konrad.wilk,
	roger.pau, bvanassche, linux-scsi, Minwoo Im

On 19-07-02 10:42:30, Chaitanya Kulkarni wrote:
> This patch updates the blkdev_reset_zones() with newly introduced
> helper function to read the nr_sects from block device's hd_parts with
> the help of part_nr_sects_read().

Chaitanya,

Are the first three patches split for a special reason?  IMHO, it could
be squashed into a single one.

It looks good to me, by the way.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() with helper
  2019-07-03  0:23   ` Minwoo Im
@ 2019-07-03  2:29     ` Chaitanya Kulkarni
  2019-07-03  5:25       ` Minwoo Im
  0 siblings, 1 reply; 17+ messages in thread
From: Chaitanya Kulkarni @ 2019-07-03  2:29 UTC (permalink / raw)
  To: Minwoo Im
  Cc: linux-block@vger.kernel.org, colyli@suse.de,
	linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org,
	xen-devel@lists.xenproject.org, kent.overstreet@gmail.com,
	yuchao0@huawei.com, jaegeuk@kernel.org, Damien Le Moal,
	konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org,
	linux-scsi@vger.kernel.org

On 7/2/19 5:23 PM, Minwoo Im wrote:
> On 19-07-02 10:42:30, Chaitanya Kulkarni wrote:
>> This patch updates the blkdev_reset_zones() with newly introduced
>> helper function to read the nr_sects from block device's hd_parts with
>> the help of part_nr_sects_read().
> Chaitanya,
>
> Are the first three patches split for a special reason?  IMHO, it could
> be squashed into a single one.
>
> It looks good to me, by the way.

In the blk-zoned.c in this way it is easier to bisect if/when the problem

comes.

>
> Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() with helper
  2019-07-03  2:29     ` Chaitanya Kulkarni
@ 2019-07-03  5:25       ` Minwoo Im
  0 siblings, 0 replies; 17+ messages in thread
From: Minwoo Im @ 2019-07-03  5:25 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block@vger.kernel.org, colyli@suse.de,
	linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org,
	xen-devel@lists.xenproject.org, kent.overstreet@gmail.com,
	yuchao0@huawei.com, jaegeuk@kernel.org, Damien Le Moal,
	konrad.wilk@oracle.com, roger.pau@citrix.com, bvanassche@acm.org,
	linux-scsi@vger.kernel.org, Minwoo Im

On 19-07-03 02:29:33, Chaitanya Kulkarni wrote:
> On 7/2/19 5:23 PM, Minwoo Im wrote:
> > On 19-07-02 10:42:30, Chaitanya Kulkarni wrote:
> >> This patch updates the blkdev_reset_zones() with newly introduced
> >> helper function to read the nr_sects from block device's hd_parts with
> >> the help of part_nr_sects_read().
> > Chaitanya,
> >
> > Are the first three patches split for a special reason?  IMHO, it could
> > be squashed into a single one.
> >
> > It looks good to me, by the way.
> 
> In the blk-zoned.c in this way it is easier to bisect if/when the problem
> 
> comes.

Oh okay.  That makes sense.

Thanks, Chaitanya.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 1/9] block: add a helper function to read nr_setcs
  2019-07-02 17:42 ` [PATCH V3 1/9] block: add a helper function to read nr_setcs Chaitanya Kulkarni
  2019-07-03  0:19   ` Minwoo Im
@ 2019-07-03 15:03   ` Bart Van Assche
  1 sibling, 0 replies; 17+ messages in thread
From: Bart Van Assche @ 2019-07-03 15:03 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: colyli, linux-bcache, linux-btrace, xen-devel, kent.overstreet,
	yuchao0, jaegeuk, damien.lemoal, konrad.wilk, roger.pau,
	linux-scsi

On 7/2/19 10:42 AM, Chaitanya Kulkarni wrote:
> +/* Helper function to read the bdev->bd_part->nr_sects */
> +static inline sector_t bdev_nr_sects(struct block_device *bdev)
> +{
> +	return part_nr_sects_read(bdev->bd_part);
> +}

Is the comment above bdev_nr_sects() really useful or should it be left out?

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-07-03 15:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-02 17:42 [PATCH V3 0/9] block: use right accessor to read nr_sects Chaitanya Kulkarni
2019-07-02 17:42 ` [PATCH V3 1/9] block: add a helper function to read nr_setcs Chaitanya Kulkarni
2019-07-03  0:19   ` Minwoo Im
2019-07-03 15:03   ` Bart Van Assche
2019-07-02 17:42 ` [PATCH V3 2/9] blk-zoned: update blkdev_nr_zones() with helper Chaitanya Kulkarni
2019-07-03  0:20   ` Minwoo Im
2019-07-02 17:42 ` [PATCH V3 3/9] blk-zoned: update blkdev_report_zone() " Chaitanya Kulkarni
2019-07-03  0:21   ` Minwoo Im
2019-07-02 17:42 ` [PATCH V3 4/9] blk-zoned: update blkdev_reset_zones() " Chaitanya Kulkarni
2019-07-03  0:23   ` Minwoo Im
2019-07-03  2:29     ` Chaitanya Kulkarni
2019-07-03  5:25       ` Minwoo Im
2019-07-02 17:42 ` [PATCH V3 5/9] bcache: update cached_dev_init() " Chaitanya Kulkarni
2019-07-02 17:42 ` [PATCH V3 6/9] f2fs: use helper in init_blkz_info() Chaitanya Kulkarni
2019-07-02 17:42 ` [PATCH V3 7/9] blktrace: use helper in blk_trace_setup_lba() Chaitanya Kulkarni
2019-07-02 17:42 ` [COMPILE TEST ONLY PATCH V3 8/9] target/pscsi: use helper in pscsi_get_blocks() Chaitanya Kulkarni
2019-07-02 17:42 ` [COMPILE TEST ONLY PATCH V3 9/9] xen/blkback: use helper in vbd_sz() Chaitanya Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).