f2fs: avoid m_flags overlay when allocating more data blocks
authorKinglong Mee <kinglongmee@gmail.com>
Thu, 23 Feb 2017 11:55:05 +0000 (19:55 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 27 Feb 2017 17:59:52 +0000 (09:59 -0800)
When more than one data blocks are allocated, the F2FS_MAP_UNWRITTEN/MAPPED
flags will be overlapped by F2FS_MAP_NEW at the later times.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index f72493d8c8e4ed617a4f01ea7bbd3c2657eb358a..80f9863dc4b0cf8b7561b65fe139d33b8084a05e 100644 (file)
@@ -867,7 +867,7 @@ next_block:
                        }
                        if (err)
                                goto sync_out;
-                       map->m_flags = F2FS_MAP_NEW;
+                       map->m_flags |= F2FS_MAP_NEW;
                        blkaddr = dn.data_blkaddr;
                } else {
                        if (flag == F2FS_GET_BLOCK_BMAP) {