Re: [PATCH 35/70] NFSd: Slight cleanup of find_stateid()

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

 



On Sat, 2014-04-19 at 07:41 -0700, Christoph Hellwig wrote:
> > +static struct nfs4_stid *find_stateid_locked(struct nfs4_client *cl, stateid_t *t)
> >  {
> >  	struct nfs4_stid *ret;
> >  
> > -	spin_lock(&cl->cl_lock);
> >  	ret = idr_find(&cl->cl_stateids, t->si_opaque.so_id);
> > -	spin_unlock(&cl->cl_lock);
> >  	if (!ret || !ret->sc_type)
> >  		return NULL;
> 
> Just curious, how can !ret->sc_type happen?
> 

At least for open and lock stateids, the ret->sc_type field isn't
initialised until nfsd4_process_open2() and alloc_init_lock_stateid() so
there is a small window where they are visible to the idr tree while not
being fully initialised.

-- 
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@xxxxxxxxxxxxxxx


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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