From patchwork Tue Mar 19 08:02:36 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: 13596313 Received: from HK3PR03CU002.outbound.protection.outlook.com (mail-eastasiaazon11021007.outbound.protection.outlook.com [52.101.128.7]) (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 6AA9C537E4 for ; Tue, 19 Mar 2024 08:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.7 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710835364; cv=fail; b=gDsh+307dNxcAPXMtmeLgCWqXfqFflH7YbRm7TLxbXp5Ru8F47moq0Ti8jLzwaZJJSWC79BQ6WPFh42iCWvMJVreL57kV+vv+pu3kG47UB8J+3qFBTehzWVpYWAVKc2Jg+W1PHylumXfnZbyTWPj3G7EJqsWHyXWGLoJmT51eoY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710835364; c=relaxed/simple; bh=uzUAmkESa80NMB2yF6KJJEbQIrTOc6Ywl1dR2lJqaNU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=iMrITcCBj26oCYnH74UQedmgARy78+XJ72M7gnmXDLjIU6XEgQU9FtunwMkzmvOylIa00Oq6LgJ3AkDyQx9WjjmT6yfa6chc5ayuhxLcgKnhOTlbzz143SqA+fiAHLr6/X4E4Um4seMpYVpkpFQXgWtxNcyBuoELTkUr1QdGi94= 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=tMRkBeqJ; arc=fail smtp.client-ip=52.101.128.7 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="tMRkBeqJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XpKaTA1c9+pGi2wFUI1jAkSvtov6B+oWO6h7IZ4dMHcBLHdL1Vz78qvvEMDhvtRS9iADioeADgjkkFodPjQ8jD6quZYdRUKGLfyfAQ37nt8c+bPB37Pp7Y0g7boANF6NLiQgP6UE0TdmUQ8kRXh4XZIbTvNDqWNlmb1TEpARBJzOmJ2HXmc7b7tIZ4H5PndCYrqAWyMJyBrMxpPJguS+H1383MDprSEP9Gb5i7TxJiuvIuY/Rv9ayGWiW4mFxGCmBTL4u5oTLAhpS7kvCstnqzc6OtBukZn1IrXB/YZlg5P1CA4uUWw3h1xpMoMhv30y0Bs0HQea0HCVgLMpekQx8Q== 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=xnsXhhKAlfsnN799bWoONAbQM1VwQMW+conGbkwdVj4=; b=ApH3CyZY93pn0VFzCaAtskdxq61XzE/lulwQ86nag3v/Abjs5PaPCJTBDAUcav+0Vu0wmaE34pA92Owx1RwowIo7fSnX+AxPORTI1oVkPilqj2QZXZ6vDh/r4ISV2TMeZmvRjZMM4UIMvR9gj5RtrFfaL5hI6wCkR5jJIGcVBsYtasmjeKXmIMICwHO8q/arRIlGDMXdkRTu4XAd8HPogzV0dTnC8Hi2txx6w+ZpmkgLroOvosyykvRwZ7qkveD6gM4HaZJGd7ATl9wfqlsOGuxDdEnI4JKRm7QE0RBUpErhFa3l7ODrKe/yi7m8eFPBLOjVIVhQ1eYQLDnDkZcClg== 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=xnsXhhKAlfsnN799bWoONAbQM1VwQMW+conGbkwdVj4=; b=tMRkBeqJq/eKy2ItwXgg8IipJdS8icdu+d6NkFBYBQ89h/rjfUunbAY8Ws8yz1Rnw3u3BkFpkxjZ0srFaVPf2+kX7cu87kOaHbapfkbcLE99KkAqjVcBuZzTX+futFTlt0wbl9jvCj+pU3z6+yTbWkDZfp6KcRPnQvOgB7A68eEwY+fxxuq3VDQPUXm59G4WiYxqatxI0v+tGDKaqmHcg+w0CpK2MT8lzriEaENqyXEwb97kzVJQbZKG0m6Vb7XsIuUJKjRZL3OCxAHAzLrkVHdc0VTb8whttb6lzaxW+fVueZxDaKb+udmQibn3KMxUMdYaqOCiaz0brxVh7cV5Ag== Received: from SEZPR04MB6972.apcprd04.prod.outlook.com (2603:1096:101:ef::7) by SEYPR04MB7400.apcprd04.prod.outlook.com (2603:1096:101:1b4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.23; Tue, 19 Mar 2024 08:02:36 +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.7386.025; Tue, 19 Mar 2024 08:02:36 +0000 From: =?iso-2022-jp?b?RnJhbmsgSHNpYW8gGyRCaStLIUBrGyhC?= To: "xiubli@redhat.com" CC: "ceph-devel@vger.kernel.org" , "idryomov@gmail.com" Subject: =?iso-2022-jp?b?GyRCMnNKJBsoQjogW1BBVENIIHYzIDIvMl0gY2VwaDogc2V0?= =?iso-2022-jp?b?IHRoZSBjb3JyZWN0IG1hc2sgZm9yIGdldGF0dHIgcmVxZXVzdCBmb3Ig?= =?iso-2022-jp?b?cmVhZA==?= Thread-Topic: [PATCH v3 2/2] ceph: set the correct mask for getattr reqeust for read Thread-Index: AQHaeZTuYuFNXjBs5UCeognteGrdDLE+tFnF Date: Tue, 19 Mar 2024 08:02:36 +0000 Message-ID: References: <20240319002925.1228063-1-xiubli@redhat.com> <20240319002925.1228063-3-xiubli@redhat.com> In-Reply-To: <20240319002925.1228063-3-xiubli@redhat.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SEZPR04MB6972:EE_|SEYPR04MB7400:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zh+dIp52IjMlsFMB5eMELGuaCz45LdOlk8xziSzQKkwxMx7yjABo3c0sG5dSEWARZonhuKH4fxbHUVKQILQCGrl8f8QQFLvHENkXKY7/l645LFnRGXTzFx4WPQv98i3nElKVSQtirUv52VWw+p9BdY1FeJm1MxfZ0tMwJU4eAfv3UGURBm+WhAsC7XvjW23KejOlwMP/uxcqAywJlevh8dbCpZBjF0+RmdfElA1ujVgLJ+6Uo2kUSeESNv8OofS+F56yE68nHQ4b9dQiJc/M3EDahqogjLpL6ElOqqLislcY1DQsTAspcc6Iv7/tFxUOdgqmTPm/YyZ117PtpC+RhAAWBSa1fByYo5EkT7WRyAnx1Qye1EyVaMJeKRi+blrul4OgU1tQgbGoDYrgJPsG9eM0Cs2MqSh71YF+MChvLzKow9+oWDH+kUEIeWgYj6QYyepfn7Nn80ps5vuFqpZ0HGecS8xuzLZouf6VngmIstkEdFzWaBy/iYwaZk6sqoFVpI0LUM9bpX3INC7fMSriemPHMMxoF0b0MJoQC8qE3e5o7jNKmQ1h2E09l3oZk6Zuk55qN1+UKEuZ+BJviacr9gQrffl/CvwURCoDmJVkx9M= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR04MB6972.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?b?QW1aQjBWVk5aWmNGTXJH?= =?iso-2022-jp?b?UzFCdjRFd0haMHMrVWZibnpZaGw4QUpjdEE3NGg3V2gyYjU3VEZCOExL?= =?iso-2022-jp?b?ODE0emM2ZGFiNmQ4TkRKQ2JsTERQR3h5WjRGUkZmOVNvVy9kU0FIZXRR?= =?iso-2022-jp?b?ZGhvM0ZBU3hMbTc5SHdGcnNKbnBYSFRzOXpGRDNWaFN2YVkrUmdLam9T?= =?iso-2022-jp?b?blM5b3kwUnlCdDg0VEY1RGRuUlEwZmN3a2pucldYb0ZzcGljKzRGYVc2?= =?iso-2022-jp?b?ZWxWOEZaejJrS2hESDZCRUNpOFc2TmhsWVNDUUR5b0tGUGVnSnIxeXdT?= =?iso-2022-jp?b?YzBvM0U0VzdWQUlFWUxLdnVqbGwwMy96WWhZWUFTOW8yeC9IekZGYXl0?= =?iso-2022-jp?b?akNpSk0wcnpRV0VuclJJV3ZTdVAwcVdQNmEwWS9ZcmpaWm1oN0NaWTFz?= =?iso-2022-jp?b?ck5sKzF4aGlWU1pSckpoYU45VklUcHA3b3dYSE5lYXBZY2hwWWgxU004?= =?iso-2022-jp?b?V041TEtVTXdOc0lBSWwremltWW9ZY0xSeU9ISitNZWtINGxnU2lEK21C?= =?iso-2022-jp?b?UldHNkM0TFBhMzBOWHE0YU5xcHVTYmZma3pkdm13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uck5wU0xPSTIzMG5EUm1WUGlsdUNKeW9q?= =?iso-2022-jp?b?ZlpBak52OGpoQWJ5ZmpDNk0xV0dSOFRMZEYwYjhLSGI4QzV0V09WODFm?= =?iso-2022-jp?b?S0hXcmZ4YS8xVE5GaEtUVWhVbUtRRE96OWg3Q2VxYS83cVRKWC9HZkZZ?= =?iso-2022-jp?b?WEcxSE9kUmV4bnVkU3Y1VGdsZWo2aERLbndUV3VaUnFxemtpY2l4U2lz?= =?iso-2022-jp?b?VzkxUzJiUDRjcThUV2dFZHhZaElYVlBYcEd2blYxTS9UWjAzR1JPS0tJ?= =?iso-2022-jp?b?SEJUTGRnWmt6diswaWxOZDNYOWRTQzZKLy9TaVpSWkYwSmNuMEljaTg5?= =?iso-2022-jp?b?SCsxVmQxMWluREhLSmozTjdlRXV6U1p4Nzd1N2tVRDltVGUwSGYwY09Y?= =?iso-2022-jp?b?c2x0NmRzUE9TQ09wZ1V1ZzAwdHY5R0E1M205WTZBaDFvVU95MEhJMFMv?= =?iso-2022-jp?b?c1NNakxNNUw4R1l2YkxnQVFrZkN5ZktBOVNJdWdqZHJrb0s2Sjl4dHhE?= =?iso-2022-jp?b?OWpQN2wyUFNuMmo3eWNTZXgzb0V4dEZoQkVzVEFjbHBSZlozY1RqMzl4?= =?iso-2022-jp?b?eEJMeEp4WDhVY20rWHpSWXo0YnYzdFhqYjZnWTdaZnMxZlpVeC84VSsz?= =?iso-2022-jp?b?RFF6UU1zWk1vaHRqY1dYNlBqRTRXYmJpRXg1ZWVCOHJxN1dObjNnNUE4?= =?iso-2022-jp?b?VElZK3Fud3ZzbVJRS0QxajRlZkpFVmJUMGZieFZ4MFNCSHV3eEJ0VFdm?= =?iso-2022-jp?b?NkV1elA0OTBvcz0=?= 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: eca85afc-2d84-456f-6ae4-08dc47eaf091 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2024 08:02:36.3368 (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: 7eHgCilzkDaKKMQ22oki/9RxgIGZ2r8xnkicEs+Yqais3Iq4EbYgzBXxC2BVBKRNWNzRZXHpHopUd5UUjoxWTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR04MB7400 Reviewed-by: Frank Hsiao 蕭法宣 Tested-by: Frank Hsiao 蕭法宣 diff --git a/fs/ceph/file.c b/fs/ceph/file.c index c35878427985..a85f95c941fc 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2191,14 +2191,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); @@ -2239,7 +2241,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;