]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nilfs2: do not propagate ENOENT error from sufile during GC
authorRyusuke Konishi <konishi.ryusuke@gmail.com>
Wed, 21 Aug 2024 15:46:26 +0000 (00:46 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 2 Sep 2024 03:43:39 +0000 (20:43 -0700)
commit0b9aad46c1634527c6a9f951f72c31be67f9b25c
tree103883d7d7f60b3d7cf77715b68f54918742e9f6
parent5b527d38644686dc11e29468463aa7affa282e31
nilfs2: do not propagate ENOENT error from sufile during GC

nilfs_sufile_freev(), which is used to free segments in GC, aborts with
-ENOENT if the target segment usage is on a hole block.

This error only occurs if one of the segment numbers to be freed passed by
the GC ioctl is invalid, so return -EINVAL instead.

To avoid impairing readability, introduce a wrapper function that
encapsulates error handling including the error code conversion (and error
message output).

Link: https://lkml.kernel.org/r/20240821154627.11848-5-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/segment.c