[pnfs] [PATCH 14/37] pnfs: initialize pnfs_layout_type generic fields in pnfs layer

Benny Halevy bhalevy at panasas.com
Thu Jan 3 03:54:28 EST 2008


On Jan. 03, 2008, 0:20 +0200, Dean Hildebrand <seattleplus at gmail.com> wrote:
> > diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> > > index 9abd263..fdb3d40 100644
> > > --- a/fs/nfs/pnfs.c
> > > +++ b/fs/nfs/pnfs.c
> > > @@ -430,6 +430,8 @@ pnfs_inject_layout(struct nfs_inode *nfsi,
> > >  	if (nfsi->current_layout == NULL) {
> > >  		dprintk("%s Alloc'ing layout\n", __FUNCTION__);
> > >  		layid = io_ops->alloc_layout(server->pnfs_mountid, inode);
> > > +		if (layid)
> > > +			layid->inode = inode;
> > >  	} else {
> > >  		dprintk("%s Adding to current layout\n", __FUNCTION__);
> > >  		layid = nfsi->current_layout;
> > >   
> What happens if layid is NULL?  Isn't that an error? 
> Dean
> 

Right, it is.

In a later patch this code was moved to alloc_init_layout()
which, when returning NULL, triggers return of -ENOMEM from
get_alloc_layout() that's propagated up in pnfs_update_layout().

Benny


More information about the pNFS mailing list