9p: Change p9_fid_create calling convention
authorMatthew Wilcox <willy@infradead.org>
Wed, 11 Jul 2018 21:02:21 +0000 (14:02 -0700)
committerDominique Martinet <dominique.martinet@cea.fr>
Mon, 13 Aug 2018 00:21:44 +0000 (09:21 +0900)
commitb5303be2bee3c8b29de3f7f4ea8ae00c4e816760
treeec2fe0f66140706c972f18502459d868aa2ec3a5
parent2d58f63f72f28ba297a9ae344a5b5f0cf75bcd94
9p: Change p9_fid_create calling convention

Return NULL instead of ERR_PTR when we can't allocate a FID.  The ENOSPC
return value was getting all the way back to userspace, and that's
confusing for a userspace program which isn't expecting read() to tell it
there's no space left on the filesystem.  The best error we can return to
indicate a temporary failure caused by lack of client resources is ENOMEM.

Maybe it would be better to sleep until a FID is available, but that's
not a change I'm comfortable making.

Link: http://lkml.kernel.org/r/20180711210225.19730-3-willy@infradead.org
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Jun Piao <piaojun@huawei.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Yiwen Jiang <jiangyiwen@huwei.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
net/9p/client.c