linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* Re: f2fs: introduce f2fs_issue_discard() to clean up
@ 2013-11-26 14:53 Dan Carpenter
  2013-11-27  2:46 ` Jaegeuk Kim
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Carpenter @ 2013-11-26 14:53 UTC (permalink / raw)
  To: jaegeuk.kim; +Cc: linux-f2fs-devel

Hello Jaegeuk Kim,

The patch 3fa7fb17dc9a: "f2fs: introduce f2fs_issue_discard() to clean
up" from Nov 12, 2013, leads to the following static checker warning:
	"fs/f2fs/segment.c:274 f2fs_issue_discard()
	 warn: should 'blklen << sbi->log_sectors_per_block' be a 64 bit
	 type?"

fs/f2fs/segment.c
   270  static void f2fs_issue_discard(struct f2fs_sb_info *sbi,
   271                                  block_t blkstart, block_t blklen)
   272  {
   273          sector_t sector_addr = blkstart << sbi->log_sectors_per_block;
   274          sector_t sector_len = blklen << sbi->log_sectors_per_block;

block_t is a 32 bit type and sector_t is a 64 bit type.  The upper 32
bits of the sector_t are not used because the shift will wrap.

   275  
   276          blkdev_issue_discard(sbi->sb->s_bdev, sector_addr, sector_len,
   277                                                          GFP_NOFS, 0);
   278          trace_f2fs_issue_discard(sbi->sb, blkstart, blklen);
   279  }

regards,
dan carpenter


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk

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

end of thread, other threads:[~2013-11-28  9:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-26 14:53 f2fs: introduce f2fs_issue_discard() to clean up Dan Carpenter
2013-11-27  2:46 ` Jaegeuk Kim
2013-11-27  8:31   ` Dan Carpenter
2013-11-27  9:04     ` Jaegeuk Kim
2013-11-27 10:41       ` Dan Carpenter
2013-11-28  4:04         ` Jaegeuk Kim
2013-11-28  8:08           ` Dan Carpenter
2013-11-28  9:24             ` Jaegeuk Kim
2013-11-28  9:45               ` Dan Carpenter

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).