* [PATCH] block: Fix BLKRRPART regression
@ 2024-04-05 1:42 Saranya Muruganandam
2024-04-05 1:44 ` kernel test robot
2024-04-05 6:53 ` Christoph Hellwig
0 siblings, 2 replies; 12+ messages in thread
From: Saranya Muruganandam @ 2024-04-05 1:42 UTC (permalink / raw
To: Jens Axboe, Tejun Heo, Yu Kuai, Christoph Hellwig, stable
Cc: linux-block, linux-kernel, Saranya Muruganandam
The BLKRRPART ioctl used to report errors such as EIO before we changed
the blkdev_reread_part() logic.
Lets add a flag and capture the errors returned by bdev_disk_changed()
when the flag is set. Setting this flag for the BLKRRPART path when we
want the errors to be reported when rereading partitions on the disk.
Link: https://lore.kernel.org/all/20240320015134.GA14267@lst.de/
Suggested-by: Christoph Hellwig <hch@lst.de>
Tested: Tested by simulating failure to the block device and will
propose a new test to blktests.
Fixes: 4601b4b130de ("block: reopen the device in blkdev_reread_part")
Reported-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Change-Id: Idf3d97390ed78061556f8468d10d6cab24ae20b1
---
block/bdev.c | 31 +++++++++++++++++++++----------
block/ioctl.c | 3 ++-
include/linux/blkdev.h | 3 +++
3 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/block/bdev.c b/block/bdev.c
index 77fa77cd29bee..71478f8865546 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -632,6 +632,14 @@ static void blkdev_flush_mapping(struct block_device *bdev)
bdev_write_inode(bdev);
}
+static void blkdev_put_whole(struct block_device *bdev)
+{
+ if (atomic_dec_and_test(&bdev->bd_openers))
+ blkdev_flush_mapping(bdev);
+ if (bdev->bd_disk->fops->release)
+ bdev->bd_disk->fops->release(bdev->bd_disk);
+}
+
static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
{
struct gendisk *disk = bdev->bd_disk;
@@ -650,18 +658,21 @@ static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
if (!atomic_read(&bdev->bd_openers))
set_init_blocksize(bdev);
- if (test_bit(GD_NEED_PART_SCAN, &disk->state))
- bdev_disk_changed(disk, false);
atomic_inc(&bdev->bd_openers);
- return 0;
-}
-static void blkdev_put_whole(struct block_device *bdev)
-{
- if (atomic_dec_and_test(&bdev->bd_openers))
- blkdev_flush_mapping(bdev);
- if (bdev->bd_disk->fops->release)
- bdev->bd_disk->fops->release(bdev->bd_disk);
+ if (test_bit(GD_NEED_PART_SCAN, &disk->state)) {
+ /*
+ * Only return scanning errors if we are called from contexts
+ * that explicitly want them, e.g. the BLKRRPART ioctl.
+ */
+ ret = bdev_disk_changed(disk, false);
+ if (ret && (mode & BLK_OPEN_STRICT_SCAN)) {
+ blkdev_put_whole(bdev);
+ return ret;
+ }
+ }
+
+ return 0;
}
static int blkdev_get_part(struct block_device *part, blk_mode_t mode)
diff --git a/block/ioctl.c b/block/ioctl.c
index aa46f3761c3ed..e8d72d9f327fd 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -557,7 +557,8 @@ static int blkdev_common_ioctl(struct block_device *bdev, blk_mode_t mode,
return -EACCES;
if (bdev_is_partition(bdev))
return -EINVAL;
- return disk_scan_partitions(bdev->bd_disk, mode);
+ return disk_scan_partitions(bdev->bd_disk,
+ mode | BLK_OPEN_STRICT_SCAN);
case BLKTRACESTART:
case BLKTRACESTOP:
case BLKTRACETEARDOWN:
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 01983eece8f2a..d0104dc839b0d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -151,6 +151,9 @@ struct access_rules_head {
int max_rules;
};
+/* return partition scanning errors */
+#define BLK_OPEN_STRICT_SCAN ((__force blk_mode_t)(1 << 5))
+
struct gendisk {
/*
* major/first_minor/minors should not be set by any new driver, the
--
2.44.0.478.gd926399ef9-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-05 1:42 [PATCH] block: Fix BLKRRPART regression Saranya Muruganandam
@ 2024-04-05 1:44 ` kernel test robot
2024-04-05 6:53 ` Christoph Hellwig
1 sibling, 0 replies; 12+ messages in thread
From: kernel test robot @ 2024-04-05 1:44 UTC (permalink / raw
To: Saranya Muruganandam; +Cc: stable, oe-kbuild-all
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH] block: Fix BLKRRPART regression
Link: https://lore.kernel.org/stable/20240405014253.748627-1-saranyamohan%40google.com
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-05 1:42 [PATCH] block: Fix BLKRRPART regression Saranya Muruganandam
2024-04-05 1:44 ` kernel test robot
@ 2024-04-05 6:53 ` Christoph Hellwig
2024-04-06 4:46 ` Saranya Muruganandam
1 sibling, 1 reply; 12+ messages in thread
From: Christoph Hellwig @ 2024-04-05 6:53 UTC (permalink / raw
To: Saranya Muruganandam
Cc: Jens Axboe, Tejun Heo, Yu Kuai, Christoph Hellwig, stable,
linux-block, linux-kernel
Hmm, what is this? It looks kinda like the patch I sent out, but with
the flag moved into an odd place?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] block: Fix BLKRRPART regression
2024-04-05 6:53 ` Christoph Hellwig
@ 2024-04-06 4:46 ` Saranya Muruganandam
2024-04-06 4:48 ` kernel test robot
2024-04-10 5:04 ` Shinichiro Kawasaki
0 siblings, 2 replies; 12+ messages in thread
From: Saranya Muruganandam @ 2024-04-06 4:46 UTC (permalink / raw
To: hch; +Cc: axboe, linux-block, linux-kernel, saranyamohan, stable, tj,
yukuai1
The BLKRRPART ioctl used to report errors such as EIO before we changed
the blkdev_reread_part() logic.
Lets add a flag and capture the errors returned by bdev_disk_changed()
when the flag is set. Setting this flag for the BLKRRPART path when we
want the errors to be reported when rereading partitions on the disk.
Link: https://lore.kernel.org/all/20240320015134.GA14267@lst.de/
Suggested-by: Christoph Hellwig <hch@lst.de>
Tested: Tested by simulating failure to the block device and will
propose a new test to blktests.
Fixes: 4601b4b130de ("block: reopen the device in blkdev_reread_part")
Reported-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Change-Id: Idf3d97390ed78061556f8468d10d6cab24ae20b1
---
block/bdev.c | 29 +++++++++++++++++++----------
block/ioctl.c | 3 ++-
include/linux/blkdev.h | 2 ++
3 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/block/bdev.c b/block/bdev.c
index 7a5f611c3d2e3..42940bced33bb 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -652,6 +652,14 @@ static void blkdev_flush_mapping(struct block_device *bdev)
bdev_write_inode(bdev);
}
+static void blkdev_put_whole(struct block_device *bdev)
+{
+ if (atomic_dec_and_test(&bdev->bd_openers))
+ blkdev_flush_mapping(bdev);
+ if (bdev->bd_disk->fops->release)
+ bdev->bd_disk->fops->release(bdev->bd_disk);
+}
+
static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
{
struct gendisk *disk = bdev->bd_disk;
@@ -670,20 +678,21 @@ static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
if (!atomic_read(&bdev->bd_openers))
set_init_blocksize(bdev);
- if (test_bit(GD_NEED_PART_SCAN, &disk->state))
- bdev_disk_changed(disk, false);
atomic_inc(&bdev->bd_openers);
+ if (test_bit(GD_NEED_PART_SCAN, &disk->state)) {
+ /*
+ * Only return scanning errors if we are called from conexts
+ * that explicitly want them, e.g. the BLKRRPART ioctl.
+ */
+ ret = bdev_disk_changed(disk, false);
+ if (ret && (mode & BLK_OPEN_STRICT_SCAN)) {
+ blkdev_put_whole(bdev);
+ return ret;
+ }
+ }
return 0;
}
-static void blkdev_put_whole(struct block_device *bdev)
-{
- if (atomic_dec_and_test(&bdev->bd_openers))
- blkdev_flush_mapping(bdev);
- if (bdev->bd_disk->fops->release)
- bdev->bd_disk->fops->release(bdev->bd_disk);
-}
-
static int blkdev_get_part(struct block_device *part, blk_mode_t mode)
{
struct gendisk *disk = part->bd_disk;
diff --git a/block/ioctl.c b/block/ioctl.c
index 0c76137adcaaa..128f503828cee 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -562,7 +562,8 @@ static int blkdev_common_ioctl(struct block_device *bdev, blk_mode_t mode,
return -EACCES;
if (bdev_is_partition(bdev))
return -EINVAL;
- return disk_scan_partitions(bdev->bd_disk, mode);
+ return disk_scan_partitions(bdev->bd_disk,
+ mode | BLK_OPEN_STRICT_SCAN);
case BLKTRACESTART:
case BLKTRACESTOP:
case BLKTRACETEARDOWN:
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index c3e8f7cf96be9..3ed5e03109c29 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -128,6 +128,8 @@ typedef unsigned int __bitwise blk_mode_t;
#define BLK_OPEN_WRITE_IOCTL ((__force blk_mode_t)(1 << 4))
/* open is exclusive wrt all other BLK_OPEN_WRITE opens to the device */
#define BLK_OPEN_RESTRICT_WRITES ((__force blk_mode_t)(1 << 5))
+/* return partition scanning errors */
+#define BLK_OPEN_STRICT_SCAN ((__force blk_mode_t)(1 << 5))
struct gendisk {
/*
--
2.44.0.478.gd926399ef9-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-06 4:46 ` Saranya Muruganandam
@ 2024-04-06 4:48 ` kernel test robot
2024-04-10 5:04 ` Shinichiro Kawasaki
1 sibling, 0 replies; 12+ messages in thread
From: kernel test robot @ 2024-04-06 4:48 UTC (permalink / raw
To: Saranya Muruganandam; +Cc: stable, oe-kbuild-all
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH] block: Fix BLKRRPART regression
Link: https://lore.kernel.org/stable/20240406044643.2475360-1-saranyamohan%40google.com
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-06 4:46 ` Saranya Muruganandam
2024-04-06 4:48 ` kernel test robot
@ 2024-04-10 5:04 ` Shinichiro Kawasaki
2024-04-10 23:39 ` Saranya Muruganandam
1 sibling, 1 reply; 12+ messages in thread
From: Shinichiro Kawasaki @ 2024-04-10 5:04 UTC (permalink / raw
To: Saranya Muruganandam
Cc: hch@lst.de, axboe@kernel.dk, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
tj@kernel.org, yukuai1@huaweicloud.com
Saranya, while I evaluate the corresponding patch for blktests, I found a
weird behavior, and had a chance to look into this patch. Please find my
comments in line.
On Apr 06, 2024 / 04:46, Saranya Muruganandam wrote:
> The BLKRRPART ioctl used to report errors such as EIO before we changed
> the blkdev_reread_part() logic.
>
> Lets add a flag and capture the errors returned by bdev_disk_changed()
> when the flag is set. Setting this flag for the BLKRRPART path when we
> want the errors to be reported when rereading partitions on the disk.
Documentation/process/submitting-patches.rst guides to describe changes in
imperative mood, then the sentences above can be rephrased like,
Add a flag...
Set this flag...
>
> Link: https://lore.kernel.org/all/20240320015134.GA14267@lst.de/
> Suggested-by: Christoph Hellwig <hch@lst.de>
> Tested: Tested by simulating failure to the block device and will
> propose a new test to blktests.
> Fixes: 4601b4b130de ("block: reopen the device in blkdev_reread_part")
> Reported-by: Saranya Muruganandam <saranyamohan@google.com>
> Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
>
> Change-Id: Idf3d97390ed78061556f8468d10d6cab24ae20b1
> ---
> block/bdev.c | 29 +++++++++++++++++++----------
> block/ioctl.c | 3 ++-
> include/linux/blkdev.h | 2 ++
> 3 files changed, 23 insertions(+), 11 deletions(-)
>
> diff --git a/block/bdev.c b/block/bdev.c
> index 7a5f611c3d2e3..42940bced33bb 100644
> --- a/block/bdev.c
> +++ b/block/bdev.c
> @@ -652,6 +652,14 @@ static void blkdev_flush_mapping(struct block_device *bdev)
> bdev_write_inode(bdev);
> }
>
> +static void blkdev_put_whole(struct block_device *bdev)
> +{
> + if (atomic_dec_and_test(&bdev->bd_openers))
> + blkdev_flush_mapping(bdev);
> + if (bdev->bd_disk->fops->release)
> + bdev->bd_disk->fops->release(bdev->bd_disk);
> +}
> +
> static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
> {
> struct gendisk *disk = bdev->bd_disk;
> @@ -670,20 +678,21 @@ static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
>
> if (!atomic_read(&bdev->bd_openers))
> set_init_blocksize(bdev);
> - if (test_bit(GD_NEED_PART_SCAN, &disk->state))
> - bdev_disk_changed(disk, false);
> atomic_inc(&bdev->bd_openers);
> + if (test_bit(GD_NEED_PART_SCAN, &disk->state)) {
> + /*
> + * Only return scanning errors if we are called from conexts
s/conexts/contexts/
> + * that explicitly want them, e.g. the BLKRRPART ioctl.
> + */
> + ret = bdev_disk_changed(disk, false);
> + if (ret && (mode & BLK_OPEN_STRICT_SCAN)) {
> + blkdev_put_whole(bdev);
> + return ret;
> + }
> + }
> return 0;
> }
>
> -static void blkdev_put_whole(struct block_device *bdev)
> -{
> - if (atomic_dec_and_test(&bdev->bd_openers))
> - blkdev_flush_mapping(bdev);
> - if (bdev->bd_disk->fops->release)
> - bdev->bd_disk->fops->release(bdev->bd_disk);
> -}
> -
> static int blkdev_get_part(struct block_device *part, blk_mode_t mode)
> {
> struct gendisk *disk = part->bd_disk;
> diff --git a/block/ioctl.c b/block/ioctl.c
> index 0c76137adcaaa..128f503828cee 100644
> --- a/block/ioctl.c
> +++ b/block/ioctl.c
> @@ -562,7 +562,8 @@ static int blkdev_common_ioctl(struct block_device *bdev, blk_mode_t mode,
> return -EACCES;
> if (bdev_is_partition(bdev))
> return -EINVAL;
> - return disk_scan_partitions(bdev->bd_disk, mode);
> + return disk_scan_partitions(bdev->bd_disk,
> + mode | BLK_OPEN_STRICT_SCAN);
> case BLKTRACESTART:
> case BLKTRACESTOP:
> case BLKTRACETEARDOWN:
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index c3e8f7cf96be9..3ed5e03109c29 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -128,6 +128,8 @@ typedef unsigned int __bitwise blk_mode_t;
> #define BLK_OPEN_WRITE_IOCTL ((__force blk_mode_t)(1 << 4))
> /* open is exclusive wrt all other BLK_OPEN_WRITE opens to the device */
> #define BLK_OPEN_RESTRICT_WRITES ((__force blk_mode_t)(1 << 5))
> +/* return partition scanning errors */
> +#define BLK_OPEN_STRICT_SCAN ((__force blk_mode_t)(1 << 5))
The line above assigns the same number for BLK_OPEN_STRICT_SCAN and
BLK_OPEN_RESTRICT_WRITES, then blockdev --rereadpt fails with EINVAL,
not EIO. I modified it to "1 << 6", then it looks working good.
>
> struct gendisk {
> /*
> --
> 2.44.0.478.gd926399ef9-goog
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] block: Fix BLKRRPART regression
2024-04-10 5:04 ` Shinichiro Kawasaki
@ 2024-04-10 23:39 ` Saranya Muruganandam
2024-04-10 23:40 ` kernel test robot
2024-04-12 7:12 ` Shinichiro Kawasaki
0 siblings, 2 replies; 12+ messages in thread
From: Saranya Muruganandam @ 2024-04-10 23:39 UTC (permalink / raw
To: shinichiro.kawasaki
Cc: axboe, hch, linux-block, linux-kernel, saranyamohan, stable, tj,
yukuai1
The BLKRRPART ioctl used to report errors such as EIO before we changed
the blkdev_reread_part() logic.
Add a flag and capture the errors returned by bdev_disk_changed()
when the flag is set. Set this flag for the BLKRRPART path when we
want the errors to be reported when rereading partitions on the disk.
Link: https://lore.kernel.org/all/20240320015134.GA14267@lst.de/
Suggested-by: Christoph Hellwig <hch@lst.de>
Tested: Tested by simulating failure to the block device and will
propose a new test to blktests.
Fixes: 4601b4b130de ("block: reopen the device in blkdev_reread_part")
Reported-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Change-Id: Idf3d97390ed78061556f8468d10d6cab24ae20b1
---
block/bdev.c | 29 +++++++++++++++++++----------
block/ioctl.c | 3 ++-
include/linux/blkdev.h | 2 ++
3 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/block/bdev.c b/block/bdev.c
index 7a5f611c3d2e3..cea51dca87531 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -652,6 +652,14 @@ static void blkdev_flush_mapping(struct block_device *bdev)
bdev_write_inode(bdev);
}
+static void blkdev_put_whole(struct block_device *bdev)
+{
+ if (atomic_dec_and_test(&bdev->bd_openers))
+ blkdev_flush_mapping(bdev);
+ if (bdev->bd_disk->fops->release)
+ bdev->bd_disk->fops->release(bdev->bd_disk);
+}
+
static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
{
struct gendisk *disk = bdev->bd_disk;
@@ -670,20 +678,21 @@ static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
if (!atomic_read(&bdev->bd_openers))
set_init_blocksize(bdev);
- if (test_bit(GD_NEED_PART_SCAN, &disk->state))
- bdev_disk_changed(disk, false);
atomic_inc(&bdev->bd_openers);
+ if (test_bit(GD_NEED_PART_SCAN, &disk->state)) {
+ /*
+ * Only return scanning errors if we are called from contexts
+ * that explicitly want them, e.g. the BLKRRPART ioctl.
+ */
+ ret = bdev_disk_changed(disk, false);
+ if (ret && (mode & BLK_OPEN_STRICT_SCAN)) {
+ blkdev_put_whole(bdev);
+ return ret;
+ }
+ }
return 0;
}
-static void blkdev_put_whole(struct block_device *bdev)
-{
- if (atomic_dec_and_test(&bdev->bd_openers))
- blkdev_flush_mapping(bdev);
- if (bdev->bd_disk->fops->release)
- bdev->bd_disk->fops->release(bdev->bd_disk);
-}
-
static int blkdev_get_part(struct block_device *part, blk_mode_t mode)
{
struct gendisk *disk = part->bd_disk;
diff --git a/block/ioctl.c b/block/ioctl.c
index 0c76137adcaaa..128f503828cee 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -562,7 +562,8 @@ static int blkdev_common_ioctl(struct block_device *bdev, blk_mode_t mode,
return -EACCES;
if (bdev_is_partition(bdev))
return -EINVAL;
- return disk_scan_partitions(bdev->bd_disk, mode);
+ return disk_scan_partitions(bdev->bd_disk,
+ mode | BLK_OPEN_STRICT_SCAN);
case BLKTRACESTART:
case BLKTRACESTOP:
case BLKTRACETEARDOWN:
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index c3e8f7cf96be9..d16320852c4ba 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -128,6 +128,8 @@ typedef unsigned int __bitwise blk_mode_t;
#define BLK_OPEN_WRITE_IOCTL ((__force blk_mode_t)(1 << 4))
/* open is exclusive wrt all other BLK_OPEN_WRITE opens to the device */
#define BLK_OPEN_RESTRICT_WRITES ((__force blk_mode_t)(1 << 5))
+/* return partition scanning errors */
+#define BLK_OPEN_STRICT_SCAN ((__force blk_mode_t)(1 << 6))
struct gendisk {
/*
--
2.44.0.683.g7961c838ac-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-10 23:39 ` Saranya Muruganandam
@ 2024-04-10 23:40 ` kernel test robot
2024-04-12 7:12 ` Shinichiro Kawasaki
1 sibling, 0 replies; 12+ messages in thread
From: kernel test robot @ 2024-04-10 23:40 UTC (permalink / raw
To: Saranya Muruganandam; +Cc: stable, oe-kbuild-all
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH] block: Fix BLKRRPART regression
Link: https://lore.kernel.org/stable/20240410233932.256871-1-saranyamohan%40google.com
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-10 23:39 ` Saranya Muruganandam
2024-04-10 23:40 ` kernel test robot
@ 2024-04-12 7:12 ` Shinichiro Kawasaki
2024-04-16 9:10 ` Chaitanya Kulkarni
1 sibling, 1 reply; 12+ messages in thread
From: Shinichiro Kawasaki @ 2024-04-12 7:12 UTC (permalink / raw
To: Saranya Muruganandam
Cc: axboe@kernel.dk, hch@lst.de, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
tj@kernel.org, yukuai1@huaweicloud.com
On Apr 10, 2024 / 23:39, Saranya Muruganandam wrote:
> The BLKRRPART ioctl used to report errors such as EIO before we changed
> the blkdev_reread_part() logic.
>
> Add a flag and capture the errors returned by bdev_disk_changed()
> when the flag is set. Set this flag for the BLKRRPART path when we
> want the errors to be reported when rereading partitions on the disk.
>
> Link: https://lore.kernel.org/all/20240320015134.GA14267@lst.de/
> Suggested-by: Christoph Hellwig <hch@lst.de>
> Tested: Tested by simulating failure to the block device and will
> propose a new test to blktests.
> Fixes: 4601b4b130de ("block: reopen the device in blkdev_reread_part")
> Reported-by: Saranya Muruganandam <saranyamohan@google.com>
> Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
The change looks good to me. I also confirmed the fix with the new,
corresponding blktests test case.
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-12 7:12 ` Shinichiro Kawasaki
@ 2024-04-16 9:10 ` Chaitanya Kulkarni
2024-04-16 10:46 ` Shinichiro Kawasaki
2024-04-16 15:02 ` hch
0 siblings, 2 replies; 12+ messages in thread
From: Chaitanya Kulkarni @ 2024-04-16 9:10 UTC (permalink / raw
To: hch@lst.de, Saranya Muruganandam
Cc: axboe@kernel.dk, Shinichiro Kawasaki, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
tj@kernel.org, yukuai1@huaweicloud.com
On 4/12/2024 12:12 AM, Shinichiro Kawasaki wrote:
> On Apr 10, 2024 / 23:39, Saranya Muruganandam wrote:
>> The BLKRRPART ioctl used to report errors such as EIO before we changed
>> the blkdev_reread_part() logic.
>>
>> Add a flag and capture the errors returned by bdev_disk_changed()
>> when the flag is set. Set this flag for the BLKRRPART path when we
>> want the errors to be reported when rereading partitions on the disk.
>>
>> Link: https://lore.kernel.org/all/20240320015134.GA14267@lst.de/
>> Suggested-by: Christoph Hellwig <hch@lst.de>
>> Tested: Tested by simulating failure to the block device and will
>> propose a new test to blktests.
>> Fixes: 4601b4b130de ("block: reopen the device in blkdev_reread_part")
>> Reported-by: Saranya Muruganandam <saranyamohan@google.com>
>> Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
>
> The change looks good to me. I also confirmed the fix with the new,
> corresponding blktests test case.
>
> Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
which patch is the final one ? Is it this one or the one posted with
title :-
"block: propagate partition scanning errors to the BLKRRPART ioctl" ?
Please clarify so I can make sure to run some tests at my end.
-ck
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-16 9:10 ` Chaitanya Kulkarni
@ 2024-04-16 10:46 ` Shinichiro Kawasaki
2024-04-16 15:02 ` hch
1 sibling, 0 replies; 12+ messages in thread
From: Shinichiro Kawasaki @ 2024-04-16 10:46 UTC (permalink / raw
To: Chaitanya Kulkarni
Cc: hch@lst.de, Saranya Muruganandam, axboe@kernel.dk,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, tj@kernel.org, yukuai1@huaweicloud.com
On Apr 16, 2024 / 09:10, Chaitanya Kulkarni wrote:
> On 4/12/2024 12:12 AM, Shinichiro Kawasaki wrote:
> > On Apr 10, 2024 / 23:39, Saranya Muruganandam wrote:
> >> The BLKRRPART ioctl used to report errors such as EIO before we changed
> >> the blkdev_reread_part() logic.
> >>
> >> Add a flag and capture the errors returned by bdev_disk_changed()
> >> when the flag is set. Set this flag for the BLKRRPART path when we
> >> want the errors to be reported when rereading partitions on the disk.
> >>
> >> Link: https://lore.kernel.org/all/20240320015134.GA14267@lst.de/
> >> Suggested-by: Christoph Hellwig <hch@lst.de>
> >> Tested: Tested by simulating failure to the block device and will
> >> propose a new test to blktests.
> >> Fixes: 4601b4b130de ("block: reopen the device in blkdev_reread_part")
> >> Reported-by: Saranya Muruganandam <saranyamohan@google.com>
> >> Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
> >
> > The change looks good to me. I also confirmed the fix with the new,
> > corresponding blktests test case.
> >
> > Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> > Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
>
> which patch is the final one ? Is it this one or the one posted with
> title :-
>
> "block: propagate partition scanning errors to the BLKRRPART ioctl" ?
>
> Please clarify so I can make sure to run some tests at my end.
The patch I reviewed and tested is the one that Saranya reflected my comment.
It is found here:
https://lore.kernel.org/linux-block/20240410233932.256871-1-saranyamohan@google.com/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] block: Fix BLKRRPART regression
2024-04-16 9:10 ` Chaitanya Kulkarni
2024-04-16 10:46 ` Shinichiro Kawasaki
@ 2024-04-16 15:02 ` hch
1 sibling, 0 replies; 12+ messages in thread
From: hch @ 2024-04-16 15:02 UTC (permalink / raw
To: Chaitanya Kulkarni
Cc: hch@lst.de, Saranya Muruganandam, axboe@kernel.dk,
Shinichiro Kawasaki, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
tj@kernel.org, yukuai1@huaweicloud.com
On Tue, Apr 16, 2024 at 09:10:10AM +0000, Chaitanya Kulkarni wrote:
> which patch is the final one ? Is it this one or the one posted with
> title :-
The correct patch is still the one I sent on Marc 28th and not any
version that reattributes the changes and moves the flag into a totally
weird place.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-04-16 15:02 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-05 1:42 [PATCH] block: Fix BLKRRPART regression Saranya Muruganandam
2024-04-05 1:44 ` kernel test robot
2024-04-05 6:53 ` Christoph Hellwig
2024-04-06 4:46 ` Saranya Muruganandam
2024-04-06 4:48 ` kernel test robot
2024-04-10 5:04 ` Shinichiro Kawasaki
2024-04-10 23:39 ` Saranya Muruganandam
2024-04-10 23:40 ` kernel test robot
2024-04-12 7:12 ` Shinichiro Kawasaki
2024-04-16 9:10 ` Chaitanya Kulkarni
2024-04-16 10:46 ` Shinichiro Kawasaki
2024-04-16 15:02 ` hch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.