RE: [PATCH 1/5] scsi: fnic: use GFP_ATOMIC for VLAN alloc under spinlock
"Karan Tilak Kumar (kartilak)" <[email protected]> Fri, 31 Jul 2026 07:50:16 +0000
| Newsgroups | org.kernel.vger.linux-scsi,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <SJ0PR11MB58969BAB1D8A2103C50C7D6AC3C82@SJ0PR11MB5896.namprd11.prod.outlook.com> |
On Friday, July 31, 2026 1:08 PM, Linkai Gong <[email protected]> wrote= : > > fnic_fcoe_process_vlan_resp() allocates a VLAN descriptor with > kzalloc_obj() (default GFP_KERNEL) while holding vlans_lock via > spin_lock_irqsave(). GFP_KERNEL may sleep, which is not allowed in > this atomic context and can trigger a sleeping-from-invalid-context > warning or deadlock. > > Pass GFP_ATOMIC so the allocation is safe under the IRQ-safe spinlock. > > Fixes: 098585aa8aca ("scsi: fnic: Add and integrate support for FIP") > Cc: [email protected] > Signed-off-by: Linkai Gong <[email protected]> > --- > drivers/scsi/fnic/fip.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/fnic/fip.c b/drivers/scsi/fnic/fip.c > index 132f00512ee1..28c9861b6501 100644 > --- a/drivers/scsi/fnic/fip.c > +++ b/drivers/scsi/fnic/fip.c > @@ -139,7 +139,7 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, s= truct fip_header *fiph) > FNIC_FIP_DBG(KERN_INFO, fnic->host, > fnic->fnic_num, > "process_vlan_resp: FIP VLAN %d\n", vid); > - vlan =3D kzalloc_obj(*vlan); > + vlan =3D kzalloc_obj(*vlan, GFP_ATOMIC); > > if (!vlan) { > /* retry from timer */ > -- > 2.25.1 > > The change looks good. Thanks for the change. Reviewed-by: Karan Tilak Kumar <[email protected]> Regards, Karan