Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4178078ioo; Wed, 25 May 2022 17:29:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLsiCNjnSF25cvTIn350wkYEKb2BivxjwBtEztR4Gb6+TU9wxSqpeRxNw0TcDV7Bi28OY1 X-Received: by 2002:a17:902:da89:b0:162:47dc:681d with SMTP id j9-20020a170902da8900b0016247dc681dmr10080757plx.85.1653524941587; Wed, 25 May 2022 17:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653524941; cv=none; d=google.com; s=arc-20160816; b=eCR138dlHz8De4+WHAaNRhgK8oIvaYr0/WqnERUcrLGN5Ymtvd3dGULdu1vYOW5DoW r1rnPYSGBFi3lJydA0ZfjFJZ9nZ0cbK7ivE0AtqCeAuWu8qiY4zHupFP17d1Pu0m2qww nmeUVIFvW2xY6Y0pScORO5BQiqOY8sDe+MJhdJlRFip2LWtfuIxNK5MskElHAnNeCzKl ZlDnVOoRifPfEMuhqmQTllCrhHYG7XOGYCY2Ti6pV3lDvhS87nwbgwa/qSFK8x3BnbQZ dz0smn3pwgD286GGzO+UKI4PSCb9bXbf+Igbd8XEj6BffpkRx+4YYTQ5zh/NPh92yfxM 14TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=yhwMuq9bFmKEAEKlg532GRpn53y11P6l47DQfQJeJsk=; b=zvHXbaC6IT9atyx4vL9wu1W9yYhsOfYvh2/k05x7klCi45xVXxPuuDngbXiUrOh+Mq 3U0aaj6apHO/IQ2hNOXG4Y1azQWd2S3Ux6kCAw7Gn6ZRQTAF88L94tkXynuoNYz1CsIU GmSWZ1ovPmdEORgyhYAtIi1szJ3uEF2W9ISLLn+WWjrh1D/NcIBbOlAjl/7jk6JV1/Us Va2oIx5PM73VazgcfCT3bked9JRvzdMMaxVJgLn3XcT4Glv+vY5aHgiv+0YY0kqUA4a2 jlUS9pEWHQ63mrTXCvQasJQIZfowQSAuLgP+ViU3jGSJeg2bweNPbeEPdulLss2Jc4Hn xWuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a63d811000000b003f5ef3afdb6si524164pgh.409.2022.05.25.17.28.49; Wed, 25 May 2022 17:29:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231147AbiEYIAB (ORCPT + 99 others); Wed, 25 May 2022 04:00:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbiEYH7z (ORCPT ); Wed, 25 May 2022 03:59:55 -0400 Received: from out199-12.us.a.mail.aliyun.com (out199-12.us.a.mail.aliyun.com [47.90.199.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FE0F7CB4B for ; Wed, 25 May 2022 00:59:54 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0VEMXST1_1653465590; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VEMXST1_1653465590) by smtp.aliyun-inc.com(127.0.0.1); Wed, 25 May 2022 15:59:50 +0800 From: Jeffle Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] erofs: leave compressed inodes unsupported in fscache mode for now Date: Wed, 25 May 2022 15:59:50 +0800 Message-Id: <20220525075950.21535-1-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org erofs over fscache doesn't support the compressed layout yet. It will cause NULL crash if there are compressed inodes contained when working in fscache mode. So far in the erofs based container image distribution scenarios (RAFS v6), the compressed images are downloaded to local and then decompressed as a erofs image of uncompressed layout. Then the erofs image is mounted in fscache mode and serves as the container image. Thus the current implementation won't break the container image distribution scenarios. The fscache support for the compressed layout is still under development. Anyway, to avoid the potential crash, let's leave the compressed inodes unsupported in fscache mode until we support it later. Fixes: 1442b02b66ad ("erofs: implement fscache-based data read for non-inline layout") Signed-off-by: Jeffle Xu --- fs/erofs/inode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index bcc8335b46b3..95a403720e8c 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -288,7 +288,10 @@ static int erofs_fill_inode(struct inode *inode, int isdir) } if (erofs_inode_is_data_compressed(vi->datalayout)) { - err = z_erofs_fill_inode(inode); + if (!erofs_is_fscache_mode(inode->i_sb)) + err = z_erofs_fill_inode(inode); + else + err = -EOPNOTSUPP; goto out_unlock; } inode->i_mapping->a_ops = &erofs_raw_access_aops; -- 2.27.0