Re: [PATCH 2/11] FUSE - core

From: Miklos Szeredi
Date: Fri Jan 14 2005 - 09:08:58 EST


> > +static struct inode *fuse_alloc_inode(struct super_block *sb)
> > +{
> > + struct inode *inode;
> > + struct fuse_inode *fi;
> > +
> > + inode = kmem_cache_alloc(fuse_inode_cachep, SLAB_KERNEL);
>
> This should probably be SLAB_NOFS as FUSE is a file system so you don't
> want allocations to go off submitting i/o to your file system. Much
> better to be safe and always use the _NOFS versions in you kernel fs code.

Well, I don't think it matters in this case, since inode allocation is
not part of processing I/O, so no deadlock is possible. See also
alloc_inode() in fs/inode.c which also uses SLAB_KERNEL.

> > +static struct fuse_conn *new_conn(void)
> > +{
> > + struct fuse_conn *fc;
> > +
> > + fc = kmalloc(sizeof(*fc), GFP_KERNEL);
>
> Same comment as before: GFP_NOFS is safer.

Same reason as above.

In actual fact the whole GFP_NOFS argument doesn't apply to FUSE
_at_all_, since dirty pages are never allowed. Which is because
userspace can't easily be taught about GFP_NOFS allocations, and
otherwise could deadlock on page writeback.

Thanks,
Miklos
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/