Re: [PATCH v8 04/20] cachefiles: notify user daemon when withdrawing cookie

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

 



JeffleXu <jefflexu@xxxxxxxxxxxxxxxxx> 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux