Google luky.org euqset.org

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

Re: [PATCH 2/11] FUSE - core


> > +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/


$B$3$N>pJs$,$"$J$?$NC5$7$F$$?$b$N$+$I$&$+A*Br$7$F$/$@$5$!#(B
yes/$B$^$5$K$3$l$@!*(B   no/$B0c$&$J$!(B   part/$B0lIt8+$D$+$C$?(B   try/$B$3$l$G;n$7$F$_$k(B

$B$"$J$?$,C5$7$F$$?>pJs$O$I$N$h$&$J$3$H$+!"$4<+M3$K5-F~2<$5$!#FC$K!V$^$5$K$3$l$@!*!W$H8@$&>l9g$O5-F~$r$*4j$$7$^$9!#(B
$BNc(B:$B!VJ#?t$N%^%7%s$+$i(BCATV$B7PM3$G(Bipmasquerade$B$rMxMQ$7$F(BWeb$B$r;2>H$7$?$>l9g$N@_Dj$K$D$$F!W(B
Follow-Ups: References: