From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: fs/iomap/direct-io.c:939:36-37: WARNING opportunity for min()
Date: Fri, 06 Nov 2026 09:42:35 +0100 [thread overview]
Message-ID: <202611060930.LoRvnTKC-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Fengnan Chang <changfengnan@bytedance.com>
CC: Christian Brauner <brauner@kernel.org>
CC: Christoph Hellwig <hch@lst.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f66469d9905b39d2c260a15d7d6db450f4db67c1
commit: 36f199c8d0ee4b8dab3559c8bc23dd5e7c366972 iomap: add simple dio path for small direct I/O
date: 3 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 3 months ago
config: loongarch-randconfig-r2105-20261104 (https://download.01.org/0day-ci/archive/20261106/202611060930.LoRvnTKC-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project e2e3d6c39cfebec9eace23629a5a103df2c79ba6)
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
| Fixes: 36f199c8d0ee ("iomap: add simple dio path for small direct I/O")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202611060930.LoRvnTKC-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> fs/iomap/direct-io.c:939:36-37: WARNING opportunity for min()
vim +939 fs/iomap/direct-io.c
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 913
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 914 static ssize_t iomap_dio_simple_complete(struct iomap_dio_simple *sr)
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 915 {
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 916 struct bio *bio = &sr->bio;
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 917 struct kiocb *iocb = sr->iocb;
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 918 struct inode *inode = file_inode(iocb->ki_filp);
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 919 ssize_t ret;
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 920
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 921 if (unlikely(bio->bi_status)) {
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 922 ret = blk_status_to_errno(bio->bi_status);
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 923 if (should_report_dio_fserror(ret))
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 924 fserror_report_io(inode, FSERR_DIRECTIO_READ,
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 925 iocb->ki_pos, sr->size, ret,
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 926 GFP_NOFS);
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 927 } else {
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 928 ret = sr->size;
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 929 iocb->ki_pos += ret;
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 930 }
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 931
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 932 if (sr->dio_flags & IOMAP_DIO_USER_BACKED) {
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 933 bio_check_pages_dirty(bio);
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 934 } else {
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 935 bio_release_pages(bio, false);
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 936 bio_put(bio);
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 937 }
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 938 inode_dio_end(inode);
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 @939 trace_iomap_dio_complete(iocb, ret < 0 ? ret : 0, ret);
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 940 return ret;
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 941 }
36f199c8d0ee4b8 Fengnan Chang 2026-07-01 942
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-11-06 8:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202611060930.LoRvnTKC-lkp@intel.com \
--to=lkp@intel.com \
--cc=julia.lawall@inria.fr \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox