[PATCH v3 1/4] erofs-utils: lib: remove redundant if check

Lucas Karpinski lkarpinski at nvidia.com
Wed Apr 15 05:10:39 AEST 2026


Remove the if check since erofs_set_inode_fingerprint is already protected
by the same if statement.

Signed-off-by: Lucas Karpinski <lkarpinski at nvidia.com>
---
 lib/inode.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/inode.c b/lib/inode.c
index c932981a..2f78d9b8 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -2018,11 +2018,9 @@ static int erofs_mkfs_begin_nondirectory(const struct erofs_mkfs_btctx *btctx,
 			goto out;
 		}
 
-		if (S_ISREG(inode->i_mode) && inode->i_size) {
-			ret = erofs_set_inode_fingerprint(inode, ctx.fd, ctx.fpos);
-			if (ret < 0)
-				return ret;
-		}
+		ret = erofs_set_inode_fingerprint(inode, ctx.fd, ctx.fpos);
+		if (ret < 0)
+			return ret;
 
 		if (inode->sbi->available_compr_algs &&
 		    erofs_file_is_compressible(im, inode)) {

-- 
Git-155)


More information about the Linux-erofs mailing list