tree:
https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
ceph-fscache-iter
head: 0b5b4a5acf80bbc571fb75bcf516e7cc5180883a
commit: d0e53fb99e7e1379daa7cb9437e679b41a4b5217 [7/12] ceph: conversion to new fscache
API
config: x86_64-randconfig-a002-20200818 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
790878f291fa5dc58a1c560cb6cc76fd1bfd1c5a)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout d0e53fb99e7e1379daa7cb9437e679b41a4b5217
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> fs/ceph/file.c:1224:34: error: use of undeclared identifier
'FSCACHE_INVAL_DIO_WRITE'
ceph_fscache_invalidate(inode,
FSCACHE_INVAL_DIO_WRITE);
^
1 error generated.
#
https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/...
git remote add jlayton
https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
git fetch --no-tags jlayton ceph-fscache-iter
git checkout d0e53fb99e7e1379daa7cb9437e679b41a4b5217
vim +/FSCACHE_INVAL_DIO_WRITE +1224 fs/ceph/file.c
1190
1191 static ssize_t
1192 ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
1193 struct ceph_snap_context *snapc,
1194 struct ceph_cap_flush **pcf)
1195 {
1196 struct file *file = iocb->ki_filp;
1197 struct inode *inode = file_inode(file);
1198 struct ceph_inode_info *ci = ceph_inode(inode);
1199 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
1200 struct ceph_client_metric *metric = &fsc->mdsc->metric;
1201 struct ceph_vino vino;
1202 struct ceph_osd_request *req;
1203 struct bio_vec *bvecs;
1204 struct ceph_aio_request *aio_req = NULL;
1205 int num_pages = 0;
1206 int flags;
1207 int ret = 0;
1208 struct timespec64 mtime = current_time(inode);
1209 size_t count = iov_iter_count(iter);
1210 loff_t pos = iocb->ki_pos;
1211 bool write = iov_iter_rw(iter) == WRITE;
1212 bool should_dirty = !write && iter_is_iovec(iter);
1213
1214 if (write && ceph_snap(file_inode(file)) != CEPH_NOSNAP)
1215 return -EROFS;
1216
1217 dout("sync_direct_%s on file %p %lld~%u snapc %p seq %lld\n",
1218 (write ? "write" : "read"), file, pos, (unsigned)count,
1219 snapc, snapc ? snapc->seq : 0);
1220
1221 if (write) {
1222 int ret2;
1223
1224 ceph_fscache_invalidate(inode, FSCACHE_INVAL_DIO_WRITE);
1225
1226 ret2 = invalidate_inode_pages2_range(inode->i_mapping,
1227 pos >> PAGE_SHIFT,
1228 (pos + count - 1) >> PAGE_SHIFT);
1229 if (ret2 < 0)
1230 dout("invalidate_inode_pages2_range returned %d\n", ret2);
1231
1232 flags = /* CEPH_OSD_FLAG_ORDERSNAP | */ CEPH_OSD_FLAG_WRITE;
1233 } else {
1234 flags = CEPH_OSD_FLAG_READ;
1235 }
1236
1237 while (iov_iter_count(iter) > 0) {
1238 u64 size = iov_iter_count(iter);
1239 ssize_t len;
1240
1241 if (write)
1242 size = min_t(u64, size, fsc->mount_options->wsize);
1243 else
1244 size = min_t(u64, size, fsc->mount_options->rsize);
1245
1246 vino = ceph_vino(inode);
1247 req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
1248 vino, pos, &size, 0,
1249 1,
1250 write ? CEPH_OSD_OP_WRITE :
1251 CEPH_OSD_OP_READ,
1252 flags, snapc,
1253 ci->i_truncate_seq,
1254 ci->i_truncate_size,
1255 false);
1256 if (IS_ERR(req)) {
1257 ret = PTR_ERR(req);
1258 break;
1259 }
1260
1261 len = iter_get_bvecs_alloc(iter, size, &bvecs, &num_pages);
1262 if (len < 0) {
1263 ceph_osdc_put_request(req);
1264 ret = len;
1265 break;
1266 }
1267 if (len != size)
1268 osd_req_op_extent_update(req, 0, len);
1269
1270 /*
1271 * To simplify error handling, allow AIO when IO within i_size
1272 * or IO can be satisfied by single OSD request.
1273 */
1274 if (pos == iocb->ki_pos && !is_sync_kiocb(iocb) &&
1275 (len == count || pos + count <= i_size_read(inode))) {
1276 aio_req = kzalloc(sizeof(*aio_req), GFP_KERNEL);
1277 if (aio_req) {
1278 aio_req->iocb = iocb;
1279 aio_req->write = write;
1280 aio_req->should_dirty = should_dirty;
1281 INIT_LIST_HEAD(&aio_req->osd_reqs);
1282 if (write) {
1283 aio_req->mtime = mtime;
1284 swap(aio_req->prealloc_cf, *pcf);
1285 }
1286 }
1287 /* ignore error */
1288 }
1289
1290 if (write) {
1291 /*
1292 * throw out any page cache pages in this range. this
1293 * may block.
1294 */
1295 truncate_inode_pages_range(inode->i_mapping, pos,
1296 PAGE_ALIGN(pos + len) - 1);
1297
1298 req->r_mtime = mtime;
1299 }
1300
1301 osd_req_op_extent_osd_data_bvecs(req, 0, bvecs, num_pages, len);
1302
1303 if (aio_req) {
1304 aio_req->total_len += len;
1305 aio_req->num_reqs++;
1306 atomic_inc(&aio_req->pending_reqs);
1307
1308 req->r_callback = ceph_aio_complete_req;
1309 req->r_inode = inode;
1310 req->r_priv = aio_req;
1311 list_add_tail(&req->r_private_item, &aio_req->osd_reqs);
1312
1313 pos += len;
1314 continue;
1315 }
1316
1317 ret = ceph_osdc_start_request(req->r_osdc, req, false);
1318 if (!ret)
1319 ret = ceph_osdc_wait_request(&fsc->client->osdc, req);
1320
1321 if (write)
1322 ceph_update_write_latency(metric, req->r_start_latency,
1323 req->r_end_latency, ret);
1324 else
1325 ceph_update_read_latency(metric, req->r_start_latency,
1326 req->r_end_latency, ret);
1327
1328 size = i_size_read(inode);
1329 if (!write) {
1330 if (ret == -ENOENT)
1331 ret = 0;
1332 if (ret >= 0 && ret < len && pos + ret < size) {
1333 struct iov_iter i;
1334 int zlen = min_t(size_t, len - ret,
1335 size - pos - ret);
1336
1337 iov_iter_bvec(&i, READ, bvecs, num_pages, len);
1338 iov_iter_advance(&i, ret);
1339 iov_iter_zero(zlen, &i);
1340 ret += zlen;
1341 }
1342 if (ret >= 0)
1343 len = ret;
1344 }
1345
1346 put_bvecs(bvecs, num_pages, should_dirty);
1347 ceph_osdc_put_request(req);
1348 if (ret < 0)
1349 break;
1350
1351 pos += len;
1352 if (!write && pos >= size)
1353 break;
1354
1355 if (write && pos > size) {
1356 if (ceph_inode_set_size(inode, pos))
1357 ceph_check_caps(ceph_inode(inode),
1358 CHECK_CAPS_AUTHONLY,
1359 NULL);
1360 }
1361 }
1362
1363 if (aio_req) {
1364 LIST_HEAD(osd_reqs);
1365
1366 if (aio_req->num_reqs == 0) {
1367 kfree(aio_req);
1368 return ret;
1369 }
1370
1371 ceph_get_cap_refs(ci, write ? CEPH_CAP_FILE_WR :
1372 CEPH_CAP_FILE_RD);
1373
1374 list_splice(&aio_req->osd_reqs, &osd_reqs);
1375 inode_dio_begin(inode);
1376 while (!list_empty(&osd_reqs)) {
1377 req = list_first_entry(&osd_reqs,
1378 struct ceph_osd_request,
1379 r_private_item);
1380 list_del_init(&req->r_private_item);
1381 if (ret >= 0)
1382 ret = ceph_osdc_start_request(req->r_osdc,
1383 req, false);
1384 if (ret < 0) {
1385 req->r_result = ret;
1386 ceph_aio_complete_req(req);
1387 }
1388 }
1389 return -EIOCBQUEUED;
1390 }
1391
1392 if (ret != -EOLDSNAPC && pos > iocb->ki_pos) {
1393 ret = pos - iocb->ki_pos;
1394 iocb->ki_pos = pos;
1395 }
1396 return ret;
1397 }
1398
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org