Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2531081ybl; Mon, 19 Aug 2019 03:38:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzd/z2/b2Lp5Lf8Q3sWoc7Wo3Sly6QKxdoItFGebi4j4KY4aqqoJJth0/n1pdTw39KLYCGh X-Received: by 2002:a17:90a:23d0:: with SMTP id g74mr20649723pje.115.1566211100889; Mon, 19 Aug 2019 03:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566211100; cv=none; d=google.com; s=arc-20160816; b=mH9ZfTpnFIgZ+XcX+tpfjuGB1dF2dbApwuWTulfQdBTfjGHvTaj2utxRUZa60LzO2m HdODrbl1i7nlTNBlZxY8HOM2ETQEPPqm3cFGuMr7Af8yNzZPAd9mBG2jC1E43UKXBFdx AVlMfJVj37wdsU+/Yz99xN18tDA1cynQqO6B905GpnAy+/PDTaa5o6yq5wS0PXdBiYnT fOKZPdiaRP9LDe4FpQDqz5xO1FB41X+CtDOfSNonKSLeZTjAQF+BhJvH+ktbvWeK/CUH cB+7/pLhPo4tVqhO31aatLKaMpWz8gtoiOMNpP4EzwHZFnJFA4jlRCfsmtQ5V3/XqsTy zaYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=x9EdcXZ6X5xWQViMjwvGaMp2tRhZkn0t4s0n4fQyAjY=; b=qfzSXx8Pg5RYOttDs2ntEFSTwMhsVMNsv1r/nAALB2FQP6CKDdeX24xIjBIEj6URBx +cstjbf3gJUKFDSbUULZys0NWY3W+T+sOhS7oQHtXQ7F8fM4ayDtnv7LrpeimmRgh6kg l30qM+ofDWIS+Uar3PnNMfF9VTPuEVPZInHoA7yBfQgYPe6b+Gu2gyo8yjsbyh39Rxqy SwpLk32cyGHGcyedmO+vHUMGQtXN/szdt+79hc5gAG/wx+IAC+rYv2tTyJv8L1xQ8aRR MwWzwtoQNrMclriKnyEBL/Gvfpnydvy1eGakKE8GqihJIbUISPQAqDLi6hVqTOyPLWzl 8KnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i68si9953963pfc.153.2019.08.19.03.38.05; Mon, 19 Aug 2019 03:38:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727443AbfHSKfh (ORCPT + 99 others); Mon, 19 Aug 2019 06:35:37 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5151 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727351AbfHSKfW (ORCPT ); Mon, 19 Aug 2019 06:35:22 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 64C2A6BD296137F55081; Mon, 19 Aug 2019 18:35:17 +0800 (CST) Received: from architecture4.huawei.com (10.140.130.215) by smtp.huawei.com (10.3.19.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 19 Aug 2019 18:35:06 +0800 From: Gao Xiang To: Chao Yu , Greg Kroah-Hartman , , CC: LKML , , "Chao Yu" , Miao Xie , , Fang Wei , Gao Xiang , Subject: [PATCH 2/6] staging: erofs: cannot set EROFS_V_Z_INITED_BIT if fill_inode_lazy fails Date: Mon, 19 Aug 2019 18:34:22 +0800 Message-ID: <20190819103426.87579-3-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190819103426.87579-1-gaoxiang25@huawei.com> References: <20190819080218.GA42231@138> <20190819103426.87579-1-gaoxiang25@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.140.130.215] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As reported by erofs-utils fuzzer, unsupported compressed clustersize will make fill_inode_lazy fail, for such case we cannot set EROFS_V_Z_INITED_BIT since we need return failure for each z_erofs_map_blocks_iter(). Fixes: 152a333a5895 ("staging: erofs: add compacted compression indexes support") Cc: # 5.3+ Signed-off-by: Gao Xiang --- drivers/staging/erofs/zmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/erofs/zmap.c b/drivers/staging/erofs/zmap.c index b61b9b5950ac..7408e86823a4 100644 --- a/drivers/staging/erofs/zmap.c +++ b/drivers/staging/erofs/zmap.c @@ -85,12 +85,11 @@ static int fill_inode_lazy(struct inode *inode) vi->z_physical_clusterbits[1] = vi->z_logical_clusterbits + ((h->h_clusterbits >> 5) & 7); + set_bit(EROFS_V_Z_INITED_BIT, &vi->flags); unmap_done: kunmap_atomic(kaddr); unlock_page(page); put_page(page); - - set_bit(EROFS_V_Z_INITED_BIT, &vi->flags); out_unlock: clear_and_wake_up_bit(EROFS_V_BL_Z_BIT, &vi->flags); return err; -- 2.17.1