All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 7094/8804] fs/ntfs3/file.c:1148 ntfs_file_write_iter() warn: inconsistent returns '&inode->i_rwsem'.
@ 2021-08-19  7:42 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-19  7:42 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 7963 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

Hi Konstantin,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f26c3abc432a2026ba9ee7767061a1f88aead6ec
commit: 6e5be40d32fb1907285277c02e74493ed43d77fe [7094/8804] fs/ntfs3: Add NTFS3 in fs/Kconfig and fs/Makefile
:::::: branch date: 24 hours ago
:::::: commit date: 6 days ago
config: i386-randconfig-m021-20210818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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

smatch warnings:
fs/ntfs3/file.c:1148 ntfs_file_write_iter() warn: inconsistent returns '&inode->i_rwsem'.
fs/ntfs3/fsntfs.c:803 ntfs_clear_mft_tail() error: uninitialized symbol 'err'.
fs/ntfs3/fsntfs.c:1264 ntfs_read_run_nb() error: uninitialized symbol 'clen'.
fs/ntfs3/fsntfs.c:1265 ntfs_read_run_nb() error: uninitialized symbol 'idx'.
fs/ntfs3/frecord.c:166 ni_load_mi_ex() error: we previously assumed 'r' could be null (see line 159)
fs/ntfs3/frecord.c:510 ni_ins_new_attr() error: we previously assumed 'le' could be null (see line 495)
fs/ntfs3/frecord.c:1439 ni_insert_nonresident() warn: potential memory corrupting cast 8 vs 2 bytes
fs/ntfs3/frecord.c:2559 ni_read_frame() warn: ignoring unreachable code.
fs/ntfs3/frecord.c:3070 ni_write_inode() warn: inconsistent returns '&ni->ni_lock'.
fs/ntfs3/namei.c:446 ntfs_rename() warn: variable dereferenced before check 'old_inode' (see line 312)
fs/ntfs3/xattr.c:529 ntfs_get_acl_ex() warn: passing zero to 'ERR_PTR'
fs/ntfs3/attrib.c:1093 attr_data_read_resident() warn: should 'page->index << 12' be a 64 bit type?
fs/ntfs3/attrib.c:1132 attr_data_write_resident() warn: should 'page->index << 12' be a 64 bit type?
fs/ntfs3/attrib.c:1353 attr_wof_frame_info() error: uninitialized symbol 'err'.
fs/ntfs3/attrib.c:1678 attr_allocate_frame() error: we previously assumed 'attr_b' could be null (see line 1591)
fs/ntfs3/index.c:561 hdr_find_split() warn: variable dereferenced before check 'e' (see line 559)
fs/ntfs3/index.c:1137 indx_find() warn: variable dereferenced before check 'fnd' (see line 1121)
fs/ntfs3/index.c:1375 indx_find_raw() error: we previously assumed 'n' could be null (see line 1353)
fs/ntfs3/index.c:1742 indx_insert_into_root() warn: possible memory leak of 're'
fs/ntfs3/fslog.c:2191 last_log_lsn() warn: possible memory leak of 'page_bufs'
fs/ntfs3/fslog.c:2404 find_log_rec() error: we previously assumed 'rh' could be null (see line 2391)
fs/ntfs3/fslog.c:2536 find_client_next_lsn() error: double free of 'lcb->lrh'
fs/ntfs3/fslog.c:638 enum_rstbl() error: we previously assumed 't' could be null (see line 627)
fs/ntfs3/fslog.c:3141 do_action() warn: variable dereferenced before check 'mi' (see line 3102)
fs/ntfs3/fslog.c:4737 log_replay() warn: Function too hairy.  No more merges.

vim +1148 fs/ntfs3/file.c

