Linux-EROFS Archive mirror
 help / color / mirror / Atom feed
* [PATCH] erofs-utils: check the return value of ftell
@ 2022-02-18  3:11 Huang Jianan via Linux-erofs
  2022-02-18  3:11 ` [PATCH] erofs-utils: fix memory leak when load compress hints file Huang Jianan via Linux-erofs
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Huang Jianan via Linux-erofs @ 2022-02-18  3:11 UTC (permalink / raw
  To: linux-erofs; +Cc: zhangshiming

Need to check if we got a normal length.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
---
 lib/blobchunk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index 4a440d6..483362b 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -221,6 +221,8 @@ int erofs_blob_remap(void)
 
 	fflush(blobfile);
 	length = ftell(blobfile);
+	if (length < 0)
+		return -errno;
 	if (multidev) {
 		struct erofs_deviceslot dis = {
 			.blocks = erofs_blknr(length),
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] erofs-utils: fix memory leak when load compress hints file
  2022-02-18  3:11 [PATCH] erofs-utils: check the return value of ftell Huang Jianan via Linux-erofs
@ 2022-02-18  3:11 ` Huang Jianan via Linux-erofs
  2022-02-18  7:02   ` Gao Xiang
  2022-02-18  3:11 ` [PATCH] erofs-utils: fix some style problems Huang Jianan via Linux-erofs
  2022-02-18  7:03 ` [PATCH] erofs-utils: check the return value of ftell Gao Xiang
  2 siblings, 1 reply; 10+ messages in thread
From: Huang Jianan via Linux-erofs @ 2022-02-18  3:11 UTC (permalink / raw
  To: linux-erofs; +Cc: zhangshiming

Execute fclose before return error.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
---
 lib/compress_hints.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/compress_hints.c b/lib/compress_hints.c
index c3f3d48..c52e2d3 100644
--- a/lib/compress_hints.c
+++ b/lib/compress_hints.c
@@ -88,6 +88,7 @@ int erofs_load_compress_hints(void)
 	char buf[PATH_MAX + 100];
 	FILE *f;
 	unsigned int line, max_pclustersize = 0;
+	int ret = 0;
 
 	if (!cfg.c_compress_hints_file)
 		return 0;
@@ -105,7 +106,8 @@ int erofs_load_compress_hints(void)
 		if (!pattern || *pattern == '\0') {
 			erofs_err("cannot find a match pattern at line %u",
 				  line);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 		if (pclustersize % EROFS_BLKSIZ) {
 			erofs_warn("invalid physical clustersize %u, "
@@ -119,10 +121,12 @@ int erofs_load_compress_hints(void)
 		if (pclustersize > max_pclustersize)
 			max_pclustersize = pclustersize;
 	}
-	fclose(f);
+
 	if (cfg.c_pclusterblks_max * EROFS_BLKSIZ < max_pclustersize) {
 		cfg.c_pclusterblks_max = max_pclustersize / EROFS_BLKSIZ;
 		erofs_warn("update max pclusterblks to %u", cfg.c_pclusterblks_max);
 	}
-	return 0;
+out:
+	fclose(f);
+	return ret;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] erofs-utils: fix some style problems
  2022-02-18  3:11 [PATCH] erofs-utils: check the return value of ftell Huang Jianan via Linux-erofs
  2022-02-18  3:11 ` [PATCH] erofs-utils: fix memory leak when load compress hints file Huang Jianan via Linux-erofs
@ 2022-02-18  3:11 ` Huang Jianan via Linux-erofs
  2022-02-18  6:20   ` Gao Xiang
  2022-02-18  7:03 ` [PATCH] erofs-utils: check the return value of ftell Gao Xiang
  2 siblings, 1 reply; 10+ messages in thread
From: Huang Jianan via Linux-erofs @ 2022-02-18  3:11 UTC (permalink / raw
  To: linux-erofs; +Cc: zhangshiming

Fix some minor issues, including:
  - Align with the left parenthesis;
  - Spelling mistakes;
  - Remove redundant spaces and parenthesis;
  - clean up file headers;
  - Match parameters with format parameters.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
---
 dump/main.c                | 53 +++++++++++++++++++-------------------
 fsck/main.c                |  4 +--
 fuse/main.c                |  1 -
 include/erofs/block_list.h |  4 +--
 include/erofs/defs.h       |  1 -
 include/erofs/dir.h        |  2 +-
 include/erofs/internal.h   |  2 +-
 include/erofs/list.h       |  1 -
 lib/blobchunk.c            |  2 +-
 lib/cache.c                |  1 -
 lib/compress.c             |  2 +-
 lib/compress_hints.c       |  2 +-
 lib/compressor_liblzma.c   |  5 ++--
 lib/data.c                 |  2 +-
 lib/dir.c                  |  2 +-
 lib/exclude.c              |  2 +-
 lib/inode.c                |  2 +-
 lib/io.c                   |  2 +-
 lib/liberofs_private.h     |  2 +-
 lib/namei.c                |  1 -
 lib/super.c                |  4 +--
 lib/xattr.c                |  4 +--
 mkfs/main.c                |  2 +-
 23 files changed, 48 insertions(+), 55 deletions(-)

diff --git a/dump/main.c b/dump/main.c
index e6198a0..3f8c2f2 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -179,7 +179,7 @@ static int erofsdump_parse_options_cfg(int argc, char **argv)
 }
 
 static int erofsdump_get_occupied_size(struct erofs_inode *inode,
-		erofs_off_t *size)
+				       erofs_off_t *size)
 {
 	*size = 0;
 	switch (inode->datalayout) {
@@ -218,7 +218,7 @@ static void inc_file_extension_count(const char *dname, unsigned int len)
 }
 
 static void update_file_size_statatics(erofs_off_t occupied_size,
-		erofs_off_t original_size)
+				       erofs_off_t original_size)
 {
 	int occupied_size_mark, original_size_mark;
 
@@ -300,7 +300,7 @@ static int erofsdump_readdir(struct erofs_dir_context *ctx)
 }
 
 static int erofsdump_map_blocks(struct erofs_inode *inode,
-		struct erofs_map_blocks *map, int flags)
+				struct erofs_map_blocks *map, int flags)
 {
 	if (erofs_inode_is_data_compressed(inode->datalayout))
 		return z_erofs_map_blocks_iter(inode, map, flags);
@@ -383,7 +383,7 @@ static void erofsdump_show_fileinfo(bool show_extent)
 		struct erofs_map_dev mdev;
 
 		err = erofsdump_map_blocks(&inode, &map,
-				EROFS_GET_BLOCKS_FIEMAP);
+					   EROFS_GET_BLOCKS_FIEMAP);
 		if (err) {
 			erofs_err("failed to get file blocks range");
 			return;
@@ -409,7 +409,8 @@ static void erofsdump_show_fileinfo(bool show_extent)
 }
 
 static void erofsdump_filesize_distribution(const char *title,
-		unsigned int *file_counts, unsigned int len)
+					    unsigned int *file_counts,
+					    unsigned int len)
 {
 	char col1[30];
 	unsigned int col2, i, lowerbound, upperbound;
@@ -419,8 +420,7 @@ static void erofsdump_filesize_distribution(const char *title,
 	lowerbound = 0;
 	upperbound = 1;
 	fprintf(stdout, "\n%s file size distribution:\n", title);
-	fprintf(stdout, header_format, ">=(KB) .. <(KB) ", "count",
-			"ratio", "distribution");
+	fprintf(stdout, header_format, ">=(KB) .. <(KB) ", "count", "ratio", "distribution");
 	for (i = 0; i < len; i++) {
 		memset(col1, 0, sizeof(col1));
 		memset(col4, 0, sizeof(col4));
@@ -452,8 +452,7 @@ static void erofsdump_filetype_distribution(char **file_types, unsigned int len)
 	char col4[401];
 
 	fprintf(stdout, "\nFile type distribution:\n");
-	fprintf(stdout, header_format, "type", "count", "ratio",
-			"distribution");
+	fprintf(stdout, header_format, "type", "count", "ratio", "distribution");
 	for (i = 0; i < len; i++) {
 		memset(col1, 0, sizeof(col1));
 		memset(col4, 0, sizeof(col4));
@@ -480,17 +479,17 @@ static void erofsdump_file_statistic(void)
 			file_category_types[i], stats.file_category_stat[i]);
 
 	stats.compress_rate = (double)(100 * stats.files_total_size) /
-		(double)(stats.files_total_origin_size);
+			      (double)(stats.files_total_origin_size);
 	fprintf(stdout, "Filesystem compressed files:            %lu\n",
-			stats.compressed_files);
+		stats.compressed_files);
 	fprintf(stdout, "Filesystem uncompressed files:          %lu\n",
-			stats.uncompressed_files);
+		stats.uncompressed_files);
 	fprintf(stdout, "Filesystem total original file size:    %lu Bytes\n",
-			stats.files_total_origin_size);
+		stats.files_total_origin_size);
 	fprintf(stdout, "Filesystem total file size:             %lu Bytes\n",
-			stats.files_total_size);
+		stats.files_total_size);
 	fprintf(stdout, "Filesystem compress rate:               %.2f%%\n",
-			stats.compress_rate);
+		stats.compress_rate);
 }
 
 static void erofsdump_print_statistic(void)
@@ -513,11 +512,11 @@ static void erofsdump_print_statistic(void)
 	}
 	erofsdump_file_statistic();
 	erofsdump_filesize_distribution("Original",
-			stats.file_original_size,
-			ARRAY_SIZE(stats.file_original_size));
+					stats.file_original_size,
+					ARRAY_SIZE(stats.file_original_size));
 	erofsdump_filesize_distribution("On-disk",
-			stats.file_comp_size,
-			ARRAY_SIZE(stats.file_comp_size));
+					stats.file_comp_size,
+					ARRAY_SIZE(stats.file_comp_size));
 	erofsdump_filetype_distribution(file_types, OTHERFILETYPE);
 }
 
@@ -528,19 +527,19 @@ static void erofsdump_show_superblock(void)
 	int i = 0;
 
 	fprintf(stdout, "Filesystem magic number:                      0x%04X\n",
-			EROFS_SUPER_MAGIC_V1);
+		EROFS_SUPER_MAGIC_V1);
 	fprintf(stdout, "Filesystem blocks:                            %llu\n",
-			sbi.total_blocks | 0ULL);
+		sbi.total_blocks | 0ULL);
 	fprintf(stdout, "Filesystem inode metadata start block:        %u\n",
-			sbi.meta_blkaddr);
+		sbi.meta_blkaddr);
 	fprintf(stdout, "Filesystem shared xattr metadata start block: %u\n",
-			sbi.xattr_blkaddr);
+		sbi.xattr_blkaddr);
 	fprintf(stdout, "Filesystem root nid:                          %llu\n",
-			sbi.root_nid | 0ULL);
+		sbi.root_nid | 0ULL);
 	fprintf(stdout, "Filesystem inode count:                       %llu\n",
-			sbi.inos | 0ULL);
+		sbi.inos | 0ULL);
 	fprintf(stdout, "Filesystem created:                           %s",
-			ctime(&time));
+		ctime(&time));
 	fprintf(stdout, "Filesystem features:                          ");
 	for (; i < ARRAY_SIZE(feature_lists); i++) {
 		u32 feat = le32_to_cpu(feature_lists[i].compat ?
@@ -553,7 +552,7 @@ static void erofsdump_show_superblock(void)
 	uuid_unparse_lower(sbi.uuid, uuid_str);
 #endif
 	fprintf(stdout, "\nFilesystem UUID:                              %s\n",
-			uuid_str);
+		uuid_str);
 }
 
 int main(int argc, char **argv)
diff --git a/fsck/main.c b/fsck/main.c
index 56595e3..8fd23eb 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -396,10 +396,10 @@ static int erofs_verify_inode_data(struct erofs_inode *inode, int outfd)
 		map.m_la = pos;
 		if (compressed)
 			ret = z_erofs_map_blocks_iter(inode, &map,
-					EROFS_GET_BLOCKS_FIEMAP);
+						      EROFS_GET_BLOCKS_FIEMAP);
 		else
 			ret = erofs_map_blocks(inode, &map,
-					EROFS_GET_BLOCKS_FIEMAP);
+					       EROFS_GET_BLOCKS_FIEMAP);
 		if (ret)
 			goto out;
 
diff --git a/fuse/main.c b/fuse/main.c
index b869a00..90ed611 100644
--- a/fuse/main.c
+++ b/fuse/main.c
@@ -61,7 +61,6 @@ int erofsfuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
 #else
 	return erofs_iterate_dir(&ctx.ctx, true);
 #endif
-
 }
 
 static void *erofsfuse_init(struct fuse_conn_info *info)
diff --git a/include/erofs/block_list.h b/include/erofs/block_list.h
index 78fab44..9f195c8 100644
--- a/include/erofs/block_list.h
+++ b/include/erofs/block_list.h
@@ -25,10 +25,10 @@ void erofs_droid_blocklist_write_extent(struct erofs_inode *inode,
 					bool first_extent, bool last_extent);
 #else
 static inline void erofs_droid_blocklist_write(struct erofs_inode *inode,
-				 erofs_blk_t blk_start, erofs_blk_t nblocks) {}
+					       erofs_blk_t blk_start, erofs_blk_t nblocks) {}
 static inline void
 erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
-					  erofs_blk_t blkaddr) {}
+				     erofs_blk_t blkaddr) {}
 static inline void
 erofs_droid_blocklist_write_extent(struct erofs_inode *inode,
 				   erofs_blk_t blk_start, erofs_blk_t nblocks,
diff --git a/include/erofs/defs.h b/include/erofs/defs.h
index e745bc0..e5aa23c 100644
--- a/include/erofs/defs.h
+++ b/include/erofs/defs.h
@@ -61,7 +61,6 @@ typedef int16_t         s16;
 typedef int32_t         s32;
 typedef int64_t         s64;
 
-
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 /*
  * The host byte order is the same as network byte order,
diff --git a/include/erofs/dir.h b/include/erofs/dir.h
index 1627d3d..74bffb5 100644
--- a/include/erofs/dir.h
+++ b/include/erofs/dir.h
@@ -42,7 +42,7 @@ struct erofs_dir_context {
 	/*
 	 * During execution of |erofs_iterate_dir|, the function needs to
 	 * read the values inside |erofs_inode* dir|. So it is important
-	 * that the callback function does not modify stuct pointed by
+	 * that the callback function does not modify struct pointed by
 	 * |dir|. It is OK to repoint |dir| to other objects.
 	 * Unfortunately, it's not possible to enforce this restriction
 	 * with const keyword, as |erofs_iterate_dir| needs to modify
diff --git a/include/erofs/internal.h b/include/erofs/internal.h
index d4efc18..4b22895 100644
--- a/include/erofs/internal.h
+++ b/include/erofs/internal.h
@@ -328,7 +328,7 @@ int erofs_read_inode_from_disk(struct erofs_inode *vi);
 int erofs_pread(struct erofs_inode *inode, char *buf,
 		erofs_off_t count, erofs_off_t offset);
 int erofs_map_blocks(struct erofs_inode *inode,
-		struct erofs_map_blocks *map, int flags);
+		     struct erofs_map_blocks *map, int flags);
 int erofs_map_dev(struct erofs_sb_info *sbi, struct erofs_map_dev *map);
 
 static inline int erofs_get_occupied_size(const struct erofs_inode *inode,
diff --git a/include/erofs/list.h b/include/erofs/list.h
index 2a0e961..3f5da1a 100644
--- a/include/erofs/list.h
+++ b/include/erofs/list.h
@@ -110,7 +110,6 @@ static inline int list_empty(struct list_head *head)
 	     &pos->member != (head);                                           \
 	     pos = n, n = list_next_entry(n, member))
 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index a145be9..4a440d6 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -29,7 +29,7 @@ static bool multidev;
 static struct erofs_buffer_head *bh_devt;
 
 static struct erofs_blobchunk *erofs_blob_getchunk(int fd,
-		unsigned int chunksize)
+						   unsigned int chunksize)
 {
 	static u8 zeroed[EROFS_BLKSIZ];
 	u8 *chunkdata, sha256[32];
diff --git a/lib/cache.c b/lib/cache.c
index f820c0b..c735363 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -331,7 +331,6 @@ struct erofs_buffer_head *erofs_battach(struct erofs_buffer_head *bh,
 		return ERR_PTR(ret);
 	}
 	return nbh;
-
 }
 
 static erofs_blk_t __erofs_mapbh(struct erofs_buffer_block *bb)
diff --git a/lib/compress.c b/lib/compress.c
index e050df0..df6411c 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -114,7 +114,7 @@ static void vle_write_indexes(struct z_erofs_vle_compress_ctx *ctx,
 			 */
 			if (d0 >= Z_EROFS_VLE_DI_D0_CBLKCNT)
 				di.di_u.delta[0] = cpu_to_le16(
-						Z_EROFS_VLE_DI_D0_CBLKCNT - 1);
+						   Z_EROFS_VLE_DI_D0_CBLKCNT - 1);
 			else
 				di.di_u.delta[0] = cpu_to_le16(d0);
 			di.di_u.delta[1] = cpu_to_le16(d1);
diff --git a/lib/compress_hints.c b/lib/compress_hints.c
index 25adf35..c3f3d48 100644
--- a/lib/compress_hints.c
+++ b/lib/compress_hints.c
@@ -29,7 +29,7 @@ static int erofs_insert_compress_hints(const char *s, unsigned int blks)
 	if (!r)
 		return -ENOMEM;
 
-	ret = regcomp(&r->reg, s, REG_EXTENDED|REG_NOSUB);
+	ret = regcomp(&r->reg, s, REG_EXTENDED | REG_NOSUB);
 	if (ret) {
 		dump_regerror(ret, s, &r->reg);
 		goto err_out;
diff --git a/lib/compressor_liblzma.c b/lib/compressor_liblzma.c
index acf442f..e0b5b44 100644
--- a/lib/compressor_liblzma.c
+++ b/lib/compressor_liblzma.c
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0
 /*
- * erofs-utils/lib/compressor_liblzma.c
- *
  * Copyright (C) 2021 Gao Xiang <xiang@kernel.org>
  */
 #include <stdlib.h>
@@ -24,8 +22,9 @@ static int erofs_liblzma_compress_destsize(const struct erofs_compress *c,
 {
 	struct erofs_liblzma_context *ctx = c->private_data;
 	lzma_stream *strm = &ctx->strm;
+	lzma_ret ret;
 
-	lzma_ret ret = lzma_microlzma_encoder(strm, &ctx->opt);
+	ret = lzma_microlzma_encoder(strm, &ctx->opt);
 	if (ret != LZMA_OK)
 		return -EFAULT;
 
diff --git a/lib/data.c b/lib/data.c
index e57707e..b338846 100644
--- a/lib/data.c
+++ b/lib/data.c
@@ -62,7 +62,7 @@ err_out:
 }
 
 int erofs_map_blocks(struct erofs_inode *inode,
-		struct erofs_map_blocks *map, int flags)
+		     struct erofs_map_blocks *map, int flags)
 {
 	struct erofs_inode *vi = inode;
 	struct erofs_inode_chunk_index *idx;
diff --git a/lib/dir.c b/lib/dir.c
index 8955931..7fefa6a 100644
--- a/lib/dir.c
+++ b/lib/dir.c
@@ -42,7 +42,7 @@ static int traverse_dirents(struct erofs_dir_context *ctx,
 		}
 
 		if (nameoff + de_namelen > maxsize ||
-				de_namelen > EROFS_NAME_LEN) {
+			de_namelen > EROFS_NAME_LEN) {
 			errmsg = "bogus dirent namelen";
 			break;
 		}
diff --git a/lib/exclude.c b/lib/exclude.c
index e3c4ed5..808d0c8 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -42,7 +42,7 @@ static struct erofs_exclude_rule *erofs_insert_exclude(const char *s,
 	}
 
 	if (is_regex) {
-		ret = regcomp(&r->reg, s, REG_EXTENDED|REG_NOSUB);
+		ret = regcomp(&r->reg, s, REG_EXTENDED | REG_NOSUB);
 		if (ret) {
 			dump_regerror(ret, s, &r->reg);
 			goto err_rule;
diff --git a/lib/inode.c b/lib/inode.c
index e680b23..5db4691 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -1108,7 +1108,7 @@ fail:
 		d->type = ftype;
 
 		erofs_d_invalidate(d);
-		erofs_info("add file %s/%s (nid %llu, type %d)",
+		erofs_info("add file %s/%s (nid %llu, type %u)",
 			   dir->i_srcpath, d->name, (unsigned long long)d->nid,
 			   d->type);
 	}
diff --git a/lib/io.c b/lib/io.c
index 5bc3432..9c663c5 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -370,7 +370,7 @@ ssize_t erofs_copy_file_range(int fd_in, erofs_off_t *off_in,
 	ssize_t ret;
 
 	ret = copy_file_range(fd_in, &off64_in, fd_out, &off64_out,
-                              length, 0);
+			      length, 0);
 	if (ret >= 0)
 		goto out;
 	if (errno != ENOSYS) {
diff --git a/lib/liberofs_private.h b/lib/liberofs_private.h
index 0eeca3c..36f8ad4 100644
--- a/lib/liberofs_private.h
+++ b/lib/liberofs_private.h
@@ -19,7 +19,7 @@ static inline void *memrchr(const void *s, int c, size_t n)
 
 	for (p += n; n > 0; n--)
 		if (*--p == c)
-			return (void*)p;
+			return (void *)p;
 	return NULL;
 }
 #endif
diff --git a/lib/namei.c b/lib/namei.c
index 97f0f80..6163238 100644
--- a/lib/namei.c
+++ b/lib/namei.c
@@ -144,7 +144,6 @@ bogusimode:
 	return -EFSCORRUPTED;
 }
 
-
 struct erofs_dirent *find_target_dirent(erofs_nid_t pnid,
 					void *dentry_blk,
 					const char *name, unsigned int len,
diff --git a/lib/super.c b/lib/super.c
index 69522bd..f486eb7 100644
--- a/lib/super.c
+++ b/lib/super.c
@@ -15,7 +15,7 @@ static bool check_layout_compatibility(struct erofs_sb_info *sbi,
 	sbi->feature_incompat = feature;
 
 	/* check if current kernel meets all mandatory requirements */
-	if (feature & (~EROFS_ALL_FEATURE_INCOMPAT)) {
+	if (feature & ~EROFS_ALL_FEATURE_INCOMPAT) {
 		erofs_err("unidentified incompatible feature %x, please upgrade kernel version",
 			  feature & ~EROFS_ALL_FEATURE_INCOMPAT);
 		return false;
@@ -87,7 +87,7 @@ int erofs_read_superblock(void)
 	blkszbits = dsb->blkszbits;
 	/* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */
 	if (blkszbits != LOG_BLOCK_SIZE) {
-		erofs_err("blksize %u isn't supported on this platform",
+		erofs_err("blksize %d isn't supported on this platform",
 			  1 << blkszbits);
 		return ret;
 	}
diff --git a/lib/xattr.c b/lib/xattr.c
index 71ffe3e..49970e4 100644
--- a/lib/xattr.c
+++ b/lib/xattr.c
@@ -405,9 +405,9 @@ static int erofs_droid_xattr_set_caps(struct erofs_inode *inode)
 
 	memcpy(kvbuf, "capability", len[0]);
 	caps.magic_etc = VFS_CAP_REVISION_2 | VFS_CAP_FLAGS_EFFECTIVE;
-	caps.data[0].permitted = (u32) capabilities;
+	caps.data[0].permitted = (u32)capabilities;
 	caps.data[0].inheritable = 0;
-	caps.data[1].permitted = (u32) (capabilities >> 32);
+	caps.data[1].permitted = (u32)(capabilities >> 32);
 	caps.data[1].inheritable = 0;
 	memcpy(kvbuf + len[0], &caps, len[1]);
 
diff --git a/mkfs/main.c b/mkfs/main.c
index 282126a..0724212 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -204,7 +204,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
 	bool quiet = false;
 
 	while ((opt = getopt_long(argc, argv, "C:E:T:U:d:x:z:",
-				 long_options, NULL)) != -1) {
+				  long_options, NULL)) != -1) {
 		switch (opt) {
 		case 'z':
 			if (!optarg) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] erofs-utils: fix some style problems
  2022-02-18  3:11 ` [PATCH] erofs-utils: fix some style problems Huang Jianan via Linux-erofs
@ 2022-02-18  6:20   ` Gao Xiang
  2022-02-23  7:19     ` Huang Jianan via Linux-erofs
  0 siblings, 1 reply; 10+ messages in thread
From: Gao Xiang @ 2022-02-18  6:20 UTC (permalink / raw
  To: Huang Jianan; +Cc: zhangshiming, linux-erofs

Hi Jianan,

On Fri, Feb 18, 2022 at 11:11:37AM +0800, Huang Jianan via Linux-erofs wrote:
> Fix some minor issues, including:
>   - Align with the left parenthesis;
>   - Spelling mistakes;
>   - Remove redundant spaces and parenthesis;
>   - clean up file headers;
>   - Match parameters with format parameters.
> 
> Signed-off-by: Huang Jianan <huangjianan@oppo.com>
> ---
>  dump/main.c                | 53 +++++++++++++++++++-------------------
>  fsck/main.c                |  4 +--
>  fuse/main.c                |  1 -
>  include/erofs/block_list.h |  4 +--
>  include/erofs/defs.h       |  1 -
>  include/erofs/dir.h        |  2 +-
>  include/erofs/internal.h   |  2 +-
>  include/erofs/list.h       |  1 -
>  lib/blobchunk.c            |  2 +-
>  lib/cache.c                |  1 -
>  lib/compress.c             |  2 +-
>  lib/compress_hints.c       |  2 +-
>  lib/compressor_liblzma.c   |  5 ++--
>  lib/data.c                 |  2 +-
>  lib/dir.c                  |  2 +-
>  lib/exclude.c              |  2 +-
>  lib/inode.c                |  2 +-
>  lib/io.c                   |  2 +-
>  lib/liberofs_private.h     |  2 +-
>  lib/namei.c                |  1 -
>  lib/super.c                |  4 +--
>  lib/xattr.c                |  4 +--
>  mkfs/main.c                |  2 +-
>  23 files changed, 48 insertions(+), 55 deletions(-)
> 
> diff --git a/dump/main.c b/dump/main.c
> index e6198a0..3f8c2f2 100644
> --- a/dump/main.c
> +++ b/dump/main.c
> @@ -179,7 +179,7 @@ static int erofsdump_parse_options_cfg(int argc, char **argv)
>  }
>  
>  static int erofsdump_get_occupied_size(struct erofs_inode *inode,
> -		erofs_off_t *size)
> +				       erofs_off_t *size)

There are two acceptable style (which follows kernel code style),
1) the one is aligned with the parentheses in the previous line;
2) the other is just using two indentations.

So here we actually don't need to update... btw, was it reported
by checkpatch.pl?

Thanks,
Gao Xiang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] erofs-utils: fix memory leak when load compress hints file
  2022-02-18  3:11 ` [PATCH] erofs-utils: fix memory leak when load compress hints file Huang Jianan via Linux-erofs
@ 2022-02-18  7:02   ` Gao Xiang
  2022-02-23  7:19     ` Huang Jianan via Linux-erofs
  0 siblings, 1 reply; 10+ messages in thread
From: Gao Xiang @ 2022-02-18  7:02 UTC (permalink / raw
  To: Huang Jianan; +Cc: zhangshiming, linux-erofs

On Fri, Feb 18, 2022 at 11:11:36AM +0800, Huang Jianan via Linux-erofs wrote:
> Execute fclose before return error.
> 
> Signed-off-by: Huang Jianan <huangjianan@oppo.com>

It's actually a file descriptor leakage? 

Thanks,
Gao Xiang

> ---
>  lib/compress_hints.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/compress_hints.c b/lib/compress_hints.c
> index c3f3d48..c52e2d3 100644
> --- a/lib/compress_hints.c
> +++ b/lib/compress_hints.c
> @@ -88,6 +88,7 @@ int erofs_load_compress_hints(void)
>  	char buf[PATH_MAX + 100];
>  	FILE *f;
>  	unsigned int line, max_pclustersize = 0;
> +	int ret = 0;
>  
>  	if (!cfg.c_compress_hints_file)
>  		return 0;
> @@ -105,7 +106,8 @@ int erofs_load_compress_hints(void)
>  		if (!pattern || *pattern == '\0') {
>  			erofs_err("cannot find a match pattern at line %u",
>  				  line);
> -			return -EINVAL;
> +			ret = -EINVAL;
> +			goto out;
>  		}
>  		if (pclustersize % EROFS_BLKSIZ) {
>  			erofs_warn("invalid physical clustersize %u, "
> @@ -119,10 +121,12 @@ int erofs_load_compress_hints(void)
>  		if (pclustersize > max_pclustersize)
>  			max_pclustersize = pclustersize;
>  	}
> -	fclose(f);
> +
>  	if (cfg.c_pclusterblks_max * EROFS_BLKSIZ < max_pclustersize) {
>  		cfg.c_pclusterblks_max = max_pclustersize / EROFS_BLKSIZ;
>  		erofs_warn("update max pclusterblks to %u", cfg.c_pclusterblks_max);
>  	}
> -	return 0;
> +out:
> +	fclose(f);
> +	return ret;
>  }
> -- 
> 2.25.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] erofs-utils: check the return value of ftell
  2022-02-18  3:11 [PATCH] erofs-utils: check the return value of ftell Huang Jianan via Linux-erofs
  2022-02-18  3:11 ` [PATCH] erofs-utils: fix memory leak when load compress hints file Huang Jianan via Linux-erofs
  2022-02-18  3:11 ` [PATCH] erofs-utils: fix some style problems Huang Jianan via Linux-erofs
@ 2022-02-18  7:03 ` Gao Xiang
  2 siblings, 0 replies; 10+ messages in thread
