[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1094493.1649684554@warthog.procyon.org.uk>
Date: Mon, 11 Apr 2022 14:42:34 +0100
From: David Howells <dhowells@...hat.com>
To: JeffleXu <jefflexu@...ux.alibaba.com>
Cc: dhowells@...hat.com, linux-cachefs@...hat.com, xiang@...nel.org,
chao@...nel.org, linux-erofs@...ts.ozlabs.org,
torvalds@...ux-foundation.org, gregkh@...uxfoundation.org,
willy@...radead.org, linux-fsdevel@...r.kernel.org,
joseph.qi@...ux.alibaba.com, bo.liu@...ux.alibaba.com,
tao.peng@...ux.alibaba.com, gerry@...ux.alibaba.com,
eguan@...ux.alibaba.com, linux-kernel@...r.kernel.org,
luodaowen.backend@...edance.com, tianzichen@...ishou.com,
fannaihao@...du.com
Subject: Re: [PATCH v8 04/20] cachefiles: notify user daemon when withdrawing cookie
JeffleXu <jefflexu@...ux.alibaba.com> wrote:
> >
> >> + if (fd == 0)
> >> + return -ENOENT;
> >
> > 0 is a valid fd.
>
> Yeah, but IMHO fd 0 is always for stdin? I think the allocated anon_fd
> won't install at fd 0. Please correct me if I'm wrong.
If someone has closed 0, then you'll get 0 next, I'm pretty sure. Try it and
see.
> In fact I wanna use "fd == 0" as the initial state as struct
> cachefiles_object is allocated with kmem_cache_zalloc().
I would suggest presetting it to something like -2 to avoid confusion.
David
Powered by blists - more mailing lists