From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.15 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796464562; b=3sPgdB3Vd9jUZiqL55uRJQPgftQMviF6vPLsy3iqUg3/n7mOJW8WY0gH086YDXVe0OKb rg5DxAbT8Lk6Q9gxVmzQ9qlsxBT4dZnt+ZChUnK601+cCxIO6/DCZRdWkh7UIOSJTS2aw zcUKkfrfAM9t/Z6vONtqtcVPvzbwAvcauY1Xyg9hK5gw1ZMNSchatcasmJiVuHs6DUc15 ahkzAIDSB6vtNdPZHD9WqKdSZLBPm2jad/Lhx0NOsI3iWKo0q+DPNmF3aTOc2HSWKBO9G dS8/lwhUdBlqEQ4Gd+tDvhEjjvIm8Y5Gvn6lnhS+B3N8IXUvh8eVc7sonUX6Ec7wV7g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796464562; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Date:From:To: Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=vfBSzrlt1G/X+DWmfIRmR8kCK1+r/jvmUZU3kuKa9r8=; b=ZOM3dtL3yzUEpnbmN73oZIck605Ez+vTorKm6W4x/QCeKwnfMxmS4+xC1XIx8zR7Locz ROb9dRkRYMlfAFgTywcvO5TAm1n327XHY9nZA0ZzrJJD13sACpZtI1egWTvOFl/awUByZ hCZm8Xgm7HXhMnDKzw8NYrbj2OYeJwPxW0LEkGsEWKeR5pROqO9rhmLj95CHlbxPrCjUN 1872OywHGieaOybgSxS1S2Qg2JuMSz4oyDdZ5XyM5oGaQU5DumvWJasZGWUfmvoafv1he SIp+DjP8iejUghKSHIuph8WMOeaBShtyAOPA5x43Ul2gP1ARlB0uEWf52/a1EZ4uwIQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=RwIvhwg9; arc=none smtp.remote-ip=198.175.65.15 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4055606A336; Sat, 5 Dec 2026 09:56:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A4055606A336 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=RwIvhwg9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796464562; x=1828000562; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=vfBSzrlt1G/X+DWmfIRmR8kCK1+r/jvmUZU3kuKa9r8=; b=RwIvhwg9yV9q744vuKjrfTBzkkCwiv+f2slQN/7j51kRJDds38NQnRgN eXWhMsKy7+FlLHE6PPQSBdbnWXN4DZTuGC4a9yLN4Aan1/Usuy2nfoSSb VoeEFnzxHdY8TlFCi6Ts+jaV4EXTjhPWKTt7cWJxVXVM8fRD/urgMVJ80 tKqvXnwWwaA72l/NKYiUCAnOLwZhujMjcOy6DutkRpSDxxact5VY7DvMp IEsbE5n36dzqIxk/Tm8Dbkdy0UH1QwbjKUsv34hIHPRHw91K7MfTAz409 sE9jI5lNgoO3Oz8kxBuFSFIkQIXb2J/QqWPTLW7JXN9At3pd3xOemqzhN g==; X-CSE-ConnectionGUID: iJ4xvidNRguq21xN2XXMmQ== X-CSE-MsgGUID: n8Q7K9z1TNSm9oYs8OSlnA== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5442076" X-IronPort-AV: E=Sophos;i="6.29,80,1794902400"; d="scan'208";a="5442076" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2026 01:56:01 -0800 X-CSE-ConnectionGUID: hgUhPYaDQZqvwuD7KwEGlA== X-CSE-MsgGUID: wjC3GSqwTAWISJ1qqmzvTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,80,1794902400"; d="scan'208";a="14292158" Received: from lkp-server01.sh.intel.com (HELO 0caa9d2d175c) ([10.239.97.150]) by orviesa007.jf.intel.com with ESMTP; 05 Dec 2026 01:56:00 -0800 Received: from kbuild by 0caa9d2d175c with local (Exim 4.98.2) (envelope-from ) id 1xZmUm-00000001m1g-3idQ; Sat, 05 Dec 2026 09:55:56 +0000 Date: Sat, 5 Dec 2026 17:55:01 +0800 From: kernel test robot To: Xiubo Li via B4 Relay , Ilya Dryomov , Alex Markuze , Viacheslav Dubeyko Cc: oe-kbuild-all@lists.linux.dev, ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Xiubo Li Subject: Re: [PATCH 2/2] ceph: don't let a mapped write overwrite other clients' writes Message-ID: <20261204215859.a5U1Zloy-lkp@intel.com> References: <20261204-ceph-mmap-no-overwrite-v1-2-323689b39a29@clyso.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261204-ceph-mmap-no-overwrite-v1-2-323689b39a29@clyso.com> Hi Xiubo, kernel test robot noticed the following build warnings: [auto build test WARNING on 3f90412e989cb381d4bf96260468f5c7b2d08655] url: https://github.com/intel-lab-lkp/linux/commits/Xiubo-Li-via-B4-Relay/libceph-add-the-CMPEXT-OSD-op/20261204-012211 base: 3f90412e989cb381d4bf96260468f5c7b2d08655 patch link: https://lore.kernel.org/r/20261204-ceph-mmap-no-overwrite-v1-2-323689b39a29%40clyso.com patch subject: [PATCH 2/2] ceph: don't let a mapped write overwrite other clients' writes config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20261204/20261204215859.a5U1Zloy-lkp@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 16.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261204/20261204215859.a5U1Zloy-lkp@intel.com/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 | Closes: https://lore.kernel.org/oe-kbuild-all/20261204215859.a5U1Zloy-lkp@intel.com/ All warnings (new ones prefixed by >>): fs/ceph/addr.c: In function 'ceph_write_kept': >> fs/ceph/addr.c:1517:1: warning: the frame size of 1352 bytes is larger than 1280 bytes [-Wframe-larger-than=] 1517 | } | ^ vim +1517 fs/ceph/addr.c 1339 1340 /* 1341 * Write back the runs @ext[0..@n) of the locked @folios, which 1342 * ceph_folio_keep_base() kept a copy of when they got dirty. See there. 1343 * The runs are all in one object. 1344 * 1345 * Send the folios whole, each run after a compare of the object's bytes 1346 * against the copy, in the same request: the OSD writes a request only 1347 * if no other client wrote there since. The requests are all in flight 1348 * at once. 1349 * 1350 * A request that lost its compare goes again with only the bytes this 1351 * client changed: the bytes it did not change are left as other clients 1352 * wrote them meanwhile. That is what a merge of the folio with what is 1353 * there now would write, in one more round trip, and without a read. 1354 * Whole folios go out when nobody else writes, though: writes that do 1355 * not cover whole blocks are more work for the OSD. For a while after a 1356 * lost compare, the changed bytes are sent right away. 1357 * 1358 * A byte this client set to the value it had in the copy, after another 1359 * client changed it, is taken as not changed: that store is ordered 1360 * before the other client's write. 1361 * 1362 * Returns 0 or a negative error. 1363 */ 1364 static int ceph_write_kept(struct inode *inode, struct folio **folios, 1365 struct ceph_merge_ext *ext, int n, 1366 struct page **pgbuf, 1367 struct ceph_snap_context *snapc, 1368 struct ceph_writeback_ctl *ceph_wbc) 1369 { 1370 struct ceph_inode_info *ci = ceph_inode(inode); 1371 struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 1372 struct ceph_client *cl = fsc->client; 1373 struct ceph_osd_client *osdc = &fsc->client->osdc; 1374 int nreq = DIV_ROUND_UP(n, CEPH_MERGE_EXTS_PER_REQ); 1375 struct ceph_osd_request *reqs[DIV_ROUND_UP(CEPH_MERGE_MAX_EXTS, 1376 CEPH_MERGE_EXTS_PER_REQ)]; 1377 struct page **pages, **bpages; 1378 unsigned long conflict = READ_ONCE(ci->i_kept_conflict); 1379 int i, q, f, npages = 0, nlost = 0, err = 0, err2; 1380 1381 for (i = 0; i < n; i++) 1382 for (f = ext[i].first; f < ext[i].first + ext[i].nr; f++) 1383 npages += folio_nr_pages(folios[f]); 1384 if (pgbuf && npages <= CEPH_MERGE_MAX_FOLIOS) { 1385 /* no allocation for order-0 folios gathered in a batch */ 1386 pages = pgbuf; 1387 bpages = pgbuf + npages; 1388 } else { 1389 pgbuf = NULL; 1390 pages = kmalloc_array(npages, sizeof(*pages), GFP_NOFS); 1391 bpages = kmalloc_array(npages, sizeof(*bpages), GFP_NOFS); 1392 if (!pages || !bpages) { 1393 kfree(bpages); 1394 kfree(pages); 1395 return -ENOMEM; 1396 } 1397 } 1398 npages = 0; 1399 for (i = 0; i < n; i++) { 1400 ext[i].pg = npages; 1401 for (f = ext[i].first; f < ext[i].first + ext[i].nr; f++) { 1402 struct folio *base = ceph_folio_base(folios[f]); 1403 int pg; 1404 1405 for (pg = 0; pg < folio_nr_pages(folios[f]); pg++) { 1406 pages[npages] = folio_page(folios[f], pg); 1407 bpages[npages++] = folio_page(base, pg); 1408 } 1409 } 1410 } 1411 1412 if (!time_in_range(jiffies, conflict, 1413 conflict + CEPH_KEPT_CONFLICT_HOLD)) { 1414 struct ceph_diff_run runs[2 * CEPH_MERGE_MAX_EXTS]; 1415 int ext_of[2 * CEPH_MERGE_MAX_EXTS]; 1416 int total = ceph_diff_runs(ext, n, folios, runs, ext_of, 1417 2 * n); 1418 1419 if (total <= 2 * n) { 1420 err = total ? ceph_send_diff(inode, pages, ext, runs, 1421 ext_of, total, snapc, 1422 ceph_wbc) : 0; 1423 goto out; 1424 } 1425 } 1426 if (time_in_range(jiffies, conflict, 1427 conflict + CEPH_KEPT_CONFLICT_HOLD)) { 1428 err = ceph_write_diff(inode, folios, pages, ext, n, snapc, 1429 ceph_wbc); 1430 goto out; 1431 } 1432 1433 for (q = 0; q < nreq; q++) { 1434 struct ceph_merge_ext *qe = &ext[q * CEPH_MERGE_EXTS_PER_REQ]; 1435 int m = min(n - q * CEPH_MERGE_EXTS_PER_REQ, 1436 CEPH_MERGE_EXTS_PER_REQ); 1437 struct ceph_osd_request *req; 1438 u64 wlen = qe[0].len, tsize; 1439 u32 tseq; 1440 1441 req = ceph_osdc_new_request(osdc, &ci->i_layout, 1442 ceph_vino(inode), qe[0].off, &wlen, 1443 1, 2 * m, CEPH_OSD_OP_WRITE, 1444 CEPH_OSD_FLAG_WRITE, snapc, 1445 ceph_wbc->truncate_seq, 1446 ceph_wbc->truncate_size, false); 1447 if (IS_ERR(req)) { 1448 reqs[q] = NULL; 1449 err = PTR_ERR(req); 1450 continue; 1451 } 1452 if (WARN_ON_ONCE(wlen != qe[0].len)) { 1453 /* a folio crosses an object boundary */ 1454 ceph_osdc_put_request(req); 1455 reqs[q] = NULL; 1456 err = -EIO; 1457 continue; 1458 } 1459 tsize = req->r_ops[1].extent.truncate_size; 1460 tseq = req->r_ops[1].extent.truncate_seq; 1461 for (i = 0; i < m; i++) { 1462 const struct ceph_merge_ext *e = &qe[i]; 1463 1464 osd_req_op_extent_init(req, 2 * i, CEPH_OSD_OP_CMPEXT, 1465 e->objoff, e->len, tsize, tseq); 1466 osd_req_op_extent_osd_data_pages(req, 2 * i, 1467 bpages + e->pg, e->len, 1468 0, false, false); 1469 if (i) 1470 osd_req_op_extent_init(req, 2 * i + 1, 1471 CEPH_OSD_OP_WRITE, 1472 e->objoff, e->len, 1473 tsize, tseq); 1474 osd_req_op_extent_osd_data_pages(req, 2 * i + 1, 1475 pages + e->pg, e->len, 1476 0, false, false); 1477 } 1478 req->r_mtime = inode_get_mtime(inode); 1479 ceph_osdc_start_request(osdc, req); 1480 reqs[q] = req; 1481 } 1482 1483 for (q = 0; q < nreq; q++) { 1484 struct ceph_merge_ext *qe = &ext[q * CEPH_MERGE_EXTS_PER_REQ]; 1485 int m = min(n - q * CEPH_MERGE_EXTS_PER_REQ, 1486 CEPH_MERGE_EXTS_PER_REQ); 1487 size_t bytes = 0; 1488 1489 if (!reqs[q]) 1490 continue; 1491 err2 = ceph_osdc_wait_request(osdc, reqs[q]); 1492 for (i = 0; i < m; i++) 1493 bytes += qe[i].len; 1494 ceph_update_write_metrics(&fsc->mdsc->metric, 1495 reqs[q]->r_start_latency, 1496 reqs[q]->r_end_latency, bytes, 1497 CEPH_CMPEXT_MISMATCH(err2) ? 0 : err2); 1498 ceph_osdc_put_request(reqs[q]); 1499 if (CEPH_CMPEXT_MISMATCH(err2)) { 1500 /* lost the compare: send what this client changed */ 1501 nlost++; 1502 WRITE_ONCE(ci->i_kept_conflict, jiffies); 1503 err2 = ceph_write_diff(inode, folios, pages, qe, m, 1504 snapc, ceph_wbc); 1505 } 1506 if (!err) 1507 err = err2; 1508 } 1509 doutc(cl, "%llx.%llx %llu~%zu %d runs of folios, %d requests lost the compare\n", 1510 ceph_vinop(inode), ext[0].off, ext[0].len, n, nlost); 1511 out: 1512 if (!pgbuf) { 1513 kfree(bpages); 1514 kfree(pages); 1515 } 1516 return err; > 1517 } 1518 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki