[PATCH v10 0/3] scsi: sd: Cleanups and warning fixes in sd_revalidate_disk()

Abinash Singh posted 3 patches 1 month, 1 week ago
drivers/scsi/sd.c | 58 ++++++++++++++++++++++++-----------------------
1 file changed, 30 insertions(+), 28 deletions(-)
[PATCH v10 0/3] scsi: sd: Cleanups and warning fixes in sd_revalidate_disk()
Posted by Abinash Singh 1 month, 1 week ago
Hi all,

This v10 series addresses a build warning and does minor cleanups in
sd_revalidate_disk().

Changes since v9:
  - Moved the build warning fix to patch 1/3 so that it can be
    easily backported.
  - Added "Fixes:" and "Cc: stable" tags to patch 1/3 as suggested
    by Damien.
  - Moved the redundant printk removal to patch 2/3, since it is
    not a backport candidate and also removed "fixes:" tag from it as 
    it is not a bug.
  - Incorporated Reviewed-by tags from  Damien.
  - Updated changelogs accordingly.

Summary of changes:
  1. Fix excessive stack usage warning in sd_revalidate_disk() by
     replacing a large local struct with a kmalloc() allocation.
  2. Remove a redundant "out of memory" printk after kmalloc()
     failure. The page allocator already reports allocation failures.
  3. Make sd_revalidate_disk() return void, since its return value
     is unused by all callers.

Thanks for the reviews and guidance.

Abinash

Abinash Singh (3):
  scsi: sd: Fix build warning in sd_revalidate_disk()
  scsi: sd: Remove redundant printk after kmalloc failure
  scsi: sd: make sd_revalidate_disk() return void

 drivers/scsi/sd.c | 58 ++++++++++++++++++++++++-----------------------
 1 file changed, 30 insertions(+), 28 deletions(-)

-- 
2.43.0
Re: [PATCH v10 0/3] scsi: sd: Cleanups and warning fixes in sd_revalidate_disk()
Posted by Martin K. Petersen 3 weeks, 2 days ago
On Tue, 26 Aug 2025 00:09:37 +0530, Abinash Singh wrote:

> This v10 series addresses a build warning and does minor cleanups in
> sd_revalidate_disk().
> 
> Changes since v9:
>   - Moved the build warning fix to patch 1/3 so that it can be
>     easily backported.
>   - Added "Fixes:" and "Cc: stable" tags to patch 1/3 as suggested
>     by Damien.
>   - Moved the redundant printk removal to patch 2/3, since it is
>     not a backport candidate and also removed "fixes:" tag from it as
>     it is not a bug.
>   - Incorporated Reviewed-by tags from  Damien.
>   - Updated changelogs accordingly.
> 
> [...]

Applied to 6.18/scsi-queue, thanks!

[1/3] scsi: sd: Fix build warning in sd_revalidate_disk()
      https://git.kernel.org/mkp/scsi/c/b5f717b31b5e
[2/3] scsi: sd: Remove redundant printk after kmalloc failure
      https://git.kernel.org/mkp/scsi/c/d842da6924a9
[3/3] scsi: sd: make sd_revalidate_disk() return void
      https://git.kernel.org/mkp/scsi/c/11e6fb38bde5

-- 
Martin K. Petersen
Re: [PATCH v10 0/3] scsi: sd: Cleanups and warning fixes in sd_revalidate_disk()
Posted by Martin K. Petersen 1 month ago
Abinash,

> This v10 series addresses a build warning and does minor cleanups in
> sd_revalidate_disk().

Applied to 6.18/scsi-staging, thanks!

-- 
Martin K. Petersen