Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ceph-for-5.4-rc8' of git://github.com/ceph/ceph-client

Pull ceph fixes from Ilya Dryomov:
"Two fixes for the buffered reads and O_DIRECT writes serialization
patch that went into -rc1 and a fixup for a bogus warning on older gcc
versions"

* tag 'ceph-for-5.4-rc8' of git://github.com/ceph/ceph-client:
rbd: silence bogus uninitialized warning in rbd_object_map_update_finish()
ceph: increment/decrement dio counter on async requests
ceph: take the inode lock before acquiring cap refs

+23 -8
+1 -1
drivers/block/rbd.c
··· 2087 2087 struct rbd_device *rbd_dev = obj_req->img_request->rbd_dev; 2088 2088 struct ceph_osd_data *osd_data; 2089 2089 u64 objno; 2090 - u8 state, new_state, current_state; 2090 + u8 state, new_state, uninitialized_var(current_state); 2091 2091 bool has_current_state; 2092 2092 void *p; 2093 2093
+22 -7
fs/ceph/file.c
··· 753 753 if (!atomic_dec_and_test(&aio_req->pending_reqs)) 754 754 return; 755 755 756 + if (aio_req->iocb->ki_flags & IOCB_DIRECT) 757 + inode_dio_end(inode); 758 + 756 759 ret = aio_req->error; 757 760 if (!ret) 758 761 ret = aio_req->total_len; ··· 1094 1091 CEPH_CAP_FILE_RD); 1095 1092 1096 1093 list_splice(&aio_req->osd_reqs, &osd_reqs); 1094 + inode_dio_begin(inode); 1097 1095 while (!list_empty(&osd_reqs)) { 1098 1096 req = list_first_entry(&osd_reqs, 1099 1097 struct ceph_osd_request, ··· 1268 1264 dout("aio_read %p %llx.%llx %llu~%u trying to get caps on %p\n", 1269 1265 inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, inode); 1270 1266 1267 + if (iocb->ki_flags & IOCB_DIRECT) 1268 + ceph_start_io_direct(inode); 1269 + else 1270 + ceph_start_io_read(inode); 1271 + 1271 1272 if (fi->fmode & CEPH_FILE_MODE_LAZY) 1272 1273 want = CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO; 1273 1274 else 1274 1275 want = CEPH_CAP_FILE_CACHE; 1275 1276 ret = ceph_get_caps(filp, CEPH_CAP_FILE_RD, want, -1, 1276 1277 &got, &pinned_page); 1277 - if (ret < 0) 1278 + if (ret < 0) { 1279 + if (iocb->ki_flags & IOCB_DIRECT) 1280 + ceph_end_io_direct(inode); 1281 + else 1282 + ceph_end_io_read(inode); 1278 1283 return ret; 1284 + } 1279 1285 1280 1286 if ((got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0 || 1281 1287 (iocb->ki_flags & IOCB_DIRECT) || ··· 1297 1283 1298 1284 if (ci->i_inline_version == CEPH_INLINE_NONE) { 1299 1285 if (!retry_op && (iocb->ki_flags & IOCB_DIRECT)) { 1300 - ceph_start_io_direct(inode); 1301 1286 ret = ceph_direct_read_write(iocb, to, 1302 1287 NULL, NULL); 1303 - ceph_end_io_direct(inode); 1304 1288 if (ret >= 0 && ret < len) 1305 1289 retry_op = CHECK_EOF; 1306 1290 } else { 1307 - ceph_start_io_read(inode); 1308 1291 ret = ceph_sync_read(iocb, to, &retry_op); 1309 - ceph_end_io_read(inode); 1310 1292 } 1311 1293 } else { 1312 1294 retry_op = READ_INLINE; ··· 1313 1303 inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len, 1314 1304 ceph_cap_string(got)); 1315 1305 ceph_add_rw_context(fi, &rw_ctx); 1316 - ceph_start_io_read(inode); 1317 1306 ret = generic_file_read_iter(iocb, to); 1318 - ceph_end_io_read(inode); 1319 1307 ceph_del_rw_context(fi, &rw_ctx); 1320 1308 } 1309 + 1321 1310 dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n", 1322 1311 inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret); 1323 1312 if (pinned_page) { ··· 1324 1315 pinned_page = NULL; 1325 1316 } 1326 1317 ceph_put_cap_refs(ci, got); 1318 + 1319 + if (iocb->ki_flags & IOCB_DIRECT) 1320 + ceph_end_io_direct(inode); 1321 + else 1322 + ceph_end_io_read(inode); 1323 + 1327 1324 if (retry_op > HAVE_RETRIED && ret >= 0) { 1328 1325 int statret; 1329 1326 struct page *page = NULL;