[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMV7Lq7DM-Kg_cK-w3PhBR8CoH=RkZ3D7s18ByMkMLMYPB0Lwg@mail.gmail.com>
Date: Sun, 24 Aug 2025 21:59:39 +0530
From: Abinash Singh <abinashsinghlalotra@...il.com>
To: Bart Van Assche <bvanassche@....org>
Cc: martin.petersen@...cle.com, James.Bottomley@...senpartnership.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org, dlemoal@...nel.org
Subject: Re: [PATCH v8 1/2] scsi: sd: Fix build warning in sd_revalidate_disk()
On Sat, Aug 23, 2025 at 1:17 AM Bart Van Assche <bvanassche@....org> wrote:
>
> > > On 8/20/25 7:45 AM, Abinash Singh wrote:
> > > + lim = kmalloc(sizeof(*lim), GFP_KERNEL);
> >> + if (!lim) {
> > >+ sd_printk(KERN_WARNING, sdkp,
> > >+ "sd_revalidate_disk: Disk limit allocation failure.\n");
> > >+ goto out;
> > >+ }
>
> > From Documentation/process/coding-style.rst:
>
> > These generic allocation functions all emit a stack dump on failure when
> >used
> >without __GFP_NOWARN so there is no use in emitting an additional failure
> >message when NULL is returned.
>
> > Has this example perhaps been followed? I think it is safe to remove
> > this sd_printk() statement.
>
check patch emits this warning .
WARNING: Possible unnecessary 'out of memory' message
#52: FILE: drivers/scsi/sd.c:3716:
+ if (!lim) {
+ sd_printk(KERN_WARNING, sdkp,
So I think Bart is right about it . I will send v9 with these changes.
>
> > Otherwise this patch looks good to me.
In which patch should i remove this sd_printk statement . As it is
there already.
>> buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
> > if (!buffer) {
> > sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory "
If we have to go with a seperate patch for this then v9 will have
three patches:
1) Fix
unnecessary 'out of memory' message in sd_revalidate_disk()
2) Fix
build warning in sd_revalidate_disk()
3) Make
sd_revalidat_disk() return void
>
> < Thanks,
> < Bart.
Thanks
On Sat, Aug 23, 2025 at 1:17 AM Bart Van Assche <bvanassche@....org> wrote:
>
> On 8/20/25 7:45 AM, Abinash Singh wrote:
> > + lim = kmalloc(sizeof(*lim), GFP_KERNEL);
> > + if (!lim) {
> > + sd_printk(KERN_WARNING, sdkp,
> > + "sd_revalidate_disk: Disk limit allocation failure.\n");
> > + goto out;
> > + }
>
> From Documentation/process/coding-style.rst:
>
> These generic allocation functions all emit a stack dump on failure when
> used
> without __GFP_NOWARN so there is no use in emitting an additional failure
> message when NULL is returned.
>
> > buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
> > if (!buffer) {
> > sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory "
>
> Has this example perhaps been followed? I think it is safe to remove
> this sd_printk() statement.
>
> Otherwise this patch looks good to me.
>
> Thanks,
>
> Bart.
Powered by blists - more mailing lists