From: kernel test robot <lkp@intel.com>
To: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>
Cc: kbuild-all@lists.01.org, linux-block@vger.kernel.org,
Christoph Hellwig <hch@lst.de>, Ming Lei <ming.lei@redhat.com>
Subject: Re: [PATCH 6/8] loop: relax loop dio use condition
Date: Wed, 27 Oct 2021 08:20:33 +0800 [thread overview]
Message-ID: <202110270857.3pvIHsi1-lkp@intel.com> (raw)
In-Reply-To: <20211025094437.2837701-7-ming.lei@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 12650 bytes --]
Hi Ming,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v5.15-rc6]
[cannot apply to axboe-block/for-next next-20211026]
[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]
url: https://github.com/0day-ci/linux/commits/Ming-Lei/loop-improve-dio-on-backing-file/20211025-174819
base: 519d81956ee277b4419c723adfb154603c2565ba
config: parisc-buildonly-randconfig-r002-20211026 (attached as .config)
compiler: hppa-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/f98a33d68a04634ba8f8314e9da480abc332b1f4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ming-Lei/loop-improve-dio-on-backing-file/20211025-174819
git checkout f98a33d68a04634ba8f8314e9da480abc332b1f4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/block/loop.c: In function 'loop_configure':
>> drivers/block/loop.c:1133:23: error: variable 'inode' set but not used [-Werror=unused-but-set-variable]
1133 | struct inode *inode;
| ^~~~~
cc1: all warnings being treated as errors
vim +/inode +1133 drivers/block/loop.c
62ab466ca881fe2 Martijn Coenen 2020-05-13 1127
3448914e8cc550b Martijn Coenen 2020-05-13 1128 static int loop_configure(struct loop_device *lo, fmode_t mode,
3448914e8cc550b Martijn Coenen 2020-05-13 1129 struct block_device *bdev,
3448914e8cc550b Martijn Coenen 2020-05-13 1130 const struct loop_config *config)
^1da177e4c3f415 Linus Torvalds 2005-04-16 1131 {
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1132 struct file *file = fget(config->fd);
^1da177e4c3f415 Linus Torvalds 2005-04-16 @1133 struct inode *inode;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1134 struct address_space *mapping;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1135 int error;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1136 loff_t size;
85b0a54a82e4fbc Jan Kara 2018-11-08 1137 bool partscan;
3448914e8cc550b Martijn Coenen 2020-05-13 1138 unsigned short bsize;
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1139 bool is_loop;
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1140
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1141 if (!file)
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1142 return -EBADF;
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1143 is_loop = is_loop_device(file);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1144
^1da177e4c3f415 Linus Torvalds 2005-04-16 1145 /* This is safe, since we have a reference from open(). */
^1da177e4c3f415 Linus Torvalds 2005-04-16 1146 __module_get(THIS_MODULE);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1147
33ec3e53e7b1869 Jan Kara 2019-05-16 1148 /*
33ec3e53e7b1869 Jan Kara 2019-05-16 1149 * If we don't hold exclusive handle for the device, upgrade to it
33ec3e53e7b1869 Jan Kara 2019-05-16 1150 * here to avoid changing device under exclusive owner.
33ec3e53e7b1869 Jan Kara 2019-05-16 1151 */
33ec3e53e7b1869 Jan Kara 2019-05-16 1152 if (!(mode & FMODE_EXCL)) {
37c3fc9abb25cd7 Christoph Hellwig 2020-11-25 1153 error = bd_prepare_to_claim(bdev, loop_configure);
ecbe6bc0003bfd5 Christoph Hellwig 2020-07-16 1154 if (error)
757ecf40b7e0295 Jan Kara 2018-11-08 1155 goto out_putf;
33ec3e53e7b1869 Jan Kara 2019-05-16 1156 }
33ec3e53e7b1869 Jan Kara 2019-05-16 1157
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1158 error = loop_global_lock_killable(lo, is_loop);
33ec3e53e7b1869 Jan Kara 2019-05-16 1159 if (error)
33ec3e53e7b1869 Jan Kara 2019-05-16 1160 goto out_bdev;
757ecf40b7e0295 Jan Kara 2018-11-08 1161
^1da177e4c3f415 Linus Torvalds 2005-04-16 1162 error = -EBUSY;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1163 if (lo->lo_state != Lo_unbound)
757ecf40b7e0295 Jan Kara 2018-11-08 1164 goto out_unlock;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1165
d2ac838e4cd7e5e Theodore Ts'o 2018-05-07 1166 error = loop_validate_file(file, bdev);
d2ac838e4cd7e5e Theodore Ts'o 2018-05-07 1167 if (error)
757ecf40b7e0295 Jan Kara 2018-11-08 1168 goto out_unlock;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1169
^1da177e4c3f415 Linus Torvalds 2005-04-16 1170 mapping = file->f_mapping;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1171 inode = mapping->host;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1172
3448914e8cc550b Martijn Coenen 2020-05-13 1173 if ((config->info.lo_flags & ~LOOP_CONFIGURE_SETTABLE_FLAGS) != 0) {
3448914e8cc550b Martijn Coenen 2020-05-13 1174 error = -EINVAL;
3448914e8cc550b Martijn Coenen 2020-05-13 1175 goto out_unlock;
3448914e8cc550b Martijn Coenen 2020-05-13 1176 }
3448914e8cc550b Martijn Coenen 2020-05-13 1177
3448914e8cc550b Martijn Coenen 2020-05-13 1178 if (config->block_size) {
3448914e8cc550b Martijn Coenen 2020-05-13 1179 error = loop_validate_block_size(config->block_size);
3448914e8cc550b Martijn Coenen 2020-05-13 1180 if (error)
3448914e8cc550b Martijn Coenen 2020-05-13 1181 goto out_unlock;
3448914e8cc550b Martijn Coenen 2020-05-13 1182 }
3448914e8cc550b Martijn Coenen 2020-05-13 1183
3448914e8cc550b Martijn Coenen 2020-05-13 1184 error = loop_set_status_from_info(lo, &config->info);
3448914e8cc550b Martijn Coenen 2020-05-13 1185 if (error)
3448914e8cc550b Martijn Coenen 2020-05-13 1186 goto out_unlock;
3448914e8cc550b Martijn Coenen 2020-05-13 1187
456be1484ffc72a Christoph Hellwig 2011-10-17 1188 if (!(file->f_mode & FMODE_WRITE) || !(mode & FMODE_WRITE) ||
283e7e5d249f486 Al Viro 2015-04-03 1189 !file->f_op->write_iter)
3448914e8cc550b Martijn Coenen 2020-05-13 1190 lo->lo_flags |= LO_FLAGS_READ_ONLY;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1191
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1192 lo->workqueue = alloc_workqueue("loop%d",
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1193 WQ_UNBOUND | WQ_FREEZABLE,
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1194 0,
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1195 lo->lo_number);
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1196 if (!lo->workqueue) {
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1197 error = -ENOMEM;
757ecf40b7e0295 Jan Kara 2018-11-08 1198 goto out_unlock;
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1199 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1200
9f65c489b68d424 Matteo Croce 2021-07-13 1201 disk_force_media_change(lo->lo_disk, DISK_EVENT_MEDIA_CHANGE);
7a2f0ce19f2e2ed Christoph Hellwig 2020-11-03 1202 set_disk_ro(lo->lo_disk, (lo->lo_flags & LO_FLAGS_READ_ONLY) != 0);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1203
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1204 INIT_WORK(&lo->rootcg_work, loop_rootcg_workfn);
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1205 INIT_LIST_HEAD(&lo->rootcg_cmd_list);
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1206 INIT_LIST_HEAD(&lo->idle_worker_list);
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1207 lo->worker_tree = RB_ROOT;
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1208 timer_setup(&lo->timer, loop_free_idle_workers,
87579e9b7d8dc36 Dan Schatzberg 2021-06-28 1209 TIMER_DEFERRABLE);
3448914e8cc550b Martijn Coenen 2020-05-13 1210 lo->use_dio = lo->lo_flags & LO_FLAGS_DIRECT_IO;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1211 lo->lo_device = bdev;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1212 lo->lo_backing_file = file;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1213 lo->old_gfp_mask = mapping_gfp_mask(mapping);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1214 mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
^1da177e4c3f415 Linus Torvalds 2005-04-16 1215
3448914e8cc550b Martijn Coenen 2020-05-13 1216 if (!(lo->lo_flags & LO_FLAGS_READ_ONLY) && file->f_op->fsync)
21d0727f639e4ba Jens Axboe 2016-03-30 1217 blk_queue_write_cache(lo->lo_queue, true, false);
68db1961bbf4e16 Nikanth Karthikesan 2009-03-24 1218
3448914e8cc550b Martijn Coenen 2020-05-13 1219 if (config->block_size)
3448914e8cc550b Martijn Coenen 2020-05-13 1220 bsize = config->block_size;
3448914e8cc550b Martijn Coenen 2020-05-13 1221 else
3448914e8cc550b Martijn Coenen 2020-05-13 1222 bsize = 512;
85560117d00f5d5 Martijn Coenen 2019-09-04 1223
85560117d00f5d5 Martijn Coenen 2019-09-04 1224 blk_queue_logical_block_size(lo->lo_queue, bsize);
85560117d00f5d5 Martijn Coenen 2019-09-04 1225 blk_queue_physical_block_size(lo->lo_queue, bsize);
85560117d00f5d5 Martijn Coenen 2019-09-04 1226 blk_queue_io_min(lo->lo_queue, bsize);
85560117d00f5d5 Martijn Coenen 2019-09-04 1227
2b9ac22b12a266e Kristian Klausen 2021-06-18 1228 loop_config_discard(lo);
56a85fd8376ef32 Holger Hoffstätte 2019-02-12 1229 loop_update_rotational(lo);
2e5ab5f379f96a6 Ming Lei 2015-08-17 1230 loop_update_dio(lo);
ee86273062cbb31 Milan Broz 2010-08-23 1231 loop_sysfs_init(lo);
79e5dc59e2974a4 Martijn Coenen 2020-08-25 1232
79e5dc59e2974a4 Martijn Coenen 2020-08-25 1233 size = get_loop_size(lo, file);
5795b6f5607f7e4 Martijn Coenen 2020-05-13 1234 loop_set_size(lo, size);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1235
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1236 /* Order wrt reading lo_state in loop_validate_file(). */
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1237 wmb();
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1238
6c9979185c7ef4f Serge E. Hallyn 2006-09-29 1239 lo->lo_state = Lo_bound;
e03c8dd14915fab Kay Sievers 2011-08-23 1240 if (part_shift)
e03c8dd14915fab Kay Sievers 2011-08-23 1241 lo->lo_flags |= LO_FLAGS_PARTSCAN;
85b0a54a82e4fbc Jan Kara 2018-11-08 1242 partscan = lo->lo_flags & LO_FLAGS_PARTSCAN;
fe6a8fc5ed2f008 Lennart Poettering 2020-08-10 1243 if (partscan)
fe6a8fc5ed2f008 Lennart Poettering 2020-08-10 1244 lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN;
c1681bf8a7b1b98 Anatol Pomozov 2013-04-01 1245
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1246 loop_global_unlock(lo, is_loop);
85b0a54a82e4fbc Jan Kara 2018-11-08 1247 if (partscan)
0384264ea8a39bd Christoph Hellwig 2021-06-24 1248 loop_reread_partitions(lo);
37c3fc9abb25cd7 Christoph Hellwig 2020-11-25 1249 if (!(mode & FMODE_EXCL))
37c3fc9abb25cd7 Christoph Hellwig 2020-11-25 1250 bd_abort_claiming(bdev, loop_configure);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1251 return 0;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1252
757ecf40b7e0295 Jan Kara 2018-11-08 1253 out_unlock:
3ce6e1f662a9109 Tetsuo Handa 2021-07-06 1254 loop_global_unlock(lo, is_loop);
33ec3e53e7b1869 Jan Kara 2019-05-16 1255 out_bdev:
37c3fc9abb25cd7 Christoph Hellwig 2020-11-25 1256 if (!(mode & FMODE_EXCL))
37c3fc9abb25cd7 Christoph Hellwig 2020-11-25 1257 bd_abort_claiming(bdev, loop_configure);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1258 out_putf:
^1da177e4c3f415 Linus Torvalds 2005-04-16 1259 fput(file);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1260 /* This is safe: open() is still holding a reference. */
^1da177e4c3f415 Linus Torvalds 2005-04-16 1261 module_put(THIS_MODULE);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1262 return error;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1263 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1264
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32969 bytes --]
next prev parent reply other threads:[~2021-10-27 0:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 9:44 [PATCH 0/8] loop: improve dio on backing file Ming Lei
2021-10-25 9:44 ` [PATCH 1/8] loop: move flush_dcache_page to ->complete of request Ming Lei
2021-10-26 7:21 ` Christoph Hellwig
2021-10-25 9:44 ` [PATCH 2/8] loop: remove always true check Ming Lei
2021-10-26 7:31 ` Christoph Hellwig
2021-10-25 9:44 ` [PATCH 3/8] loop: add one helper for submitting IO on backing file Ming Lei
2021-10-25 9:44 ` [PATCH 4/8] loop: cover simple read/write via lo_rw_aio() Ming Lei
2021-10-26 7:35 ` Christoph Hellwig
2021-10-25 9:44 ` [PATCH 5/8] loop: fallback to buffered IO in case of dio submission Ming Lei
2021-10-26 7:36 ` Christoph Hellwig
2021-10-25 9:44 ` [PATCH 6/8] loop: relax loop dio use condition Ming Lei
2021-10-26 7:37 ` Christoph Hellwig
2021-10-27 0:20 ` kernel test robot [this message]
2021-10-25 9:44 ` [PATCH 7/8] loop: remove lo->use_dio Ming Lei
2021-10-25 9:44 ` [RFC PATCH 8/8] loop: use backing dio at default Ming Lei
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=202110270857.3pvIHsi1-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbuild-all@lists.01.org \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).