lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202203162210.u0O3mmI4-lkp@intel.com>
Date:   Wed, 16 Mar 2022 18:08:09 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [willy-pagecache:for-next 174/179] fs/nilfs2/inode.c:232
 nilfs_dirty_folio() error: uninitialized symbol 'nr_dirty'.

tree:   git://git.infradead.org/users/willy/pagecache for-next
head:   223ab4ed54499645015108bfbb3055e0f8c64613
commit: c5abb86e384b80b5b320c73668066e67142c706e [174/179] nilfs: Convert nilfs_set_page_dirty() to nilfs_dirty_folio()
config: x86_64-randconfig-m001-20220314 (https://download.01.org/0day-ci/archive/20220316/202203162210.u0O3mmI4-lkp@intel.com/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

New smatch warnings:
fs/nilfs2/inode.c:232 nilfs_dirty_folio() error: uninitialized symbol 'nr_dirty'.

Old smatch warnings:
fs/nilfs2/inode.c:1084 nilfs_fiemap() warn: should 'n << blkbits' be a 64 bit type?
fs/nilfs2/inode.c:1097 nilfs_fiemap() warn: should 'n << blkbits' be a 64 bit type?
fs/nilfs2/inode.c:1104 nilfs_fiemap() warn: should 'n << blkbits' be a 64 bit type?

vim +/nr_dirty +232 fs/nilfs2/inode.c

c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  202) static bool nilfs_dirty_folio(struct address_space *mapping,
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  203) 		struct folio *folio)
05fe58fdc10df9e Ryusuke Konishi         2009-04-06  204  {
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  205) 	struct inode *inode = mapping->host;
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  206) 	struct buffer_head *head;
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  207) 	unsigned int nr_dirty;
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  208) 	bool ret = filemap_dirty_folio(mapping, folio);
05fe58fdc10df9e Ryusuke Konishi         2009-04-06  209  
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  210  	/*
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  211) 	 * The page may not be locked, eg if called from try_to_unmap_one()
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  212  	 */
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  213) 	spin_lock(&mapping->private_lock);
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  214) 	head = folio_buffers(folio);
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  215) 	if (head) {
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  216) 		struct buffer_head *bh = head;
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  217) 
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  218) 		nr_dirty = 0;
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  219  		do {
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  220  			/* Do not mark hole blocks dirty */
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  221  			if (buffer_dirty(bh) || !buffer_mapped(bh))
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  222  				continue;
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  223  
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  224  			set_buffer_dirty(bh);
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  225  			nr_dirty++;
136e8770cd5d1fe Ryusuke Konishi         2013-05-24  226  		} while (bh = bh->b_this_page, bh != head);
56d7acc792c0d98 Andreas Rohner          2014-09-25  227  	} else if (ret) {
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  228) 		nr_dirty = 1 << (PAGE_SHIFT - inode->i_blkbits);
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  229) 	}

No else path.

c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09  230) 	spin_unlock(&mapping->private_lock);
56d7acc792c0d98 Andreas Rohner          2014-09-25  231  
c5abb86e384b80b Matthew Wilcox (Oracle  2022-02-09 @232) 	if (nr_dirty)
bcbc8c648d6cc88 Ryusuke Konishi         2010-12-27  233  		nilfs_set_file_dirty(inode, nr_dirty);
05fe58fdc10df9e Ryusuke Konishi         2009-04-06  234  	return ret;
05fe58fdc10df9e Ryusuke Konishi         2009-04-06  235  }

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