From patchwork Mon Feb 26 03:46:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RnJhbmsgSHNpYW8g6JWt5rOV5a6j?= X-Patchwork-Id: 13571256 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2099.outbound.protection.outlook.com [40.107.215.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2507DF44 for ; Mon, 26 Feb 2024 03:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.99 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708919173; cv=fail; b=u/kVnnZE8UbPdmKSWyjrPo91kkCOFp/rSB2rHNsD2JCCpftSeURp8CLCVl0fRSr6c4Xin8su2Ie04MExRV1R9Dw2uqmXQWHM944MEZl/IUe3QDdalsGNpF71DUfj8ox7IF8ZKoQV4TdfWCOyG57p61mlGFQhxS4pd0e0PIPDViE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708919173; c=relaxed/simple; bh=EFVTGi8lSZonEXpVpLR3/134baqTTMUCX8YyYcfxkRk=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=DUmimnar6qFZiZs5zYLtAUVxDGB5stgijwWMR2cs7HPWwRsWBEZArxdyrnlCS5l6aNZsAOb2gN5TbdAog/Sxm7uhVp9fZbmsGGd89mAYsnxSoq5WOqYP1KSbvfC0XOijw7SfRkOe8oFk6hE1nVer87bWUz0UVtIGJVZSIk3quYA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qnap.com; spf=pass smtp.mailfrom=qnap.com; dkim=pass (2048-bit key) header.d=qnap.com header.i=@qnap.com header.b=CbS5PU7G; arc=fail smtp.client-ip=40.107.215.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qnap.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qnap.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qnap.com header.i=@qnap.com header.b="CbS5PU7G" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HjuouPF+W8yI8Gn5UzDWHAjE+WkTJAZQkyPsL82Tr1Wnh8OYfknnhy5NXWnQbR+z/yqwd9xBKHRKrJyZ8iaKEBevihtIUvac9YSixa3tfnO9sWWu5wG6KyGxbCVRZSePZW494I+icRFdiTtNggBStKl3JrVr7G5PPrxb3j6eUb9HLfTUEHAVewYZyGG0jkOGdWp66Dp2aex8SCbhxNQIqV2V2sTkzWk4wSa32nmuc3bLY/kOlF+L3MGKqW1vQ3dDeDRVAsoO1TdRMFM/fTCcS8d6zVT6YAXhFKZueldqaX9Tjb7NPUjsFmvqsfrmSqJAOa6T2szcfaHKKqDl8fyiqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EFVTGi8lSZonEXpVpLR3/134baqTTMUCX8YyYcfxkRk=; b=QjY/epa6VgDrN9/pv7NWdn3uNp/1CnwNiu+GFNSL5mmMRK02g80sUoRBlGj7EwLg5zDEuC+gMDPGwGK4vh7qKriKEix1Z/ONdg/WFS39qVrhq+7b5dva6IbWFxulBUqkypvkpWkFZcxqS7yEOjz4ShhWDW0xfN+nVpxhvOmMKypvgI273hkHPf1Mcx74559NiFMhHS12p6s/sWgnhwyeEKRASors387NJUVtc+ipilkZwSIJIYpO6SEWCyylyiW8TJYFaGDiwl+DKoygad1nCbN4953jEI82ZOXJn2AayAfDYHBQi45WC6aqUqTdixt1nKF4Lr583GXerLhy7jrVFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=qnap.com; dmarc=pass action=none header.from=qnap.com; dkim=pass header.d=qnap.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qnap.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EFVTGi8lSZonEXpVpLR3/134baqTTMUCX8YyYcfxkRk=; b=CbS5PU7GEEadrurHYIPp+0Eh8AM52+NqZv//0YHAfTPhluXtxtPyR4WJODQpFGj9aXBLYd6QuYtIZV5LFi0llY0mpbO/10dkj+Mcv/Y5w8kUKzd/bvZMrDkrla4ZG2xiGaXOGCaFTiB7XhJ49jNX5kcEOBypQSPliGNo/wp5vq2shIKgW73xFMTld1sdgwwSFYYG9qiTPQ0Qte6wDAlmtmBx3yooxYM3F1N3LjU3v5YX5pVfY9D9+hc5cumrlhHXZh8KmFAsEPz0jGoFi3R5GS8w/TLhTyAC8AXZVtR4tJ/vshKhhPA9C/rZMA5vxrwld+ddXErrS9A+qhtl7GS0+w== Received: from SEZPR04MB6972.apcprd04.prod.outlook.com (2603:1096:101:ef::7) by TYUPR04MB6743.apcprd04.prod.outlook.com (2603:1096:400:352::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.33; Mon, 26 Feb 2024 03:46:08 +0000 Received: from SEZPR04MB6972.apcprd04.prod.outlook.com ([fe80::4aff:c1d:f18b:5e0]) by SEZPR04MB6972.apcprd04.prod.outlook.com ([fe80::4aff:c1d:f18b:5e0%4]) with mapi id 15.20.7316.023; Mon, 26 Feb 2024 03:46:08 +0000 From: =?big5_tw?b?RnJhbmsgSHNpYW8gv72qa6vF?= To: "xiubli@redhat.com" CC: "ceph-devel@vger.kernel.org" Subject: =?big5_tw?b?pl7C0DogW1BBVENIIHYyIDIvMl0gY2VwaDogc2V0IHRoZSBjb3JyZWN0?= =?big5_tw?b?IG1hc2sgZm9yIGdldGF0dHIgcmVxZXVzdCBmb3IgcmVhZA==?= Thread-Topic: [PATCH v2 2/2] ceph: set the correct mask for getattr reqeust for read Thread-Index: AQHaZZIIADxuD1eM+0u3So2PS9R36LEcAXgP Date: Mon, 26 Feb 2024 03:46:08 +0000 Message-ID: References: <20240222131900.179717-1-xiubli@redhat.com> <20240222131900.179717-3-xiubli@redhat.com> In-Reply-To: <20240222131900.179717-3-xiubli@redhat.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=qnap.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SEZPR04MB6972:EE_|TYUPR04MB6743:EE_ x-ms-office365-filtering-correlation-id: 9d17a5a3-f4f9-42d6-52d9-08dc367d77c5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uiJVwgz3bDIbxWdZSt3ZspySzfeE/rA5j0Ldi2tTQCchtqH8Z9OLEX7/gqv/VLB15trTDyDx2mdFIY4zPoAgNBQMbC/wnetJFSvGYTDWtxro4ks836tdRDGW8epUOF8Yk+Z+uyn+gnq4R9hqp95HD/eVEAcurO5rZ7Jfiy2NmvGj4ayEWN8wExUkiJS9rbUCfZW/koHDnEV1DQJMTht99tW1BUoD/FgUUFN0WZI6C8GLhXb+Kh3qhdT8qlhfDdpfGJAi1CW9HMILO6i1hy9d8O4qmwtPAUWNDVlut8m2uS8WjdUKFSy5eVp3Bi73dvVD6jFxdocrgh6iFH3WnBoX0IM/yPD5+Guhr1+c5aSGd06bOZU70dYImpQVtrSKVwcrcU/ZeZyzwXP0spUDvKpkjcOvQcCJ1iopRGJhGbi6sQkO1gFTJYsSwqA+oYkfVIxWesQdNUmBrosq/hAy5BkCINCO+LMLyQe7Sba0aSK23vF9GspFVnxcLatOEfHqnq+GZ5GdaXJ3agsxy1299Jo7j0JHpLQIxcVSB9dTHzvo+GFnsN2QlAFC6jMB0OLzhNTB/xtnKbggUbfn0CWdlvHUhn6a2N/hMquD5q+gyqfZY78SyxlP2sBsZLQVkOk7MvTs4u1Y5/wNpgo34deegmUoj7H0mTsH8ZXC2dG54Gp8mk0hPqVarSpIVC65GuIy/N+wlaak/yuQlLlNZ/FlgyCeQw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:zh-tw;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR04MB6972.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?big5_tw?b?clNSdU50bzBsU2Y4dHJXSG1nSzZi?= =?big5_tw?b?K081QldheHBvZm8xZG91RE5QSHFEVVpQQ2ROS05WWkJUVWZEd3Jsd0VLU2l3WDVI?= =?big5_tw?b?RTAwUExBeSt2ZFF0UEkwNk9UbG5jYXF1TS9PSUgwY2ZDaTF5ZkJHNTJsK1hBY1Bz?= =?big5_tw?b?aDFsOEU4VHRsK3I3SnhRK0dySjd0ZnVQUWpKKzZ2RER6QXRkSXpLczBsQVFtU2lP?= =?big5_tw?b?ZzIvcWtRYmkzMW1IVDdCVFY5NElDU0ZDLzFtY283NE13d2ZwMUYwM3cyRnVwSkNL?= =?big5_tw?b?RitkbytrUE1VYnJWdGcyM0dTSS9NN216ck5tNVQvSHNlQW1KTEt2Ykk2Y1p5RGJF?= =?big5_tw?b?clh4Z3BpSTZ4UmM1c2FFVFBWZERqM2dYei8xWTJJRHZwOTd0bW1VaTFvTEcyK3A0?= =?big5_tw?b?VUkzMnMyWmFzWWgzUUpReWNGMjRaaXNXVEl5YnViSzdvYmhBbnRYNjRvMWw3TUpo?= =?big5_tw?b?U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NO?= =?big5_tw?b?ckh5WGJ5NVFwOXJzMlk5dVM0dTQ2Lzh3SEZoUVhCaU51aE16ZDVNZVYzNDhuMDdm?= =?big5_tw?b?S2JaRmtsTUpHazFXb3Fiek0rYnNEM0p6Mkw1NWNIaWM3L3JkclJJaWFQV2VOSll6?= =?big5_tw?b?Skg2SEJhU2hzeFlZYlR1bmhXeFBBRkN2UEtFMjZpaytEYzUvRlZrSEx0ODJCMXlE?= =?big5_tw?b?RWVxdnUzck04c1k3TGlDRDJMQm9DYWdLMDAwM1NGNThoaW9JdGIzcklBZzQvMkZ2?= =?big5_tw?b?dUVyTGxaRHJOWUtUMXJiYlNLcmIvRHE0cGJlcUdRMlpDZnYzYm5KNWYranM2eHJO?= =?big5_tw?b?SlhKL1IwWkw2dG9jTENNZXBCTG9td2NpRGR6S2hHYzJnWC9ObHB4bW1sUUZ5YWFV?= =?big5_tw?b?MmxWOWRUVXZRWmN1UW5UNUVBNVZpVUtWc3lkTlhaa2xVNjdZTnZianc4K0RWQ0xq?= =?big5_tw?b?TThyYS83WGNiaEdzSUt6S0lvZ1JJNVpjMUphM0QxR2FaYkFMT3lZYTU0V29tRjBq?= =?big5_tw?b?MkJEdjd3c1VSd2FxdU1LcHRKa3lKc3REckd6MHRiZFllQXlsRVN2d002ZGU5MUxo?= =?big5_tw?b?TFZna1VRSFRaMHNHczNTZytySk9hcnlXMXluczRza1hQcnpQZlhXNzVyd3FvVG41?= =?big5_tw?b?dFl0dWNmMmFQNDZ3MjBCYkdyL2U1Z1hmTXhVcXJUUTUzRGZqVTc2WEtvcnpycEs4?= =?big5_tw?b?UXdxbXhGLzZHZWNNK1prcDAvbHhrdz0=?= Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: qnap.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SEZPR04MB6972.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d17a5a3-f4f9-42d6-52d9-08dc367d77c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2024 03:46:08.7140 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6eba8807-6ef0-4e31-890c-a6ecfbb98568 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4gtffmMsewL4LCh+9qAGolZumUKINqAfckeJDTCvA6ikT7FUn/XuloLOCF4WFB66vMuI7zeONePjtpQ/kk7bww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR04MB6743 Tested-by: Frank Hsiao 蕭法宣 diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 2b2b07a0a61b..08c918aa403e 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2181,14 +2181,16 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) int statret; struct page *page = NULL; loff_t i_size; + int mask = CEPH_STAT_CAP_SIZE; if (retry_op == READ_INLINE) { page = __page_cache_alloc(GFP_KERNEL); if (!page) return -ENOMEM; } - statret = __ceph_do_getattr(inode, page, - CEPH_STAT_CAP_INLINE_DATA, !!page); + if (retry_op == READ_INLINE) + mask = CEPH_STAT_CAP_INLINE_DATA; + statret = __ceph_do_getattr(inode, page, mask, !!page); if (statret < 0) { if (page) __free_page(page); @@ -2229,7 +2231,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to) /* hit EOF or hole? */ if (retry_op == CHECK_EOF && iocb->ki_pos < i_size && ret < len) { - doutc(cl, "hit hole, ppos %lld < size %lld, reading more\n", + doutc(cl, "may hit hole, ppos %lld < size %lld, reading more\n", iocb->ki_pos, i_size); read += ret;