Closed skyzh closed 2 years ago
Yeah, there is a (small, i believe) possibility that all files that have been previously allocated to a zone have been deleted. I'm planning to revisit the allocator code in the coming weeks anyway (primarily to move resets & finishes to a background thread) and i'll take this feedback into account. Thanks! We can keep this issue open for now.
The allocator has been (almost completely) reworked as part of https://github.com/westerndigitalcorporation/zenfs/pull/114 , so closing this. If you find any issues with the new implementation, please create a new issue. Thanks!
I've been reading through the ZenFS source code, and came across this line: https://github.com/westerndigitalcorporation/zenfs/blob/master/fs/zbd_zenfs.cc#L518
z->used_capacity_ > 0
seems not necessary in this case. I believe it is possible that there could be a zone whereused_capacity > 0
, which means all files are deleted (will explain)It is true that ZenFS will reset all unused zone at https://github.com/westerndigitalcorporation/zenfs/blob/master/fs/zbd_zenfs.cc#L488
And here is one possible execution order that makes this assumption fail.
used_capacity
of X = 0I'm wondering if it is necessary to ensure
z->used_capacity_ > 0
. Could we remove this condition?Thanks in advance!