[FOR INTERNAL REVIEW] [PATCH 1/4] staging: erofs: add the missing break in z_erofs_map_blocks_iter

Gao Xiang gaoxiang25 at huawei.com
Mon Jul 30 19:18:28 AEST 2018


This patch adds a missing break after adding the default case.

Signed-off-by: Gao Xiang <gaoxiang25 at huawei.com>
---

- Tested with images generated by mkfs.erofs:
   1) mount and unmount operations
   2) md5sum `find . -type f`

 drivers/staging/erofs/unzip_vle.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c
index bd2d7a8..6d3ab31 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -1596,10 +1596,10 @@ int z_erofs_map_blocks_iter(struct inode *inode,
 	cluster_type = vle_cluster_type(di);
 
 	switch (cluster_type) {
-	case Z_EROFS_VLE_CLUSTER_TYPE_PLAIN:
+	case Z_EROFS_VLE_CLUSTER_TYPE_PLAIN:	/* fallthrough */
 		if (ofs_rem >= logical_cluster_ofs)
 			map->m_flags ^= EROFS_MAP_ZIPPED;
-	case Z_EROFS_VLE_CLUSTER_TYPE_HEAD:
+	case Z_EROFS_VLE_CLUSTER_TYPE_HEAD:	/* fallthrough */
 		if (ofs_rem == logical_cluster_ofs) {
 			pcn = le32_to_cpu(di->di_u.blkaddr);
 			goto exact_hitted;
@@ -1624,6 +1624,7 @@ int z_erofs_map_blocks_iter(struct inode *inode,
 		ofs = vle_get_logical_extent_head(inode, mpage_ret,
 			&kaddr, lcn, &pcn, &map->m_flags);
 		mpage = *mpage_ret;
+		break;
 	default:
 		errln("unknown cluster type %u at offset %llu of nid %llu",
 			cluster_type, ofs, EROFS_V(inode)->nid);
-- 
1.9.1



More information about the Linux-erofs mailing list