Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp656439ioo; Thu, 26 May 2022 11:28:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2PZzvJvB30n2Dbz3w3c1KUyX7G/gyn5hcde16i3rxET6w9XWsVf9R8fsTQ72BEyH/1R0w X-Received: by 2002:a05:6a00:c85:b0:518:b4a7:cce1 with SMTP id a5-20020a056a000c8500b00518b4a7cce1mr18215317pfv.66.1653589710311; Thu, 26 May 2022 11:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653589710; cv=none; d=google.com; s=arc-20160816; b=O+QqpFr1HDMFqkHkKwTQm2o32pDiafGgnuHRQfq1QTv2UaCVHEAWpyasTfi43DP5YI bSiTG0iV694qB9cId0q4HCcquLpR2TJn0NFjztQOWYknSlLIo5FTfeQj2Vj8FfnzPjN6 D0GaQ52TtzVzVL0qQ8enUFrXYfw2CUppHq1AmRbXd5JUZ0ODACbzqjIOhmuoZoWMphaJ G02MMv0MymaqrWF4VnOxhlWChsKttWAX/2zwwbRY11ETHshdi6Xy3V7vsyyGlOSHnev1 vYfV4G4MlDvSayvfzWAd6GCH1Zv4IfMCIXvWouolEOks3ygJlH9bgAj7bi07y32RoeGr 75fw== 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=s6VXpoAsiRGpdbpPCCHi7C51oNxk9H2S7o1MudINy5k=; b=F73b9/Ngiw1gWMbkxVNTIhxx7i4ixhYtg3M/EGaMlkpAMNvVxR61rSproaFj0m1aHu I33Vc54OS+fBuBSO5MxwE4EFLAug5Hu2Td7oT46dBno2J0NAgRDvktxipJqyFtQnrPFP HRSuFJESSFB/5ByTyXyiguSNxyDHKc6S6HKTvpI7Jydl3ikEAVIfqFBQCWT1T65robeN Pq7BhKyy62O4xTjKlNZpmBQz2ZQk+0DzqPvCqNYpHmgaj1VeNrcRvwvE68j1yV57P4TH tRHpMeQkkMhZVezqxiPkqhVuekU2FebSEc9562qVUyZpCHMwjwQJAXRN+tV8yE6QW8B+ ye9g== 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 t11-20020a65608b000000b003f25f65e382si3189903pgu.658.2022.05.26.11.28.18; Thu, 26 May 2022 11:28:30 -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 S1345319AbiEZBD5 (ORCPT + 99 others); Wed, 25 May 2022 21:03:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345387AbiEZBDy (ORCPT ); Wed, 25 May 2022 21:03:54 -0400 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B95B8D6AE for ; Wed, 25 May 2022 18:03:47 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R711e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0VEPlGvz_1653527024; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VEPlGvz_1653527024) by smtp.aliyun-inc.com(127.0.0.1); Thu, 26 May 2022 09:03:45 +0800 From: Jeffle Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2] erofs: leave compressed inodes unsupported in fscache mode for now Date: Thu, 26 May 2022 09:03:44 +0800 Message-Id: <20220526010344.118493-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,RCVD_IN_DNSWL_NONE,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 RAFS v6 images are downloaded and then decompressed on demand as an uncompressed erofs image. Then the erofs image is mounted in fscache mode for containers to use. IOWs, currently compressed data is decompressed on the userspace side instead and uncompressed erofs images will be finally cached. The fscache support for the compressed layout is still under development and it will be used for runtime decompression feature. 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 Reviewed-by: Gao Xiang --- 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