From patchwork Tue Apr 4 14:53:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Albershteyn X-Patchwork-Id: 13200355 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2039BBA3E for ; Tue, 4 Apr 2023 14:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680620121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1DCV/M5yyrM1g1B6cxt9ZQ7HQFDQ1socxlG7tzRHhCM=; b=Dl94SvH+xgPNHy1SqfMAkVg+EpESivg8HdD4ytzjwhxHR9GAknJE6wUEbk+QW9Xm2VDDR2 PUaTPElPgscSfpM4ENFnLybnJ49/fUh04ZPKTLY2yAD7/njsPd6266OIxFPiDQcs8a12qk yygzOhsCepKN/F80yrtGH7T98PWRfrs= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-318-o5EXQ03cO1mdDSArvJ1pwg-1; Tue, 04 Apr 2023 10:55:19 -0400 X-MC-Unique: o5EXQ03cO1mdDSArvJ1pwg-1 Received: by mail-qv1-f71.google.com with SMTP id dl18-20020ad44e12000000b005a4d5420bc6so14702967qvb.11 for ; Tue, 04 Apr 2023 07:55:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680620115; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1DCV/M5yyrM1g1B6cxt9ZQ7HQFDQ1socxlG7tzRHhCM=; b=Ogg7FVyqEDu4CaE1A9dQoqXSd4HbMOoBNZ6nwFjYZ+co9WgyOmifmE9FPDa5p8NRWc NmtzQtmdg7psiF0DzSNXwfp6lb2W7/HbBEs5477viPaUtVhWrKQ+NmuNSdHblqdNIvPx iqicf0YuUSMTsLO2TnrIc1Nfer48Oaw3loJPMPrvAQ5978Y/iGmPYElAR6syZgt3f6Xp iOH7qL3FyVtDoDFzqcaAvDkqcJ5jWjjbs3vQvDwBerJoNBYH/GtoC7+rCfHuuUCmA6pk z1WoqkC+Nj8W90tni7Re25GakObfKIzTRSOwzHL0cFltv9b9w0fNhvm8q3O7SzO8Sg9s WI2Q== X-Gm-Message-State: AAQBX9f2rJ1LE+KshWKAWUiT2MoayXJfYmOsRpP7BhdTvGv0wTlMKUaR CyVl1hU2KhFMa0VuQUChoDixzyQDoV0ZaS1cBIY6thABhRUVxgdJ6C8n4Ery/e5XiysWek6YFoq yHCEhnbg83VuKIeZpAA== X-Received: by 2002:a05:622a:1002:b0:3e3:8ebe:ce17 with SMTP id d2-20020a05622a100200b003e38ebece17mr3401479qte.43.1680620115383; Tue, 04 Apr 2023 07:55:15 -0700 (PDT) X-Google-Smtp-Source: AKy350ZeTsqSdwXkQooxtkxa5UspUTLXqFsUhIKZ9BZk1HmO99VPevTQAHz0NwCmfjyQvtO6XB3OTQ== X-Received: by 2002:a05:622a:1002:b0:3e3:8ebe:ce17 with SMTP id d2-20020a05622a100200b003e38ebece17mr3401445qte.43.1680620115062; Tue, 04 Apr 2023 07:55:15 -0700 (PDT) Received: from aalbersh.remote.csb ([109.183.6.197]) by smtp.gmail.com with ESMTPSA id j4-20020ac86644000000b003e6387431dcsm3296539qtp.7.2023.04.04.07.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 07:55:14 -0700 (PDT) From: Andrey Albershteyn To: djwong@kernel.org, dchinner@redhat.com, ebiggers@kernel.org, hch@infradead.org, linux-xfs@vger.kernel.org, fsverity@lists.linux.dev Cc: rpeterso@redhat.com, agruenba@redhat.com, xiang@kernel.org, chao@kernel.org, damien.lemoal@opensource.wdc.com, jth@kernel.org, linux-erofs@lists.ozlabs.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, Andrey Albershteyn Subject: [PATCH v2 10/23] xfs: add XBF_VERITY_CHECKED xfs_buf flag Date: Tue, 4 Apr 2023 16:53:06 +0200 Message-Id: <20230404145319.2057051-11-aalbersh@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230404145319.2057051-1-aalbersh@redhat.com> References: <20230404145319.2057051-1-aalbersh@redhat.com> Precedence: bulk X-Mailing-List: fsverity@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com The meaning of the flag is that value of the extended attribute in the buffer was verified. The underlying pages have PageChecked() == false (the way fs-verity identifies verified pages), as page content will be copied out to newly allocated pages in further patches. The flag is being used later to SetPageChecked() on pages handed to the fs-verity. Signed-off-by: Andrey Albershteyn --- fs/xfs/xfs_buf.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 549c60942208..8cc86fed962b 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -24,14 +24,15 @@ struct xfs_buf; #define XFS_BUF_DADDR_NULL ((xfs_daddr_t) (-1LL)) -#define XBF_READ (1u << 0) /* buffer intended for reading from device */ -#define XBF_WRITE (1u << 1) /* buffer intended for writing to device */ -#define XBF_READ_AHEAD (1u << 2) /* asynchronous read-ahead */ -#define XBF_NO_IOACCT (1u << 3) /* bypass I/O accounting (non-LRU bufs) */ -#define XBF_ASYNC (1u << 4) /* initiator will not wait for completion */ -#define XBF_DONE (1u << 5) /* all pages in the buffer uptodate */ -#define XBF_STALE (1u << 6) /* buffer has been staled, do not find it */ -#define XBF_WRITE_FAIL (1u << 7) /* async writes have failed on this buffer */ +#define XBF_READ (1u << 0) /* buffer intended for reading from device */ +#define XBF_WRITE (1u << 1) /* buffer intended for writing to device */ +#define XBF_READ_AHEAD (1u << 2) /* asynchronous read-ahead */ +#define XBF_NO_IOACCT (1u << 3) /* bypass I/O accounting (non-LRU bufs) */ +#define XBF_ASYNC (1u << 4) /* initiator will not wait for completion */ +#define XBF_DONE (1u << 5) /* all pages in the buffer uptodate */ +#define XBF_STALE (1u << 6) /* buffer has been staled, do not find it */ +#define XBF_WRITE_FAIL (1u << 7) /* async writes have failed on this buffer */ +#define XBF_VERITY_CHECKED (1u << 8) /* buffer was verified by fs-verity*/ /* buffer type flags for write callbacks */ #define _XBF_INODES (1u << 16)/* inode buffer */