Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1127409rwb; Tue, 29 Nov 2022 09:16:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5TgUXCNjHBnzvIMZhi07y61Tm0yxejggywOGDagf5RtkPlb9lOiwXXx6nBa72FoR3sCX20 X-Received: by 2002:a17:907:72d2:b0:7bc:15fc:5398 with SMTP id du18-20020a17090772d200b007bc15fc5398mr21068893ejc.438.1669742199861; Tue, 29 Nov 2022 09:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669742199; cv=none; d=google.com; s=arc-20160816; b=ArzNdx1Q3osueIWcCnkgvLeD13fVIQwNUJNviykaxaZvXIxgitj9BxpIOXy0Z+CZAj liqdAKtBNtDWD/3v2AxubPteDZSobr/7Y2R+BVkpy4D4wZB5TGxSmqhRiAW8D/gpBA2D ngFuJnAZl0DiMqJ9v6hqcGnJCG13Z29yOyxz1EvSi2IVD07SaUFXebQkLRpbwz1QNVnM iAlUO6xV2QzFeALLm2KBl49BQRXgohoWrCjOI6diAsfhdfRnMmHC6i2pNTsKmNIit5Pt 8gHsFIHxErieGo+RfGUX1QAb/RJVH2yNKRWb5aGqqcAFHu5sG0qyq9h7qkT7rB6KTZOb PeGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E+tbc2lDiBogvZ7rT9cVbNRViYXZGcr4VvihH/NIDFI=; b=EJLhhTDqlRaYugRjl6cwPXB0uU8EzhnG0PAthdVpY5PZ6dbTeDHnaeIhOe+4slNgS7 4FzoCmEfGZaKfoTLW8fY/hwxZnd7l+odRTrYDPsReNg2Tr+nkMC5msibJayuPWipCO/U IZorgKtyBOClh+qNQWZyXevmsKG6Kpj8U9668uCNA4aHXTJAGsRJGA7Pb8wZEjcjc15s 3Yj0o/ZOSaJx2fnmkxAcbPUjoeVFtpaC7jltxU989nD7WGsN3swNj/rTkym0hlEjTf7R HUeDRIfqdJ8nRCWagTdoT3z3KkqNgXDgRn+Fy4Qi05ishakhREs5lECBwy2zgELKVDDW b2wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YOLogoxh; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a056402500200b0046b2327fad1si5508783eda.341.2022.11.29.09.16.07; Tue, 29 Nov 2022 09:16:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YOLogoxh; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236424AbiK2Q65 (ORCPT + 99 others); Tue, 29 Nov 2022 11:58:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235803AbiK2Q4o (ORCPT ); Tue, 29 Nov 2022 11:56:44 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F7406931E; Tue, 29 Nov 2022 08:51:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E48F06182F; Tue, 29 Nov 2022 16:51:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22B39C433D6; Tue, 29 Nov 2022 16:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669740667; bh=LYZJsu1DOlRQkmkTy7jSyaGxwY1+2mNBCvXV9Xgev8I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YOLogoxhcyZA3N5S2zyPuNJoGHUstbKWRioer7l/SCiUpR522WqAdEk1LE8tJxYPW 9FAYyVMlIW4Of/Y23n1jkPzgyTc+QLOT04hID5rcJzrjRz543axOVHzO0wiMoLalCW k9yVOoOQP+yqKyDY+jXefpZ9BtPiesiu35bIrNfe2vX62DBtvMdtMj98Sue/qiH2zz T1AdNXDXjJk/T9Dq2FnVDKqxiQtJLL7HnqX35f16fpq7dHPnp65lQ5zECBC01tsS92 rOj7snaNP+UryAUECK0o9EFBb0PugZ5nLrM+d/cQIcoe3SIz0a5+W/NI8UBEsjQ0BL keZ0N/w1jhtbQ== Date: Tue, 29 Nov 2022 08:51:05 -0800 From: Jaegeuk Kim To: Eric Biggers Cc: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Matthew Wilcox , Chao Yu Subject: Re: [PATCH v4] fsverity: stop using PG_error to track error status Message-ID: References: <20221125190642.12787-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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-ext4@vger.kernel.org On 11/28, Eric Biggers wrote: > On Mon, Nov 28, 2022 at 10:48:41PM -0800, Jaegeuk Kim wrote: > > > static void f2fs_finish_read_bio(struct bio *bio, bool in_task) > > > { > > > struct bio_vec *bv; > > > struct bvec_iter_all iter_all; > > > + struct bio_post_read_ctx *ctx = bio->bi_private; > > > > > > - /* > > > - * Update and unlock the bio's pagecache pages, and put the > > > - * decompression context for any compressed pages. > > > - */ > > > bio_for_each_segment_all(bv, bio, iter_all) { > > > struct page *page = bv->bv_page; > > > > > > if (f2fs_is_compressed_page(page)) { > > > - if (bio->bi_status) > > > + if (!ctx->decompression_attempted) > > > > If seems this causes a panic due to the ctx nullified by f2fs_verify_bio. > > > > Thanks for catching that! I've sent out v5 that checks for 'ctx && > !ctx->decompression_attempted' here. That's the right thing to do, since if ctx > is NULL then decompression must have been attempted. > > I'd like to get rid of freeing the bio_post_read_ctx in f2fs_verify_bio(). > But I believe it's still needed, at least in theory. > > Do you have a suggestion for testing f2fs compression + verity with xfstests? > I missed this because compression isn't covered by the "verity" group tests. > Maybe there should be an "f2fs/compress" config in xfstests-bld that uses mkfs > and mount options that cause all files to be automatically compressed, similar > to how f2fs/encrypt automatically encrypts all files with test_dummy_encryption. I used for fsstress+fault_injection+shutdown loop with compressed and non-compressed directories with: # mkfs.f2fs -f -O extra_attr -O project_quota -O compression -g android /dev/$DEV # mount -t f2fs -o discard,fsync_mode=nobarrier,reserve_root=32768,checkpoint_merge,atgc,compress_cache /dev/$DEV $TESTDIR # mkdir $TESTDIR/comp # f2fs_io setflags compression $TESTDIR/comp # fsstress [options] -d $TESTDIR/comp I think you can simply mount with "-o compress_extension=*" to compress everything. > > - Eric