From patchwork Wed May 16 15:39:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changwei Ge X-Patchwork-Id: 10404239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4152601C8 for ; Wed, 16 May 2018 15:41:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96C852853E for ; Wed, 16 May 2018 15:41:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 945E82851A; Wed, 16 May 2018 15:41:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher AES256-SHA256 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DA37D2851A for ; Wed, 16 May 2018 15:40:55 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4GFZntd089923; Wed, 16 May 2018 15:40:10 GMT Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2hx29w5fam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 May 2018 15:40:10 +0000 Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4GFe7hj030141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 May 2018 15:40:08 GMT Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1fIyX9-0005qB-9e; Wed, 16 May 2018 08:40:07 -0700 Received: from aserv0022.oracle.com ([141.146.126.234]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1fIyWh-0005jf-1x for ocfs2-devel@oss.oracle.com; Wed, 16 May 2018 08:39:41 -0700 Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4GFdcnr006889 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=FAIL) for ; Wed, 16 May 2018 15:39:38 GMT Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4GFbcdD036719 for ; Wed, 16 May 2018 15:39:38 GMT Received: from apc01-pu1-obe.outbound.protection.outlook.com (mail-oln040092254109.outbound.protection.outlook.com [40.92.254.109]) by userp2040.oracle.com with ESMTP id 2j0peehbqd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK) for ; Wed, 16 May 2018 15:39:37 +0000 Received: from SG2APC01FT028.eop-APC01.prod.protection.outlook.com (10.152.250.57) by SG2APC01HT220.eop-APC01.prod.protection.outlook.com (10.152.251.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.696.11; Wed, 16 May 2018 15:39:31 +0000 Received: from SIXPR06MB0461.apcprd06.prod.outlook.com (10.152.250.52) by SG2APC01FT028.mail.protection.outlook.com (10.152.250.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.696.11 via Frontend Transport; Wed, 16 May 2018 15:39:31 +0000 Received: from SIXPR06MB0461.apcprd06.prod.outlook.com ([fe80::9c0b:d14f:670f:18bb]) by SIXPR06MB0461.apcprd06.prod.outlook.com ([fe80::9c0b:d14f:670f:18bb%14]) with mapi id 15.20.0755.012; Wed, 16 May 2018 15:39:31 +0000 From: Changwei Ge To: Andrew Morton , "ocfs2-devel@oss.oracle.com" Thread-Topic: [PATCH] Revert "ocfs2/o2hb: check len for bio_add_page() to avoid getting incorrect bio" Thread-Index: AQHT7SwVJ87l+S8/VE69M1ih6y/gmQ== Date: Wed, 16 May 2018 15:39:31 +0000 Message-ID: Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK2PR02CA0136.apcprd02.prod.outlook.com (2603:1096:202:16::20) To SIXPR06MB0461.apcprd06.prod.outlook.com (2a01:111:e400:b411::15) x-incomingtopheadermarker: OriginalChecksum:7B70E2DB0117263C762228160527B06CCD216FE58E210DE37128E72E50F3D5F3; UpperCasedChecksum:92AA194004C94CD0D1DA52EEC29ADF4E82DDF0EE2F1B331A259D0C6CDC051D08; SizeAsReceived:7474; Count:48 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [MPoGPIWO0nwToO23gdIOimgPs/IUuvzj] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SG2APC01HT220; 7:Rjq2GrRdekYolo2Uqj2cbWEF5AeMG5tkGzYEVo1tyhtOU1v04F/OkYQIR/Z/vUDIfWN9/911PXlARrydSc9MPElrszwCGCMnCkJnr5ZxCI+8SGxMdvjliGe9lTUBKZvuqnEcZsfGDaQPaBbYM+5cLjoGdm6ocgChTb3WsadQFOfhHP0nYqKjkJ69uDbGOCyVH9+QG4FBMjqQ7zSq+ggXnoJka3IVQP539tvu2AntC4O7qRyTgDrQoZLZ38LNpy9D x-incomingheadercount: 48 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125464)(1701031045); SRVR:SG2APC01HT220; x-ms-traffictypediagnostic: SG2APC01HT220: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:SG2APC01HT220; BCL:0; PCL:0; RULEID:; SRVR:SG2APC01HT220; x-forefront-prvs: 0674DC6DD3 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(979002)(189003)(199004)(386003)(7696005)(3280700002)(3660700001)(81612004)(82202002)(81156014)(4326008)(8936002)(8676002)(2900100001)(25786009)(68736007)(86362001)(99286004)(1857600001)(6506007)(54906003)(476003)(575784001)(102836004)(6346003)(26005)(110136005)(486006)(305945005)(105586002)(74316002)(33656002)(9686003)(97736004)(55016002)(106356001)(74482002)(104016004)(5660300001)(5250100002)(5890100001)(14454004)(2501003)(6436002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1901; SCL:1; SRVR:SG2APC01HT220; H:SIXPR06MB0461.apcprd06.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:; received-spf: None (protection.outlook.com: live.cn does not designate permitted sender hosts) x-microsoft-antispam-message-info: AMdzF2VxXJiUEswIO5UFoDnISN8kSxAc3dFHh3xu4vbNU+YGiyngTrs8+iW8a+lAGg3GUS6Yq9Yk/1ZicvlcTovsRyGusy79g5JPitflAE/MiTRCab6XwsFSCAb3UWnYHLFQ8VfLGbrTQr9HEvroO5kZfO2CGsD/Y/s3gJPAgoHUs6/qjnu318w9kChGU7EL MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 4cfd991b-4def-46b0-4368-08d5bb43377b X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: d4d70346-2c10-4f39-8c00-e767963926d9 X-MS-Exchange-CrossTenant-Network-Message-Id: 4cfd991b-4def-46b0-4368-08d5bb43377b X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: d4d70346-2c10-4f39-8c00-e767963926d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2018 15:39:31.5665 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2APC01HT220 X-CLX-Shades: MLX X-CLX-Response: 1TFkXGxgSEQpMehcaEQpZTRdnZnIRCllJFxpxGhAadwYbGhJxGxsQGncGGBo GGhEKWV4XaG55EQpJRhdFWEtJRk91WlhFTl9JXkNFRBl1T0sRCkNOFx0ZeF9ZElBHHmhscmFfaH wHRW9MUllSXUVdW0lsXVNbEQpYXBcfBBoEGxkeB0geSx5JEktOBRsaBBsaGgQeEgQfEBseGh8aE QpeWRd5Z0x8fxEKTVwXHhkeEQpMWhdoaUJrexEKTEYXY2sRCkNaFx4aBBMYBBgfHgQbGhMRCkJe FxsRCkReFxkRCkRJFxgRCkJGF2cTbWAbW2VCH359EQpCXBcaEQpCRRdhRlhrHWFQEm9oTxEKQk4 XYHgeW1JaW38dfkARCkJMF29cGXwFRXpQHUhIEQpCbBdkYU9LYEJIEngdZxEKQkAXbWhCU3AeXn 1bYGkRCkJYF2J9b3kBTxgZcHB7EQpaWBcYEQpwZxdvYRxZZ1IfehJsGBAZGhEKcGgXZ3BwUFwdT GdDaEIQGRoRCnBoF2B8BV1Oa3pcWk1sEBkaEQpwaBdnGAUdHVsSYkF7HBAZGhEKcGgXb0FtQ3JF aB9wfWUQGRoRCnBoF2F6fE4Zaxh4RgEFEBkaEQpwbBdtThtvUwFHUkgdcxAZGhEKbX4XGhEKWE0 XSxEg X-PDR: PASS X-Source-IP: 40.92.254.109 X-ServerName: mail-oln040092254109.outbound.protection.outlook.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:spf-a.hotmail.com include:spf-b.hotmail.com include:spf-c.hotmail.com include:spf-d.hotmail.com ~all X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8894 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=0 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=128 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805160157 X-Spam: Clean Subject: [Ocfs2-devel] [PATCH] Revert "ocfs2/o2hb: check len for bio_add_page() to avoid getting incorrect bio" X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8894 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805160157 X-Virus-Scanned: ClamAV using ClamSMTP From: Changwei Ge This reverts commit ba16ddfbeb9dde0df67cdb2006820e9cf4d99386. >From my test, this patch introduces a problem that mkfs can't have slots more than 16 with 4k block size. And the original logic is safe actually with the situation it mentions so revert this commit. Attach test log: mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 0, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 1, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 2, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 3, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 4, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 5, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 6, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 7, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 8, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 9, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 10, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 11, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 12, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 13, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 14, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 15, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:463 page 16, vec_len = 4096, vec_start = 0 (mkfs.ocfs2,27479,2):o2hb_setup_one_bio:471 ERROR: Adding page[16] to bio failed, page ffffea0002d7ed40, len 0, vec_len 4096, vec_start 0, bi_sector 8192 (mkfs.ocfs2,27479,2):o2hb_read_slots:500 ERROR: status = -5 (mkfs.ocfs2,27479,2):o2hb_populate_slot_data:1911 ERROR: status = -5 (mkfs.ocfs2,27479,2):o2hb_region_dev_write:2012 ERROR: status = -5 Signed-off-by: Changwei Ge --- fs/ocfs2/cluster/heartbeat.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 91a8889..ea8c551 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -570,16 +570,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, current_page, vec_len, vec_start); len = bio_add_page(bio, page, vec_len, vec_start); - if (len != vec_len) { - mlog(ML_ERROR, "Adding page[%d] to bio failed, " - "page %p, len %d, vec_len %u, vec_start %u, " - "bi_sector %llu\n", current_page, page, len, - vec_len, vec_start, - (unsigned long long)bio->bi_iter.bi_sector); - bio_put(bio); - bio = ERR_PTR(-EIO); - return bio; - } + if (len != vec_len) break; cs += vec_len / (PAGE_SIZE/spp); vec_start = 0;