* [jlayton:nfsd-fadvise 10/10] fs/nfsd/vfs.c:1277:2: warning: unannotated fall-through between switch labels
@ 2025-07-09 1:16 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-07-09 1:16 UTC (permalink / raw)
To: Jeff Layton; +Cc: llvm, oe-kbuild-all
[-- Attachment #1: Type: text/plain, Size: 10757 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git nfsd-fadvise
head: 790eb4993915b8777f54cf053ee714e6c8613405
commit: 790eb4993915b8777f54cf053ee714e6c8613405 [10/10] nfsd: add a NFSD_IO_FADVISE setting to io_cache_write
:::::: branch date: 26 hours ago
:::::: commit date: 26 hours ago
config: x86_64-kexec (attached as .config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)
reproduce (this is a W=1 build): (attached as 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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507090137.X55jloEb-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/nfsd/vfs.c:1277:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
1277 | case NFSD_IO_BUFFERED:
| ^
fs/nfsd/vfs.c:1277:2: note: insert 'break;' to avoid fall-through
1277 | case NFSD_IO_BUFFERED:
| ^
| break;
1 warning generated.
vim +1277 fs/nfsd/vfs.c
d911df7b8d44de J. Bruce Fields 2009-06-15 1198
f2e597353d50f0 Chuck Lever 2025-05-09 1199 /**
f2e597353d50f0 Chuck Lever 2025-05-09 1200 * nfsd_vfs_write - write data to an already-open file
f2e597353d50f0 Chuck Lever 2025-05-09 1201 * @rqstp: RPC execution context
f2e597353d50f0 Chuck Lever 2025-05-09 1202 * @fhp: File handle of file to write into
f2e597353d50f0 Chuck Lever 2025-05-09 1203 * @nf: An open file matching @fhp
f2e597353d50f0 Chuck Lever 2025-05-09 1204 * @offset: Byte offset of start
f2e597353d50f0 Chuck Lever 2025-05-09 1205 * @payload: xdr_buf containing the write payload
f2e597353d50f0 Chuck Lever 2025-05-09 1206 * @cnt: IN: number of bytes to write, OUT: number of bytes actually written
f2e597353d50f0 Chuck Lever 2025-05-09 1207 * @stable: An NFS stable_how value
f2e597353d50f0 Chuck Lever 2025-05-09 1208 * @verf: NFS WRITE verifier
f2e597353d50f0 Chuck Lever 2025-05-09 1209 *
f2e597353d50f0 Chuck Lever 2025-05-09 1210 * Upon return, caller must invoke fh_put on @fhp.
f2e597353d50f0 Chuck Lever 2025-05-09 1211 *
f2e597353d50f0 Chuck Lever 2025-05-09 1212 * Return values:
f2e597353d50f0 Chuck Lever 2025-05-09 1213 * An nfsstat value in network byte order.
f2e597353d50f0 Chuck Lever 2025-05-09 1214 */
af90f707fa6d54 Christoph Hellwig 2015-06-18 1215 __be32
f2e597353d50f0 Chuck Lever 2025-05-09 1216 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp,
f2e597353d50f0 Chuck Lever 2025-05-09 1217 struct nfsd_file *nf, loff_t offset,
f2e597353d50f0 Chuck Lever 2025-05-09 1218 const struct xdr_buf *payload, unsigned long *cnt,
f2e597353d50f0 Chuck Lever 2025-05-09 1219 int stable, __be32 *verf)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1220 {
fb7622c2dbd1aa Chuck Lever 2021-12-28 1221 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
16f8f894108270 Trond Myklebust 2020-01-06 1222 struct file *file = nf->nf_file;
01cbf3853959fe Trond Myklebust 2020-11-30 1223 struct super_block *sb = file_inode(file)->i_sb;
99223b5d289986 Chuck Lever 2025-06-13 1224 struct kiocb kiocb;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1225 struct svc_export *exp;
73da852e3831bd Christoph Hellwig 2017-05-27 1226 struct iov_iter iter;
555dbf1a9aac6d Trond Myklebust 2021-12-18 1227 errseq_t since;
d890be159a7139 Chuck Lever 2018-03-27 1228 __be32 nfserr;
6264d69d7df654 Al Viro 2006-10-19 1229 int host_err;
01cbf3853959fe Trond Myklebust 2020-11-30 1230 unsigned long exp_op_flags = 0;
8658452e4a588d NeilBrown 2014-05-12 1231 unsigned int pflags = current->flags;
01cbf3853959fe Trond Myklebust 2020-11-30 1232 bool restore_flags = false;
f2e597353d50f0 Chuck Lever 2025-05-09 1233 unsigned int nvecs;
8658452e4a588d NeilBrown 2014-05-12 1234
d890be159a7139 Chuck Lever 2018-03-27 1235 trace_nfsd_write_opened(rqstp, fhp, offset, *cnt);
d890be159a7139 Chuck Lever 2018-03-27 1236
01cbf3853959fe Trond Myklebust 2020-11-30 1237 if (sb->s_export_op)
01cbf3853959fe Trond Myklebust 2020-11-30 1238 exp_op_flags = sb->s_export_op->flags;
01cbf3853959fe Trond Myklebust 2020-11-30 1239
01cbf3853959fe Trond Myklebust 2020-11-30 1240 if (test_bit(RQ_LOCAL, &rqstp->rq_flags) &&
01cbf3853959fe Trond Myklebust 2020-11-30 1241 !(exp_op_flags & EXPORT_OP_REMOTE_FS)) {
8658452e4a588d NeilBrown 2014-05-12 1242 /*
a37b0715ddf300 NeilBrown 2020-06-01 1243 * We want throttling in balance_dirty_pages()
a37b0715ddf300 NeilBrown 2020-06-01 1244 * and shrink_inactive_list() to only consider
a37b0715ddf300 NeilBrown 2020-06-01 1245 * the backingdev we are writing to, so that nfs to
8658452e4a588d NeilBrown 2014-05-12 1246 * localhost doesn't cause nfsd to lock up due to all
8658452e4a588d NeilBrown 2014-05-12 1247 * the client's dirty pages or its congested queue.
8658452e4a588d NeilBrown 2014-05-12 1248 */
a37b0715ddf300 NeilBrown 2020-06-01 1249 current->flags |= PF_LOCAL_THROTTLE;
01cbf3853959fe Trond Myklebust 2020-11-30 1250 restore_flags = true;
01cbf3853959fe Trond Myklebust 2020-11-30 1251 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1252
^1da177e4c3f41 Linus Torvalds 2005-04-16 1253 exp = fhp->fh_export;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1254
^1da177e4c3f41 Linus Torvalds 2005-04-16 1255 if (!EX_ISSYNC(exp))
54bbb7d206db78 Kinglong Mee 2016-12-31 1256 stable = NFS_UNSTABLE;
99223b5d289986 Chuck Lever 2025-06-13 1257 init_sync_kiocb(&kiocb, file);
99223b5d289986 Chuck Lever 2025-06-13 1258 kiocb.ki_pos = offset;
c689bdd3bffad8 NeilBrown 2024-07-26 1259 if (stable && !fhp->fh_use_wgather)
99223b5d289986 Chuck Lever 2025-06-13 1260 kiocb.ki_flags |= IOCB_DSYNC;
24368aad47dc65 Christoph Hellwig 2016-04-07 1261
1969823caf1635 Chuck Lever 2025-05-06 1262 nvecs = xdr_buf_to_bvec(rqstp->rq_bvec, rqstp->rq_maxpages, payload);
1969823caf1635 Chuck Lever 2025-05-06 1263 iov_iter_bvec(&iter, ITER_SOURCE, rqstp->rq_bvec, nvecs, *cnt);
198bc27df52244 Mike Snitzer 2025-06-16 1264
198bc27df52244 Mike Snitzer 2025-06-16 1265 switch (nfsd_io_cache_write) {
198bc27df52244 Mike Snitzer 2025-06-16 1266 case NFSD_IO_DIRECT:
198bc27df52244 Mike Snitzer 2025-06-16 1267 if (iov_iter_is_aligned(&iter, nf->nf_dio_mem_align - 1,
198bc27df52244 Mike Snitzer 2025-06-16 1268 nf->nf_dio_offset_align - 1))
198bc27df52244 Mike Snitzer 2025-06-16 1269 kiocb.ki_flags = IOCB_DIRECT;
198bc27df52244 Mike Snitzer 2025-06-16 1270 break;
198bc27df52244 Mike Snitzer 2025-06-16 1271 case NFSD_IO_DONTCACHE:
198bc27df52244 Mike Snitzer 2025-06-16 1272 kiocb.ki_flags = IOCB_DONTCACHE;
198bc27df52244 Mike Snitzer 2025-06-16 1273 break;
790eb4993915b8 Jeff Layton 2025-07-07 1274 case NFSD_IO_FADVISE:
790eb4993915b8 Jeff Layton 2025-07-07 1275 if (stable)
790eb4993915b8 Jeff Layton 2025-07-07 1276 kiocb.ki_flags = IOCB_DONTCACHE;
198bc27df52244 Mike Snitzer 2025-06-16 @1277 case NFSD_IO_BUFFERED:
198bc27df52244 Mike Snitzer 2025-06-16 1278 break;
198bc27df52244 Mike Snitzer 2025-06-16 1279 }
198bc27df52244 Mike Snitzer 2025-06-16 1280
555dbf1a9aac6d Trond Myklebust 2021-12-18 1281 since = READ_ONCE(file->f_wb_err);
f11ad7aa653130 Chuck Lever 2021-12-28 1282 if (verf)
3988a57885eeac Chuck Lever 2021-12-30 1283 nfsd_copy_write_verifier(verf, nn);
99223b5d289986 Chuck Lever 2025-06-13 1284 host_err = vfs_iocb_iter_write(file, &kiocb, &iter);
7bf94c6ba9fb29 Trond Myklebust 2020-01-06 1285 if (host_err < 0) {
1b2021bdeeca12 Trond Myklebust 2023-09-11 1286 commit_reset_write_verifier(nn, rqstp, host_err);
e4636d535e3276 J. Bruce Fields 2009-06-15 1287 goto out_nfserr;
7bf94c6ba9fb29 Trond Myklebust 2020-01-06 1288 }
09a80f2aef06b7 Trond Myklebust 2019-12-17 1289 *cnt = host_err;
4b14885411f74b Josef Bacik 2024-01-26 1290 nfsd_stats_io_write_add(nn, exp, *cnt);
2a12a9d7814631 Eric Paris 2009-12-17 1291 fsnotify_modify(file);
555dbf1a9aac6d Trond Myklebust 2021-12-18 1292 host_err = filemap_check_wb_err(file->f_mapping, since);
555dbf1a9aac6d Trond Myklebust 2021-12-18 1293 if (host_err < 0)
555dbf1a9aac6d Trond Myklebust 2021-12-18 1294 goto out_nfserr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1295
c689bdd3bffad8 NeilBrown 2024-07-26 1296 if (stable && fhp->fh_use_wgather) {
d911df7b8d44de J. Bruce Fields 2009-06-15 1297 host_err = wait_for_concurrent_writes(file);
1b2021bdeeca12 Trond Myklebust 2023-09-11 1298 if (host_err < 0)
1b2021bdeeca12 Trond Myklebust 2023-09-11 1299 commit_reset_write_verifier(nn, rqstp, host_err);
bbf2f098838aa8 Trond Myklebust 2019-09-02 1300 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1301
e4636d535e3276 J. Bruce Fields 2009-06-15 1302 out_nfserr:
d890be159a7139 Chuck Lever 2018-03-27 1303 if (host_err >= 0) {
d890be159a7139 Chuck Lever 2018-03-27 1304 trace_nfsd_write_io_done(rqstp, fhp, offset, *cnt);
d890be159a7139 Chuck Lever 2018-03-27 1305 nfserr = nfs_ok;
d890be159a7139 Chuck Lever 2018-03-27 1306 } else {
d890be159a7139 Chuck Lever 2018-03-27 1307 trace_nfsd_write_err(rqstp, fhp, offset, host_err);
d890be159a7139 Chuck Lever 2018-03-27 1308 nfserr = nfserrno(host_err);
d890be159a7139 Chuck Lever 2018-03-27 1309 }
01cbf3853959fe Trond Myklebust 2020-11-30 1310 if (restore_flags)
a37b0715ddf300 NeilBrown 2020-06-01 1311 current_restore_flags(pflags, PF_LOCAL_THROTTLE);
d890be159a7139 Chuck Lever 2018-03-27 1312 return nfserr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1313 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1314
:::::: The code at line 1277 was first introduced by commit
:::::: 198bc27df52244f0e8a420e7a40552c3ac45c905 NFSD: add io_cache_write controls to debugfs interface
:::::: TO: Mike Snitzer <snitzer@kernel.org>
:::::: CC: Jeff Layton <jlayton@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33338 bytes --]
[-- Attachment #3: reproduce --]
[-- Type: text/plain, Size: 821 bytes --]
reproduce (this is a W=1 build):
git clone https://github.com/intel/lkp-tests.git ~/lkp-tests
# https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/?id=790eb4993915b8777f54cf053ee714e6c8613405
git remote add jlayton https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
git fetch --no-tags jlayton nfsd-fadvise
git checkout 790eb4993915b8777f54cf053ee714e6c8613405
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang-20 ~/lkp-tests/kbuild/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang-20 ~/lkp-tests/kbuild/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/tty/serial/8250/ fs/nfsd/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-09 1:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 1:16 [jlayton:nfsd-fadvise 10/10] fs/nfsd/vfs.c:1277:2: warning: unannotated fall-through between switch labels kernel test robot
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).