Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp405588rwb; Mon, 28 Nov 2022 23:30:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf5IKYKahX6k76v1b89gSqObvI8KDoXYIfJGXCpxVLn+nRozGGrcu7L8EjY2DyRJyL/S7fxK X-Received: by 2002:a17:906:4309:b0:78d:36d7:92ae with SMTP id j9-20020a170906430900b0078d36d792aemr30732114ejm.113.1669707020258; Mon, 28 Nov 2022 23:30:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669707020; cv=none; d=google.com; s=arc-20160816; b=INgHrTHeuKDBbQHfCJnO4wN7LUd+Rx0b/uXhjyrVrCVs80P6Tr5PMe2GmU07jYZujo jDc4yzfT9Fd57bD64sZQhsIwbHYYjpyL0UZQEpYohTlgBlwbkmuZ6V9831jnuaJ3I78x CXdh/M5ctF3dnB+accQBd1nULtaLS1qFczQ9/0a1ryKpQiZ+6pu92pRlVWov34KZ1lpK h1bnNAEVMlt+ogsK2+nQOinxg4HVmz0pkqCf1PPKrWsFaxM5ENQxy3EmndF22Xln/FRp EV5GLZBFDI7VMhTuDUm+CYlqRdnAeqy14kUebKMUC5ksw3KtdmzazcNRwzcjMx//s20u vJUw== 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=uopDUAu/Fex85YsnbeGt15fUp2+Zc2WrIHFQ9Sp/QTk=; b=TnIKEMykxMQkEZNq93JFc/Ky0ylvzqjr4Xwp7uN3AHx2g+/bj6TjIEPs77cqItOKqu +JnIU5jTzJOc9PZKLOjcESAdmpMHsthYj+QXtUDYG1+L7Dj6V8A2xEm9nYpPFvCMRlsu 1O4zKKIZ0xx49e4qi+Q5xb5+eC82qkqYrKiXEnuMYp7oBWOXcBg2v+Xc4kqbpyJbZuaP Gcge+z7OQZElESzuKc0QcGUrnRHQMLLAUJICNOcsysZeXNI1pJkXSuhPpcrueUxv0GIz SIFwERYd3NZowwKDGErsP2fMtq3QzOQWkvlnrxUKVzYpCJ/DBXlWCjYWLsbUj4m6Y17g Qyag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r3nhquNG; 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 bt7-20020a0564020a4700b00461a32e0e38si10373560edb.306.2022.11.28.23.29.49; Mon, 28 Nov 2022 23:30:20 -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=r3nhquNG; 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 S229670AbiK2HOb (ORCPT + 99 others); Tue, 29 Nov 2022 02:14:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbiK2HOa (ORCPT ); Tue, 29 Nov 2022 02:14:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B840B2657F; Mon, 28 Nov 2022 23:14:29 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6A1D6B81168; Tue, 29 Nov 2022 07:14:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5A2DC433C1; Tue, 29 Nov 2022 07:14:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669706067; bh=us0xxwnUQweVKC2bsLBc59jamq4rwG2vuwf65B53Rfk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r3nhquNGwkJp4h1DWM5InakWl/6nwkm3jRfMDQ4lUMMThLJt5JHODtnj5i9KOeCjD rJ+AnZT6nsQftI8YgD9rRkyM2aLU5Xgbpwjwt15+gCXYo7kBS3B0wcVEa9PnpQIHFk 5wyisa7hgbnwQtoYl5BhpUUwq3pOo4k/iiZOabj6x0K4LbEMpsuydNgnKblZ9FR5B3 RocI8vGci7EUzd9I5go+yXZgt0qfnd23ZHKVtLTeYqkFbZ2sBMav/0Z4s8nFn2bSY3 YiPXhOeHCpttvtenaGLh9U6ffjWm+vcBat7foTSoE0at5HWRe6g1ZwZnvditRm75QT WVe4ZGFsIFJyA== Date: Mon, 28 Nov 2022 23:14:25 -0800 From: Eric Biggers To: Jaegeuk Kim 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 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. - Eric