From patchwork Fri Feb 16 04:24:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RnJhbmsgSHNpYW8g6JWt5rOV5a6j?= X-Patchwork-Id: 13559546 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2096.outbound.protection.outlook.com [40.107.215.96]) (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 A12A8125C7 for ; Fri, 16 Feb 2024 04:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.96 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708057493; cv=fail; b=Y+vsIlwB97XHfhZ3fLETAS7WZnxCVMgQB8sadtVaAFEFhM/5Ku9T4iQBx6dO2RHlwUbVKPJZXZkFFP5ZwjmRtfsW3BweWwI/XmizcgrMqhJ+kPGoH6tfNxJmqRjU9au4O51yHL3hp4cKagly7+UXXQv4++wdL/ujbXePdVIIN3Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708057493; c=relaxed/simple; bh=j8Y96RvC0QHeh8YJjN8rzBuYKH7C/bl3e353DwsyjqU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=mYtwitzd7jb0fsohVlAgpIQcoUitsbhQZBg0Vd2icrH+2KLudrTeVmP7OjWyEq5sTpF87x9M9ZD4fqmz39riH0vaHltNnF3FPaOSaZr1I/VExnTiafuZH57Fp8XaXK1FKO0EY5rGKlYgEn+bDc2HRt+1DSDOJu27ajIrgWQdca8= 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=gQsgf5ig; arc=fail smtp.client-ip=40.107.215.96 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="gQsgf5ig" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M7VE9mlvopHIUbq9nc7EvA/BTPh7BVyynW2fLSZtKcH6MJrKPITlRGIertM2jVISQFX8QV472UXUX43tJcX6Xs28EFAbC9PFW5zZJvibUbcwdVuCBBbETXgDSiZiCA7qBkz2jF4WUML4SZtva6jjvu3dPfeemkv/smtShxQctwdXjw+J6YiBcsOPDyMOG1uczDWgTsg00qUHS/mS9FDdbtLuqR8l+sijlrFmQjM2dVOCu6RidFcn1hyhJ549xUnf4svB700O5M1UtgnnGWR0GzTmIVMvBX+5hTS/mcUKfQgonjCfRvg3yCP6nXZ2o8zsscTunFMPOdajCo5vKHLwSw== 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=j8Y96RvC0QHeh8YJjN8rzBuYKH7C/bl3e353DwsyjqU=; b=B00oIpCRmB6HlP3K2MBgq4IIFOVw27bn36U9nMHxiTlCO4yb69NbQi0hD7T1f04HTEjq1oLdN1hPOwsJRRYcl1/aFwAuRiuWkgBpOBraHKC3m12o8YEe9kOBOWMBYgq5oniw1Y/dm9AFxI4ncJtDoIR2C13S7ArdDAgaTKebyDcTdgaqcatC/uV+RAXsJSHq2bjidrd+2LORwoTkzoMYikEVZDapOM9el1knl35isem3Uc9Il0lrMIvaCjjQ2zmXDOf3dVQiz3eKICqcp6Wrj01bOgFtjCUAn/tTZyFg3sFzINMKP1JlXoCnQFp6K9yPcMxS3teu+e/JmffJCODssA== 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=j8Y96RvC0QHeh8YJjN8rzBuYKH7C/bl3e353DwsyjqU=; b=gQsgf5igNJWPEp/FpMqq+EFTGNul81s9UDOEsdY2dhHIe3HaUM6CrWS5bvp1hqmYmPXVW+FVv59NU7oceTFdwy8pV2VRypfyLdw1cWVbNkZtSu8801VLAsBvr1tM2r2cy5fk2CjFu7JchW0YyWMwkQw+NS0h1atPGLdKlOBRTqFJjYdlFbQzeaCd0ScjLk403sSUDYLDjpFt5+cxzY32tHs8Qayw9QDAKEj5ITchLl3u1heScfxDQ5O+oR3fFFT4idnHsrsdRdlwOee6ilGPKkidEuF569jkMfl2vcwraH2NL2CUXVaVNEa4DUXzf7wHzBXAnYvDqWbMYKYRLAN/ng== Received: from SEZPR04MB6972.apcprd04.prod.outlook.com (2603:1096:101:ef::7) by PUZPR04MB6141.apcprd04.prod.outlook.com (2603:1096:301:da::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Fri, 16 Feb 2024 04:24:47 +0000 Received: from SEZPR04MB6972.apcprd04.prod.outlook.com ([fe80::9f09:7b37:9bd6:cfdd]) by SEZPR04MB6972.apcprd04.prod.outlook.com ([fe80::9f09:7b37:9bd6:cfdd%5]) with mapi id 15.20.7292.029; Fri, 16 Feb 2024 04:24:46 +0000 From: =?big5_tw?b?RnJhbmsgSHNpYW8gv72qa6vF?= To: "ceph-devel@vger.kernel.org" CC: "jlayton@kernel.org" , "idryomov@gmail.com" , "xiubli@redhat.com" Subject: =?big5_tw?b?pl7C0DogUmVhZCBvcGVyYXRpb24gZ2V0cyBFT0YgcmV0dXJuIHdoZW4g?= =?big5_tw?b?dGhlcmUgaXMgbXVsdGktY2xpZW50IHJlYWQvd3JpdGUgYWZ0ZXIgbGludXggNS4x?= =?big5_tw?b?Ni1yYzE=?= Thread-Topic: Read operation gets EOF return when there is multi-client read/write after linux 5.16-rc1 Thread-Index: AQHaTnBMaFmF63blQUOSXPXYY4zuRLEMgof1 Date: Fri, 16 Feb 2024 04:24:46 +0000 Message-ID: References: In-Reply-To: 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_|PUZPR04MB6141:EE_ x-ms-office365-filtering-correlation-id: 4966686e-295a-4baa-2904-08dc2ea7352c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eLUvorjuQIrcWO5JwsOqzB8bIaLlhL7WIZyX8fSTfbt+NhC/PKFFr0BSSu8IX3QtDTsqtn67cItuQ+W8G0FOgSUuxTcsJqoHrLeGIYZZ1Xs3/nEzqFKPIJtf6++hL/td7G3SquDvNHC15rvfQtRgCHZB03UmpV3Xx+MM/3h/slAeqeYTH/UX895SkzbrOFwgKfRolKClIMStaKp63KNTbu2pyT+4+eUAD5HRq6diJHxGHz4yltBKmP/EGqufoORqFVpBE4z3Mt/DuiVpr6qkZwIzzSi569HbwCuaX854J5FiFD2mxTvipuEH9qBrkVVigC99bXIe739vYYn09s3Kly8F+dgLjINQINklmLERAyLVy4K6QP/ip3mIh5vYgsTBryr0NIE3BfvQvorhqJDScYqDql9UMh690yJjjUIQ1KhE4iZSFqdSWslJfrzWN1NZEgwg8+JmosHKOVr0mUGZmOyk5X4NF6nAcEHFuoxj10Uu74xspcQSJxM+qhgHEJXx5ig17XhPBVqDT6Y43M3QPWpmNl0EN7yLLAnvbJV5ynzQohgeNMjO1o5APZw49TcjuIuATR5gh9jdTJQRxJCxliwkZtWmEWghnAf22aT6nDON15kcsGvGtAgXGLn3s1Yz x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR04MB6972.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(396003)(39860400002)(346002)(136003)(366004)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(55236004)(478600001)(316002)(71200400001)(54906003)(6506007)(7696005)(9686003)(26005)(41300700001)(2906002)(5660300002)(76116006)(52536014)(66476007)(66556008)(8936002)(4326008)(66946007)(66446008)(64756008)(6916009)(91956017)(86362001)(224303003)(85182001)(38070700009)(33656002)(83380400001)(122000001)(38100700002)(55016003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?big5_tw?b?MGN2ajhiMXM1WlRCamFiNzRJYmdI?= =?big5_tw?b?R1VNaS9reS9oSlFhVkcrNE1BS1VCWXJ6cUk1WG9nNUpDd3dURVVCQ1BkaGcrRXRD?= =?big5_tw?b?VXlneXBONU9qaVBHRGgzcWQ3LzdzVFk4cEo2K2VDei9iNlRvMU5XWm9GaCtjSFdZ?= =?big5_tw?b?K3dyUnhsQjlLaWRpOUYxOUI0VlAyakd4OEkyVTNFMjV5dHhkb1VJL3pKMTRxQWRo?= =?big5_tw?b?b2w2engvZGxYMW1rQ1duUDIyOTR0NS9pK1RMRDVCRWJoenM1MHVmMWlKNGJ1aUxs?= =?big5_tw?b?SDJpZFA4am0yY3FtOC95RE4zQ3EvdkhKYTFobGE3cklLaHlLVDE4VXRvYWNyeGg2?= =?big5_tw?b?MytzNWNiWXZrL1VrMUNMdXdlRHVCMmlDMVcrVG5GaHBrM1JsOXFaTld3VTRYNDI0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?= =?big5_tw?b?ZkNKaUhBc2tSNXN5OHhGejNqN2dSRTg1WGtnODdxL3ZrYmx1RUZhQzdHOG1qaE5n?= =?big5_tw?b?a0VuSGdlQ2NGejliSUZsRENRbXZ4MXZhSlllTmhIRHVXNjdNaDFjQ1F5MUhJN3BS?= =?big5_tw?b?U1lwekRUemJSeVRwYW1KblFFOWRvd0FTRTZQN0Q5U1g4ZzNUNm1yb1BhYnNpVGd1?= =?big5_tw?b?Y3lKSnNKZG9GZ1BhbW5ObnFYL24rR1d0ZW5rL2V0alI5MzFqbmZhNlMrUzl6dTc3?= =?big5_tw?b?S2wrSlA1VFcwVldvRk1Xd0EvWWp3Y0IwSjlBNGlzaGtNYXVTTy9PamdXR3JKOVla?= =?big5_tw?b?UFFNeHdaSUs3azlUanI1MmRvaHJUN0dsUmdWbnhjcVRDVGxWa0F6bmtlOWM4cGVQ?= =?big5_tw?b?SkNhK2FXZFYvc2x4bVdFTFRGaUVjcHlyWHlPT3JsRFc5d25pWEpDZFIzZmNzUXky?= =?big5_tw?b?M3E3SnEveXduM1BmVE1odXh3Y29JdWdkcllKb3pjQlZQL0JUYlQ4UjVYL3N0REta?= =?big5_tw?b?NkhId054S0w0VlYxNlZTdXR4dFk3eFdaa3VYWFJsS3FqK0pPQk9kQkVvL2pqQTdZ?= =?big5_tw?b?OG1Hc0tZcUJQMmNmdWVzUVNwdER6eEVTaWcvcTNGdkZxeElaNTV4eDBEbUtjd2pY?= =?big5_tw?b?TTFMUkltb1ZaaHVsNndZU2lyOWFRZDdMY1lZbEIxYTB5cjc0YWJ2M25HZkVzZnh6?= =?big5_tw?b?aGszSE0yYmtyOTRLL00vVEREUllTWktrRWdRaExyUjl5ZGtJTkw0RmJndVVpODNV?= =?big5_tw?b?Q01GSkxZcWc4Y1VjQTJvWlhaK0lLUT0=?= 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: 4966686e-295a-4baa-2904-08dc2ea7352c X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2024 04:24:46.6100 (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: 0YfX676fpkb7uE3EzhrhhtpUAd0DzMt0cvabM09mu9Mtigi974aZlj6Hqn/v3HL/FqaNcUIK2hG48ecgCylGSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR04MB6141 Hi, it is a friendly ping, thanks. diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 220a41831b46..5897f52ee998 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -926,6 +926,9 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, idx = 0; left = ret > 0 ? ret : 0; + if (left > i_size) { + left = i_size; + } while (left > 0) { size_t len, copied; page_off = off & ~PAGE_MASK; @@ -952,7 +955,7 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, break; } - if (off > iocb->ki_pos) { + if (off > iocb->ki_pos || i_size == 0) { if (off >= i_size) { *retry_op = CHECK_EOF; ret = i_size - iocb->ki_pos;