Hello Chao Yu,

The patch bce86a6c64a7: "f2fs: reorganize f2fs_map_blocks" from Sep
11, 2015, leads to the following static checker warning:

        fs/f2fs/data.c:653 f2fs_map_blocks()
        warn: was || intended here instead of &&?

fs/f2fs/data.c
   650          if (maxblocks > map->m_len) {
   651                  block_t blkaddr = datablock_addr(dn.node_page, 
dn.ofs_in_node);
   652  
   653                  if (blkaddr == NEW_ADDR && blkaddr == NULL_ADDR) {
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Impossible condition.

   654                          if (create) {
   655                                  err = __allocate_data_block(&dn);
   656                                  if (err)
   657                                          goto sync_out;
   658                                  allocated = true;
   659                                  map->m_flags |= F2FS_MAP_NEW;
   660                                  blkaddr = dn.data_blkaddr;
   661                          } else {
   662                                  /*
   663                                   * we only merge preallocated unwritten 
blocks
   664                                   * for fiemap.
   665                                   */
   666                                  if (flag != F2FS_GET_BLOCK_FIEMAP ||
   667                                                  blkaddr != NEW_ADDR)
   668                                          goto sync_out;
   669                          }
   670                  }

regards,
dan carpenter

------------------------------------------------------------------------------
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to