From: Gao Xiang @ 2022-02-18  7:03 UTC (permalink / raw
  To: Huang Jianan; +Cc: zhangshiming, linux-erofs

On Fri, Feb 18, 2022 at 11:11:35AM +0800, Huang Jianan via Linux-erofs wrote:
> Need to check if we got a normal length.
> 
> Signed-off-by: Huang Jianan <huangjianan@oppo.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang

> ---
>  lib/blobchunk.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/lib/blobchunk.c b/lib/blobchunk.c
> index 4a440d6..483362b 100644
> --- a/lib/blobchunk.c
> +++ b/lib/blobchunk.c
> @@ -221,6 +221,8 @@ int erofs_blob_remap(void)
>  
>  	fflush(blobfile);
>  	length = ftell(blobfile);
> +	if (length < 0)
> +		return -errno;
>  	if (multidev) {
>  		struct erofs_deviceslot dis = {
>  			.blocks = erofs_blknr(length),
> -- 
> 2.25.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] erofs-utils: fix memory leak when load compress hints file
  2022-02-18  7:02   ` Gao Xiang
@ 2022-02-23  7:19     ` Huang Jianan via Linux-erofs
  0 siblings, 0 replies; 10+ messages in thread
From: Huang Jianan via Linux-erofs @ 2022-02-23  7:19 UTC (permalink / raw
  To: Gao Xiang; +Cc: zhangshiming, linux-erofs

在 2022/2/18 15:02, Gao Xiang 写道:
> On Fri, Feb 18, 2022 at 11:11:36AM +0800, Huang Jianan via Linux-erofs wrote:
>> Execute fclose before return error.
>>
>> Signed-off-by: Huang Jianan <huangjianan@oppo.com>
> It's actually a file descriptor leakage?
>
> Thanks,
> Gao Xiang

Yes, I will fix this in the next version.

Thanks,
Jianan

>> ---
>>   lib/compress_hints.c | 10 +++++++---
>>   1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/compress_hints.c b/lib/compress_hints.c
>> index c3f3d48..c52e2d3 100644
>> --- a/lib/compress_hints.c
>> +++ b/lib/compress_hints.c
>> @@ -88,6 +88,7 @@ int erofs_load_compress_hints(void)
>>   	char buf[PATH_MAX + 100];
>>   	FILE *f;
>>   	unsigned int line, max_pclustersize = 0;
>> +	int ret = 0;
>>   
>>   	if (!cfg.c_compress_hints_file)
>>   		return 0;
>> @@ -105,7 +106,8 @@ int erofs_load_compress_hints(void)
>>   		if (!pattern || *pattern == '\0') {
>>   			erofs_err("cannot find a match pattern at line %u",
>>   				  line);
>> -			return -EINVAL;
>> +			ret = -EINVAL;
>> +			goto out;
>>   		}
>>   		if (pclustersize % EROFS_BLKSIZ) {
>>   			erofs_warn("invalid physical clustersize %u, "
>> @@ -119,10 +121,12 @@ int erofs_load_compress_hints(void)
>>   		if (pclustersize > max_pclustersize)
>>   			max_pclustersize = pclustersize;
>>   	}
>> -	fclose(f);
>> +
>>   	if (cfg.c_pclusterblks_max * EROFS_BLKSIZ < max_pclustersize) {
>>   		cfg.c_pclusterblks_max = max_pclustersize / EROFS_BLKSIZ;
>>   		erofs_warn("update max pclusterblks to %u", cfg.c_pclusterblks_max);
>>   	}
>> -	return 0;
>> +out:
>> +	fclose(f);
>> +	return ret;
>>   }
>> -- 
>> 2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] erofs-utils: fix some style problems
  2022-02-18  6:20   ` Gao Xiang
@ 2022-02-23  7:19     ` Huang Jianan via Linux-erofs
  2022-02-23  7:28       ` Gao Xiang
  0 siblings, 1 reply; 10+ messages in thread
From: Huang Jianan via Linux-erofs @ 2022-02-23  7:19 UTC (permalink / raw
  To: Gao Xiang; +Cc: zhangshiming, linux-erofs

在 2022/2/18 14:20, Gao Xiang 写道:
> Hi Jianan,
>
> On Fri, Feb 18, 2022 at 11:11:37AM +0800, Huang Jianan via Linux-erofs wrote:
>> Fix some minor issues, including:
>>    - Align with the left parenthesis;
>>    - Spelling mistakes;
>>    - Remove redundant spaces and parenthesis;
>>    - clean up file headers;
>>    - Match parameters with format parameters.
>>
>> Signed-off-by: Huang Jianan <huangjianan@oppo.com>
>> ---
>>   dump/main.c                | 53 +++++++++++++++++++-------------------
>>   fsck/main.c                |  4 +--
>>   fuse/main.c                |  1 -
>>   include/erofs/block_list.h |  4 +--
>>   include/erofs/defs.h       |  1 -
>>   include/erofs/dir.h        |  2 +-
>>   include/erofs/internal.h   |  2 +-
>>   include/erofs/list.h       |  1 -
>>   lib/blobchunk.c            |  2 +-
>>   lib/cache.c                |  1 -
>>   lib/compress.c             |  2 +-
>>   lib/compress_hints.c       |  2 +-
>>   lib/compressor_liblzma.c   |  5 ++--
>>   lib/data.c                 |  2 +-
>>   lib/dir.c                  |  2 +-
>>   lib/exclude.c              |  2 +-
>>   lib/inode.c                |  2 +-
>>   lib/io.c                   |  2 +-
>>   lib/liberofs_private.h     |  2 +-
>>   lib/namei.c                |  1 -
>>   lib/super.c                |  4 +--
>>   lib/xattr.c                |  4 +--
>>   mkfs/main.c                |  2 +-
>>   23 files changed, 48 insertions(+), 55 deletions(-)
>>
>> diff --git a/dump/main.c b/dump/main.c
>> index e6198a0..3f8c2f2 100644
>> --- a/dump/main.c
>> +++ b/dump/main.c
>> @@ -179,7 +179,7 @@ static int erofsdump_parse_options_cfg(int argc, char **argv)
>>   }
>>   
>>   static int erofsdump_get_occupied_size(struct erofs_inode *inode,
>> -		erofs_off_t *size)
>> +				       erofs_off_t *size)
> There are two acceptable style (which follows kernel code style),
> 1) the one is aligned with the parentheses in the previous line;
> 2) the other is just using two indentations.
>
> So here we actually don't need to update... btw, was it reported
> by checkpatch.pl?

It was reported by checkpatch.pl with --strict. If these are unnecessary,
I can remove this type of modification from this patch, since there are
some other modifications.

Thanks,
Jianan

> Thanks,
> Gao Xiang


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] erofs-utils: fix some style problems
  2022-02-23  7:19     ` Huang Jianan via Linux-erofs
@ 2022-02-23  7:28       ` Gao Xiang
  2022-03-03  3:10         ` [PATCH v2] " Huang Jianan via Linux-erofs
  0 siblings, 1 reply; 10+ messages in thread
From: Gao Xiang @ 2022-02-23  7:28 UTC (permalink / raw
  To: Huang Jianan; +Cc: zhangshiming, linux-erofs

On Wed, Feb 23, 2022 at 03:19:59PM +0800, Huang Jianan wrote:
> 在 2022/2/18 14:20, Gao Xiang 写道:
> > Hi Jianan,
> > 
> > On Fri, Feb 18, 2022 at 11:11:37AM +0800, Huang Jianan via Linux-erofs wrote:
> > > Fix some minor issues, including:
> > >    - Align with the left parenthesis;
> > >    - Spelling mistakes;
> > >    - Remove redundant spaces and parenthesis;
> > >    - clean up file headers;
> > >    - Match parameters with format parameters.
> > > 
> > > Signed-off-by: Huang Jianan <huangjianan@oppo.com>
> > > ---
> > >   dump/main.c                | 53 +++++++++++++++++++-------------------
> > >   fsck/main.c                |  4 +--
> > >   fuse/main.c                |  1 -
> > >   include/erofs/block_list.h |  4 +--
> > >   include/erofs/defs.h       |  1 -
> > >   include/erofs/dir.h        |  2 +-
> > >   include/erofs/internal.h   |  2 +-
> > >   include/erofs/list.h       |  1 -
> > >   lib/blobchunk.c            |  2 +-
> > >   lib/cache.c                |  1 -
> > >   lib/compress.c             |  2 +-
> > >   lib/compress_hints.c       |  2 +-
> > >   lib/compressor_liblzma.c   |  5 ++--
> > >   lib/data.c                 |  2 +-
> > >   lib/dir.c                  |  2 +-
> > >   lib/exclude.c              |  2 +-
> > >   lib/inode.c                |  2 +-
> > >   lib/io.c                   |  2 +-
> > >   lib/liberofs_private.h     |  2 +-
> > >   lib/namei.c                |  1 -
> > >   lib/super.c                |  4 +--
> > >   lib/xattr.c                |  4 +--
> > >   mkfs/main.c                |  2 +-
> > >   23 files changed, 48 insertions(+), 55 deletions(-)
> > > 
> > > diff --git a/dump/main.c b/dump/main.c
> > > index e6198a0..3f8c2f2 100644
> > > --- a/dump/main.c
> > > +++ b/dump/main.c
> > > @@ -179,7 +179,7 @@ static int erofsdump_parse_options_cfg(int argc, char **argv)
> > >   }
> > >   static int erofsdump_get_occupied_size(struct erofs_inode *inode,
> > > -		erofs_off_t *size)
> > > +				       erofs_off_t *size)
> > There are two acceptable style (which follows kernel code style),
> > 1) the one is aligned with the parentheses in the previous line;
> > 2) the other is just using two indentations.
> > 
> > So here we actually don't need to update... btw, was it reported
> > by checkpatch.pl?
> 
> It was reported by checkpatch.pl with --strict. If these are unnecessary,
> I can remove this type of modification from this patch, since there are
> some other modifications.

Yeah, currently we could do like this.

Thanks,
Gao Xiang

> 
> Thanks,
> Jianan
> 
> > Thanks,
> > Gao Xiang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2] erofs-utils: fix some style problems
  2022-02-23  7:28       ` Gao Xiang
@ 2022-03-03  3:10         ` Huang Jianan via Linux-erofs
  0 siblings, 0 replies; 10+ messages in thread
From: Huang Jianan via Linux-erofs @ 2022-03-03  3:10 UTC (permalink / raw
  To: linux-erofs, hsiangkao; +Cc: zhangshiming

Fix some minor issues, including:
  - Spelling mistakes;
  - Remove redundant spaces and parenthesis;
  - clean up file headers;
  - Match parameters with format parameters.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
---
Changes since v1:
 - Removed modification related to alignment format;

 fuse/main.c              | 1 -
 include/erofs/defs.h     | 1 -
 include/erofs/dir.h      | 2 +-
 include/erofs/list.h     | 1 -
 lib/cache.c              | 1 -
 lib/compressor_liblzma.c | 2 --
 lib/inode.c              | 2 +-
 lib/io.c                 | 2 +-
 lib/namei.c              | 1 -
 lib/super.c              | 4 ++--
 mkfs/main.c              | 2 +-
 11 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/fuse/main.c b/fuse/main.c
index b869a00..90ed611 100644
--- a/fuse/main.c
+++ b/fuse/main.c
@@ -61,7 +61,6 @@ int erofsfuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
 #else
 	return erofs_iterate_dir(&ctx.ctx, true);
 #endif
-
 }
 
 static void *erofsfuse_init(struct fuse_conn_info *info)
diff --git a/include/erofs/defs.h b/include/erofs/defs.h
index e745bc0..e5aa23c 100644
--- a/include/erofs/defs.h
+++ b/include/erofs/defs.h
@@ -61,7 +61,6 @@ typedef int16_t         s16;
 typedef int32_t         s32;
 typedef int64_t         s64;
 
-
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 /*
  * The host byte order is the same as network byte order,
diff --git a/include/erofs/dir.h b/include/erofs/dir.h
index 1627d3d..74bffb5 100644
--- a/include/erofs/dir.h
+++ b/include/erofs/dir.h
@@ -42,7 +42,7 @@ struct erofs_dir_context {
 	/*
 	 * During execution of |erofs_iterate_dir|, the function needs to
 	 * read the values inside |erofs_inode* dir|. So it is important
-	 * that the callback function does not modify stuct pointed by
+	 * that the callback function does not modify struct pointed by
 	 * |dir|. It is OK to repoint |dir| to other objects.
 	 * Unfortunately, it's not possible to enforce this restriction
 	 * with const keyword, as |erofs_iterate_dir| needs to modify
diff --git a/include/erofs/list.h b/include/erofs/list.h
index 2a0e961..3f5da1a 100644
--- a/include/erofs/list.h
+++ b/include/erofs/list.h
@@ -110,7 +110,6 @@ static inline int list_empty(struct list_head *head)
 	     &pos->member != (head);                                           \
 	     pos = n, n = list_next_entry(n, member))
 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/cache.c b/lib/cache.c
index f820c0b..c735363 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -331,7 +331,6 @@ struct erofs_buffer_head *erofs_battach(struct erofs_buffer_head *bh,
 		return ERR_PTR(ret);
 	}
 	return nbh;
-
 }
 
 static erofs_blk_t __erofs_mapbh(struct erofs_buffer_block *bb)
diff --git a/lib/compressor_liblzma.c b/lib/compressor_liblzma.c
index acf442f..4886d6a 100644
--- a/lib/compressor_liblzma.c
+++ b/lib/compressor_liblzma.c
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0
 /*
- * erofs-utils/lib/compressor_liblzma.c
- *
  * Copyright (C) 2021 Gao Xiang <xiang@kernel.org>
  */
 #include <stdlib.h>
diff --git a/lib/inode.c b/lib/inode.c
index e680b23..5db4691 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -1108,7 +1108,7 @@ fail:
 		d->type = ftype;
 
 		erofs_d_invalidate(d);
-		erofs_info("add file %s/%s (nid %llu, type %d)",
+		erofs_info("add file %s/%s (nid %llu, type %u)",
 			   dir->i_srcpath, d->name, (unsigned long long)d->nid,
 			   d->type);
 	}
diff --git a/lib/io.c b/lib/io.c
index 5bc3432..9c663c5 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -370,7 +370,7 @@ ssize_t erofs_copy_file_range(int fd_in, erofs_off_t *off_in,
 	ssize_t ret;
 
 	ret = copy_file_range(fd_in, &off64_in, fd_out, &off64_out,
-                              length, 0);
+			      length, 0);
 	if (ret >= 0)
 		goto out;
 	if (errno != ENOSYS) {
diff --git a/lib/namei.c b/lib/namei.c
index 97f0f80..6163238 100644
--- a/lib/namei.c
+++ b/lib/namei.c
@@ -144,7 +144,6 @@ bogusimode:
 	return -EFSCORRUPTED;
 }
 
-
 struct erofs_dirent *find_target_dirent(erofs_nid_t pnid,
 					void *dentry_blk,
 					const char *name, unsigned int len,
diff --git a/lib/super.c b/lib/super.c
index 69522bd..f486eb7 100644
--- a/lib/super.c
+++ b/lib/super.c
@@ -15,7 +15,7 @@ static bool check_layout_compatibility(struct erofs_sb_info *sbi,
 	sbi->feature_incompat = feature;
 
 	/* check if current kernel meets all mandatory requirements */
-	if (feature & (~EROFS_ALL_FEATURE_INCOMPAT)) {
+	if (feature & ~EROFS_ALL_FEATURE_INCOMPAT) {
 		erofs_err("unidentified incompatible feature %x, please upgrade kernel version",
 			  feature & ~EROFS_ALL_FEATURE_INCOMPAT);
 		return false;
@@ -87,7 +87,7 @@ int erofs_read_superblock(void)
 	blkszbits = dsb->blkszbits;
 	/* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */
 	if (blkszbits != LOG_BLOCK_SIZE) {
-		erofs_err("blksize %u isn't supported on this platform",
+		erofs_err("blksize %d isn't supported on this platform",
 			  1 << blkszbits);
 		return ret;
 	}
diff --git a/mkfs/main.c b/mkfs/main.c
index 282126a..0724212 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -204,7 +204,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
 	bool quiet = false;
 
 	while ((opt = getopt_long(argc, argv, "C:E:T:U:d:x:z:",
-				 long_options, NULL)) != -1) {
+				  long_options, NULL)) != -1) {
 		switch (opt) {
 		case 'z':
 			if (!optarg) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-03-03  3:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-18  3:11 [PATCH] erofs-utils: check the return value of ftell Huang Jianan via Linux-erofs
2022-02-18  3:11 ` [PATCH] erofs-utils: fix memory leak when load compress hints file Huang Jianan via Linux-erofs
2022-02-18  7:02   ` Gao Xiang
2022-02-23  7:19     ` Huang Jianan via Linux-erofs
2022-02-18  3:11 ` [PATCH] erofs-utils: fix some style problems Huang Jianan via Linux-erofs
2022-02-18  6:20   ` Gao Xiang
2022-02-23  7:19     ` Huang Jianan via Linux-erofs
2022-02-23  7:28       ` Gao Xiang
2022-03-03  3:10         ` [PATCH v2] " Huang Jianan via Linux-erofs
2022-02-18  7:03 ` [PATCH] erofs-utils: check the return value of ftell Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).