RE: [PATCH -next] pnfs: Use GFP_ATOMIC under spin lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Subject: Re: [PATCH -next] pnfs: Use GFP_ATOMIC under spin lock
> 
> On Wed, 2018-06-06 at 02:02 +0000, Wei Yongjun wrote:
> > A spin lock is taken here so we should use GFP_ATOMIC.
> >
> > Fixes: 2409a976a299 ("pnfs: Add LAYOUTGET to OPEN of a new file")
> > Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> > ---
> >  fs/nfs/pnfs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> > index d93942f..1ff1998 100644
> > --- a/fs/nfs/pnfs.c
> > +++ b/fs/nfs/pnfs.c
> > @@ -2009,7 +2009,7 @@ struct pnfs_layout_segment *
> >  	struct pnfs_layout_hdr *lo;
> >
> >  	spin_lock(&ino->i_lock);
> > -	lo = pnfs_find_alloc_layout(ino, ctx, GFP_KERNEL);
> > +	lo = pnfs_find_alloc_layout(ino, ctx, GFP_ATOMIC);
> >  	if (!lo)
> >  		goto out_unlock;
> >  	if (!test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags))
> >
> Hi Wei,
> 
> The ino->i_lock spinlock is temporarily dropped inside
> pnfs_find_alloc_layout() if we have to perform an allocation, so the
> existing code should be correct.

Hi Trond,

Yes, you are right, thanks for review.

Regards

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux