Re: [PATCH v4 011/100] nfsd: refactor nfs4_file_get_access and nfs4_file_put_access

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

 



On Thu, 10 Jul 2014 04:35:23 -0700
Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

> On Thu, Jul 10, 2014 at 07:32:14AM -0400, Jeff Layton wrote:
> > So, you're correct that we never take an fi_access reference for O_RDWR,
> > which is why the array doesn't have a slot for it:
> > 
> >         atomic_t                fi_access[2];
> > 
> > ...it's tracked by the union of the O_RDONLY and O_WRONLY counters.
> 
> Which will be racy as long we try to use an atomic_t and not a proper
> lock over access to all of fi_access.
> 

gets are always done with the lock held. puts do an atomic_dec_and_lock
or are done with the lock held. I don't see how that's racy...

> I'm still trying to understand why we even need fi_access and can't just
> use the file references directly, though.
> 


-- 
Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux