Re: [PATCH 3/8] xarray: Explicitely set XA_FREE_MARK in __xa_cmpxchg()

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

 



On Tue, Feb 04, 2020 at 03:25:09PM +0100, Jan Kara wrote:
> __xa_cmpxchg() relies on xas_store() to set XA_FREE_MARK when storing
> NULL into xarray that has free tracking enabled. Make the setting of
> XA_FREE_MARK explicit similarly as its clearing currently it.

>  		if (curr == old) {
>  			xas_store(&xas, entry);
> -			if (xa_track_free(xa) && entry && !curr)
> -				xas_clear_mark(&xas, XA_FREE_MARK);
> +			if (xa_track_free(xa)) {
> +				if (entry && !curr)
> +					xas_clear_mark(&xas, XA_FREE_MARK);
> +				else if (!entry && curr)
> +					xas_set_mark(&xas, XA_FREE_MARK);
> +			}

This isn't right because the entry might have a different mark set on it
that would have been cleared before, but now won't be.  I should add
a test case for that ...



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

  Powered by Linux