Re: [PATCH 1/3] nfsd: call svc_fill_write_vector from nfsd_vfs_write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

kernel test robot noticed the following build warnings:

[auto build test WARNING on brauner-vfs/vfs.all]
[also build test WARNING on trondmy-nfs/linux-next linus/master v6.15-rc5]
[cannot apply to next-20250508]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Christoph-Hellwig/nfsd-use-rq_bvec-instead-of-rq_vec-in-nfsd_vfs_write/20250507-205615
base:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link:    https://lore.kernel.org/r/20250507115617.3995150-2-hch%40lst.de
patch subject: [PATCH 1/3] nfsd: call svc_fill_write_vector from nfsd_vfs_write
config: x86_64-randconfig-121-20250508 (https://download.01.org/0day-ci/archive/20250509/202505090631.R8lqfckA-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250509/202505090631.R8lqfckA-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505090631.R8lqfckA-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> fs/nfsd/vfs.c:1167:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted __be32 @@     got int @@
   fs/nfsd/vfs.c:1167:24: sparse:     expected restricted __be32
   fs/nfsd/vfs.c:1167:24: sparse:     got int

vim +1167 fs/nfsd/vfs.c

  1142	
  1143	__be32
  1144	nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
  1145			loff_t offset, struct xdr_buf *payload, unsigned long *cnt,
  1146			int stable, __be32 *verf)
  1147	{
  1148		struct nfsd_net		*nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
  1149		struct file		*file = nf->nf_file;
  1150		struct super_block	*sb = file_inode(file)->i_sb;
  1151		struct svc_export	*exp;
  1152		struct iov_iter		iter;
  1153		errseq_t		since;
  1154		__be32			nfserr;
  1155		int			host_err;
  1156		loff_t			pos = offset;
  1157		unsigned long		exp_op_flags = 0;
  1158		unsigned int		pflags = current->flags;
  1159		rwf_t			flags = 0;
  1160		bool			restore_flags = false;
  1161		unsigned int		nvecs;
  1162	
  1163		trace_nfsd_write_opened(rqstp, fhp, offset, *cnt);
  1164	
  1165		nvecs = svc_fill_write_vector(rqstp, payload);
  1166		if (WARN_ON_ONCE(nvecs > ARRAY_SIZE(rqstp->rq_vec)))
> 1167			return -EIO;
  1168	
  1169		if (sb->s_export_op)
  1170			exp_op_flags = sb->s_export_op->flags;
  1171	
  1172		if (test_bit(RQ_LOCAL, &rqstp->rq_flags) &&
  1173		    !(exp_op_flags & EXPORT_OP_REMOTE_FS)) {
  1174			/*
  1175			 * We want throttling in balance_dirty_pages()
  1176			 * and shrink_inactive_list() to only consider
  1177			 * the backingdev we are writing to, so that nfs to
  1178			 * localhost doesn't cause nfsd to lock up due to all
  1179			 * the client's dirty pages or its congested queue.
  1180			 */
  1181			current->flags |= PF_LOCAL_THROTTLE;
  1182			restore_flags = true;
  1183		}
  1184	
  1185		exp = fhp->fh_export;
  1186	
  1187		if (!EX_ISSYNC(exp))
  1188			stable = NFS_UNSTABLE;
  1189	
  1190		if (stable && !fhp->fh_use_wgather)
  1191			flags |= RWF_SYNC;
  1192	
  1193		iov_iter_kvec(&iter, ITER_SOURCE, rqstp->rq_vec, nvecs, *cnt);
  1194		since = READ_ONCE(file->f_wb_err);
  1195		if (verf)
  1196			nfsd_copy_write_verifier(verf, nn);
  1197		host_err = vfs_iter_write(file, &iter, &pos, flags);
  1198		if (host_err < 0) {
  1199			commit_reset_write_verifier(nn, rqstp, host_err);
  1200			goto out_nfserr;
  1201		}
  1202		*cnt = host_err;
  1203		nfsd_stats_io_write_add(nn, exp, *cnt);
  1204		fsnotify_modify(file);
  1205		host_err = filemap_check_wb_err(file->f_mapping, since);
  1206		if (host_err < 0)
  1207			goto out_nfserr;
  1208	
  1209		if (stable && fhp->fh_use_wgather) {
  1210			host_err = wait_for_concurrent_writes(file);
  1211			if (host_err < 0)
  1212				commit_reset_write_verifier(nn, rqstp, host_err);
  1213		}
  1214	
  1215	out_nfserr:
  1216		if (host_err >= 0) {
  1217			trace_nfsd_write_io_done(rqstp, fhp, offset, *cnt);
  1218			nfserr = nfs_ok;
  1219		} else {
  1220			trace_nfsd_write_err(rqstp, fhp, offset, host_err);
  1221			nfserr = nfserrno(host_err);
  1222		}
  1223		if (restore_flags)
  1224			current_restore_flags(pflags, PF_LOCAL_THROTTLE);
  1225		return nfserr;
  1226	}
  1227	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux