Re: [PATCH v9 19/20] fs/dax: Properly refcount fs dax pages

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

 



David Hildenbrand wrote:
> 
> > -static inline unsigned long dax_folio_share_put(struct folio *folio)
> > +static inline unsigned long dax_folio_put(struct folio *folio)
> >   {
> > -	return --folio->page.share;
> > +	unsigned long ref;
> > +	int order, i;
> > +
> > +	if (!dax_folio_is_shared(folio))
> > +		ref = 0;
> > +	else
> > +		ref = --folio->share;
> > +
> 
> It would still be good to learn how this non-atomic update here is safe 
> (@Dan?), but that's independent of this series.

Apologies, I missed this question earlier.

All these manipulations are happening under xas_lock_irq() for @entry
where each @entry is 1:1 correlated with a folio. So concurrent attempts
to associate/disassociate a reflinked block in a file should synchronize
there.

> Staring at it, I would have thought we have to us an atomic_t here.
> 
> Acked-by: David Hildenbrand <david@xxxxxxxxxx>

Thanks for taking a look!




[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