Re: [PATCH 05/10] ext4: Fix race when reusing xattr blocks

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

 



在 2022/7/25 23:23, Jan Kara 写道:

So far, we have mb_cache_entry_delete_or_get() and
mb_cache_entry_wait_unused(), so used cache entry cannot be concurrently
removed. Removing check 'hlist_bl_unhashed(&ce->e_hash_list)' is okay.

What's affect of changing the other two checks 'ref >=
EXT4_XATTR_REFCOUNT_MAX' and '!ce->e_reusable'? To make code more obvious?
eg. To point out the condition of 'ref <= EXT4_XATTR_REFCOUNT_MAX' rather
than 'ce->e_reusable', we have checked 'ce->e_reusable' in
ext4_xattr_block_cache_find() before?

Well, ce->e_reusable is set if and only if BHDR(new_bh)->h_refcount <
EXT4_XATTR_REFCOUNT_MAX. So checking whether the refcount is small enough
is all that is needed and we don't need the ce->e_reusable check here.


Thanks for replying, I get it, thanks.




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux