Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1869736ybt; Sun, 28 Jun 2020 00:20:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqUYzP0cMZaSMfe+KNnvYuNk3U2jZNnLpZ/ZE6GxfrLW3TvARjBLVpHamRdna3r4Lt6Fyt X-Received: by 2002:a17:906:48d3:: with SMTP id d19mr8997903ejt.180.1593328807825; Sun, 28 Jun 2020 00:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593328807; cv=none; d=google.com; s=arc-20160816; b=Z0fS4WNdyFFz8cxns7qTowAYwEDSq7XaXu1UHun7/z3ZSBKlj1lyLiAD0O+L3S5xp+ Yr9VvvHMuMmZ/EoNxT3v3nGqsHM4C7Ar/La29YRxq1Tl0cO4DlE9bV/qqpqe9aCa8q4Z CdY8AqMRdRRDj8yTv/CP3fvfsXm9mkp6r/YbcQFBY7CU9FzKTc3PA9HelyeYQdGAsHpP 5FlYAGAzS6U+vKFYsSOHaDWi/g50Qd6Kl13DaUTEUowjPerVnKn0tzxOdHhY/DIvN0VN eAB4XbyzCLCO4I8sks0teYy7W3J8gHhCWoJou8B0HtcNcxKRz9wMqQOAEyRDBOSW8wzJ nbyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date:dkim-signature; bh=kr5Hh8nwd6AcnAaTVWLNiDYRVrozXWT7OYnXlBTpbbk=; b=n72ztRdYkj+hTpK3NcyJu+7gsMiXbQLE0E1HTkkHUCGgYwYpM/4ReeGe8/OjDQ3y3D dOoVmfyl4P2P97tSjxxEITVY3WnJ/Rk069fb8nRUANM/Ab+Gvt/95rI/ea7jLx/J1SkH Dtq0gKaLYmX89tZp+Mi6lrwPLtkpgpgMZfOAwbB8Xq7CgmSE5czaq7Ed374rAKtW6qHv i8VaGSHFCscX3C7Flj/DWtpI4wu7QIyga67lm0Rwcp6m7wCVC3n4t2cFUnFRbzGSwrod 0Q9lZZvUprtHBe6FupnZluauioMR2NsCOv2vpGye4M6cDLJEmwfxw/PO5xJEgsz4xHb4 g5UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@126.com header.s=s110527 header.b="BrvlO/OZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=126.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jt18si19218172ejb.445.2020.06.28.00.19.43; Sun, 28 Jun 2020 00:20:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@126.com header.s=s110527 header.b="BrvlO/OZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=126.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726055AbgF1HT3 (ORCPT + 99 others); Sun, 28 Jun 2020 03:19:29 -0400 Received: from m1514.mail.126.com ([220.181.15.14]:54939 "EHLO m1514.mail.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgF1HT2 (ORCPT ); Sun, 28 Jun 2020 03:19:28 -0400 X-Greylist: delayed 1889 seconds by postgrey-1.27 at vger.kernel.org; Sun, 28 Jun 2020 03:19:27 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=/EfVl 9jaErOonQ6lQzf9oi45csPLkH5eaVbWiGfOfuQ=; b=BrvlO/OZDrXHWDxY5mnrG 0Qsl/n9Mmaz4+FjNDUVn0U2ZPRXVOrV4h63rTSfg/jcT2bkik9V368kTnskfYhgU hD7myh5Li70B4oOMg8vUkO5S2G/3UphK5iMM+6ToBJSZZ49/KT5RvOs+u7bKjc4Y lFewl1wg4/DGZCPqxCv0u8= Received: from jiangying8582$126.com ( [103.37.140.35] ) by ajax-webmail-wmsvr14 (Coremail) ; Sun, 28 Jun 2020 14:47:43 +0800 (CST) X-Originating-IP: [103.37.140.35] Date: Sun, 28 Jun 2020 14:47:43 +0800 (CST) From: =?GBK?B?varTrQ==?= To: tytso@mit.edu Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ext4: fix direct I/O read error X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.10 build 20190724(ac680a23) Copyright (c) 2002-2020 www.mailtech.cn 126com Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=GBK MIME-Version: 1.0 Message-ID: <7925c422.4205.172f9ae864d.Coremail.jiangying8582@126.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: DsqowACXPukRPfheEN3PAA--.28450W X-CM-SenderInfo: xmld0wp1lqwmqvysqiyswou0bp/1tbi6AJRAFpEA+roqAABsN X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogamlhbmd5aW5nODU4MiA8amlhbmd5aW5nODU4MkAxMjYuY29tPgpEYXRlOiBXZWQsIDI0 IEp1biAyMDIwIDE5OjAyOjM0ICswODAwClN1YmplY3Q6IFtQQVRDSF0gZXh0NDogZml4IGRpcmVj dCBJL08gcmVhZCBlcnJvcgoKVGhpcyBwYXRjaCBpcyB1c2VkIHRvIGZpeCBleHQ0IGRpcmVjdCBJ L08gcmVhZCBlcnJvciB3aGVuCnRoZSByZWFkIHNpemUgaXMgbm90IGFsaWdubWVudCB3aXRoIGJs b2NrIHNpemUuIENvbXBhcmUgdGhlCnNpemUgYmV0d2VlbiByZWFkIG9mZnNldCB3aXRoIGZpbGUg c2l6ZSwgaWYgcmVhZCBvZmZzZXQgaXMKZ3JlYXRlciB0aGFuIGZpbGUgc2l6ZSwgdGhlbiByZXR1 cm4gMC4KClRoZW4sIEkgd2lsbCB1c2UgYSB0ZXN0IHRvIGV4cGxhaW4gdGhlIGVycm9yLgooMSkg TWFrZSB0aGUgZmlsZSB0aGF0IGlzIG5vdCBhbGlnbm1lbnQgd2lodCBibG9jayBzaXplOgogICAg ICAgICRkZCBpZj0vZGV2L3plcm8gb2Y9Li90ZXN0LmphciBicz0xMDAwIGNvdW50PTMKCigyKSBJ IHdyb3RlIGEgdGVzdCBzY3JpcHQgbmFtZWQgImRpcmVjdF9pb19yZWFkX2ZpbGUuYyIgcyBmb2xs b3dpbmc6CgogICAgICAgICNpbmNsdWRlIDxzdGRpby5oPgogICAgICAgICNpbmNsdWRlIDxzdGRs aWIuaD4KICAgICAgICAjaW5jbHVkZSA8dW5pc3RkLmg+CiAgICAgICAgI2luY2x1ZGUgPHN5cy9m aWxlLmg+CiAgICAgICAgI2luY2x1ZGUgPHN5cy90eXBlcy5oPgogICAgICAgICNpbmNsdWRlIDxz eXMvc3RhdC5oPgogICAgICAgICNpbmNsdWRlIDxzdHJpbmcuaD4KICAgICAgICAjZGVmaW5lIEJV Rl9TSVpFIDEwMjQKCiAgICAgICAgaW50IG1haW4oKQogICAgICAgIHsKICAgICAgICAgICAgICAg IGludCBmZDsKICAgICAgICAgICAgICAgIGludCByZXQ7CgogICAgICAgICAgICAgICAgdW5zaWdu ZWQgY2hhciAqYnVmOwogICAgICAgICAgICAgICAgcmV0ID0gcG9zaXhfbWVtYWxpZ24oKHZvaWQg KiopJmJ1ZiwgNTEyLCBCVUZfU0laRSk7CiAgICAgICAgICAgICAgICBpZiAocmV0KSB7CiAgICAg ICAgICAgICAgICAgICAgICAgIHBlcnJvcigicG9zaXhfbWVtYWxpZ24gZmFpbGVkIik7CiAgICAg ICAgICAgICAgICAgICAgICAgIGV4aXQoMSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAg ICAgICBmZCA9IG9wZW4oIi4vdGVzdC5qYXIiLCBPX1JET05MWSB8IE9fRElSRUNULCAwNzU1KTsK ICAgICAgICAgICAgICAgIGlmIChmZCA8IDApewogICAgICAgICAgICAgICAgICAgICAgICBwZXJy b3IoIm9wZW4gLi90ZXN0LmphciBmYWlsZWQiKTsKICAgICAgICAgICAgICAgICAgICAgICAgZXhp dCgxKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkbyB7CiAgICAgICAgICAg ICAgICAgICAgICAgIHJldCA9IHJlYWQoZmQsIGJ1ZiwgQlVGX1NJWkUpOwogICAgICAgICAgICAg ICAgICAgICAgICBwcmludGYoInJldD0lZFxuIixyZXQpOwogICAgICAgICAgICAgICAgICAgICAg ICBpZiAocmV0IDwgMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcnJvcigi d3JpdGUgdGVzdC5qYXIgZmFpbGVkIik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAg ICAgICAgICAgICB9IHdoaWxlIChyZXQgPiAwKTsKCiAgICAgICAgICAgICAgICBmcmVlKGJ1Zik7 CiAgICAgICAgICAgICAgICBjbG9zZShmZCk7CiAgICAgICAgfQoKKDMpIENvbXBpbGluZyB0aGUg c2NyaXB0OgogICAgICAgICRnY2MgZGlyZWN0X2lvX3JlYWRfZmlsZS5jIC1EX0dOVV9TT1VSQ0UK Cig0KSBFeGVjIHRoZSBzY3JpcHQ6CiAgICAgICAgJC4vYS5vdXQKCiAgICBUaGUgcmVzdWx0IGlz IGFzIGZvbGxvd2luZzoKICAgICAgICByZXQ9MTAyNAogICAgICAgIHJldD0xMDI0CiAgICAgICAg cmV0PTk1MgogICAgICAgIHJldD0tMQogICAgICAgIHdyaXRlIHJ0cy1zZWdtZW50ZX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