linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* Re: f2fs: reorganize f2fs_map_blocks
@ 2015-09-21 16:25 Dan Carpenter
  2015-09-21 18:43 ` Jaegeuk Kim
  2015-09-22 13:21 ` Chao Yu
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-09-21 16:25 UTC (permalink / raw)
  To: chao2.yu; +Cc: linux-f2fs-devel

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

------------------------------------------------------------------------------

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

* Re: f2fs: reorganize f2fs_map_blocks
  2015-09-21 16:25 f2fs: reorganize f2fs_map_blocks Dan Carpenter
@ 2015-09-21 18:43 ` Jaegeuk Kim
  2015-09-22 13:21 ` Chao Yu
  1 sibling, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2015-09-21 18:43 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-f2fs-devel

Hi Dan,

New patch was already introduced before. :)
I'm too lazy to rebase that patch.
Sorry for the confusion.

Thanks,

On Mon, Sep 21, 2015 at 07:25:08PM +0300, Dan Carpenter wrote:
> 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

------------------------------------------------------------------------------

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

* Re: f2fs: reorganize f2fs_map_blocks
  2015-09-21 16:25 f2fs: reorganize f2fs_map_blocks Dan Carpenter
  2015-09-21 18:43 ` Jaegeuk Kim
@ 2015-09-22 13:21 ` Chao Yu
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2015-09-22 13:21 UTC (permalink / raw)
  To: 'Dan Carpenter'; +Cc: linux-f2fs-devel

Hi Dan,

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Tuesday, September 22, 2015 12:25 AM
> To: chao2.yu@samsung.com
> Cc: linux-f2fs-devel@lists.sourceforge.net
> Subject: re: f2fs: reorganize f2fs_map_blocks
> 
> 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.

Thanks for pointing it out. :)

My v2 patch sent several days ago has fixed that issue.

Thanks,


------------------------------------------------------------------------------

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

end of thread, other threads:[~2015-09-22 13:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 16:25 f2fs: reorganize f2fs_map_blocks Dan Carpenter
2015-09-21 18:43 ` Jaegeuk Kim
2015-09-22 13:21 ` Chao Yu

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 NNTP newsgroup(s).