4342306f0f0d5f Konstantin Komarov 2021-08-13  1092  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1093  /*
4342306f0f0d5f Konstantin Komarov 2021-08-13  1094   * file_operations::write_iter
4342306f0f0d5f Konstantin Komarov 2021-08-13  1095   */
4342306f0f0d5f Konstantin Komarov 2021-08-13  1096  static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
4342306f0f0d5f Konstantin Komarov 2021-08-13  1097  {
4342306f0f0d5f Konstantin Komarov 2021-08-13  1098  	struct file *file = iocb->ki_filp;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1099  	struct address_space *mapping = file->f_mapping;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1100  	struct inode *inode = mapping->host;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1101  	ssize_t ret;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1102  	struct ntfs_inode *ni = ntfs_i(inode);
4342306f0f0d5f Konstantin Komarov 2021-08-13  1103  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1104  	if (is_encrypted(ni)) {
4342306f0f0d5f Konstantin Komarov 2021-08-13  1105  		ntfs_inode_warn(inode, "encrypted i/o not supported");
4342306f0f0d5f Konstantin Komarov 2021-08-13  1106  		return -EOPNOTSUPP;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1107  	}
4342306f0f0d5f Konstantin Komarov 2021-08-13  1108  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1109  	if (is_compressed(ni) && (iocb->ki_flags & IOCB_DIRECT)) {
4342306f0f0d5f Konstantin Komarov 2021-08-13  1110  		ntfs_inode_warn(inode, "direct i/o + compressed not supported");
4342306f0f0d5f Konstantin Komarov 2021-08-13  1111  		return -EOPNOTSUPP;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1112  	}
4342306f0f0d5f Konstantin Komarov 2021-08-13  1113  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1114  	if (is_dedup(ni)) {
4342306f0f0d5f Konstantin Komarov 2021-08-13  1115  		ntfs_inode_warn(inode, "write into deduplicated not supported");
4342306f0f0d5f Konstantin Komarov 2021-08-13  1116  		return -EOPNOTSUPP;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1117  	}
4342306f0f0d5f Konstantin Komarov 2021-08-13  1118  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1119  	if (!inode_trylock(inode)) {
4342306f0f0d5f Konstantin Komarov 2021-08-13  1120  		if (iocb->ki_flags & IOCB_NOWAIT)
4342306f0f0d5f Konstantin Komarov 2021-08-13  1121  			return -EAGAIN;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1122  		inode_lock(inode);
4342306f0f0d5f Konstantin Komarov 2021-08-13  1123  	}
4342306f0f0d5f Konstantin Komarov 2021-08-13  1124  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1125  	ret = generic_write_checks(iocb, from);
4342306f0f0d5f Konstantin Komarov 2021-08-13  1126  	if (ret <= 0)
4342306f0f0d5f Konstantin Komarov 2021-08-13  1127  		goto out;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1128  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1129  	if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) {
4342306f0f0d5f Konstantin Komarov 2021-08-13  1130  		/* should never be here, see ntfs_file_open*/
4342306f0f0d5f Konstantin Komarov 2021-08-13  1131  		ret = -EOPNOTSUPP;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1132  		goto out;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1133  	}
4342306f0f0d5f Konstantin Komarov 2021-08-13  1134  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1135  	ret = ntfs_extend(inode, iocb->ki_pos, ret, file);
4342306f0f0d5f Konstantin Komarov 2021-08-13  1136  	if (ret)
4342306f0f0d5f Konstantin Komarov 2021-08-13  1137  		goto out;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1138  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1139  	ret = is_compressed(ni) ? ntfs_compress_write(iocb, from)
4342306f0f0d5f Konstantin Komarov 2021-08-13  1140  				: __generic_file_write_iter(iocb, from);
4342306f0f0d5f Konstantin Komarov 2021-08-13  1141  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1142  out:
4342306f0f0d5f Konstantin Komarov 2021-08-13  1143  	inode_unlock(inode);
4342306f0f0d5f Konstantin Komarov 2021-08-13  1144  
4342306f0f0d5f Konstantin Komarov 2021-08-13  1145  	if (ret > 0)
4342306f0f0d5f Konstantin Komarov 2021-08-13  1146  		ret = generic_write_sync(iocb, ret);
4342306f0f0d5f Konstantin Komarov 2021-08-13  1147  
4342306f0f0d5f Konstantin Komarov 2021-08-13 @1148  	return ret;
4342306f0f0d5f Konstantin Komarov 2021-08-13  1149  }
4342306f0f0d5f Konstantin Komarov 2021-08-13  1150  

:::::: The code at line 1148 was first introduced by commit
:::::: 4342306f0f0d5ff4315a204d315c1b51b914fca5 fs/ntfs3: Add file operations and implementation

:::::: TO: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
:::::: CC: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38800 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-19  7:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19  7:42 [linux-next:master 7094/8804] fs/ntfs3/file.c:1148 ntfs_file_write_iter() warn: inconsistent returns '&inode->i_rwsem' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.