All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-btrfs@vger.kernel.org
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [RFC PATCH 13/31] btrfs: do not checksum for free space inode
Date: Sun, 13 Jun 2021 08:39:41 -0500	[thread overview]
Message-ID: <acd977c106057ee19f4c965b718460605add1cc0.1623567940.git.rgoldwyn@suse.com> (raw)
In-Reply-To: <cover.1623567940.git.rgoldwyn@suse.com>

From: Goldwyn Rodrigues <rgoldwyn@suse.com>

Free space inode writes should not be checksummed.

Q: Now sure why this is required now (as opposed to earlier), but it
would fail on writing free_space_inode. How is this avoided in the
existing code?

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
 fs/btrfs/disk-io.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index d1d5091a8385..3af505ec22dc 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -946,9 +946,12 @@ blk_status_t btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio,
 			goto out_w_error;
 		ret = btrfs_map_bio(fs_info, bio, mirror_num);
 	} else if (!should_async_write(fs_info, BTRFS_I(inode))) {
-		ret = btree_csum_one_bio(bio);
-		if (ret)
-			goto out_w_error;
+		/* Do not checksum free space inode */
+		if (!btrfs_is_free_space_inode(BTRFS_I(inode))) {
+			ret = btree_csum_one_bio(bio);
+			if (ret)
+				goto out_w_error;
+		}
 		ret = btrfs_map_bio(fs_info, bio, mirror_num);
 	} else {
 		/*
-- 
2.31.1


  parent reply	other threads:[~2021-06-13 13:40 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 13:39 [RFC PATCH 00/31] btrfs buffered iomap support Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 01/31] iomap: Check if blocksize == PAGE_SIZE in to_iomap_page() Goldwyn Rodrigues
2021-06-15 14:17   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 02/31] iomap: Add submit_io to writepage_ops Goldwyn Rodrigues
2021-06-15 14:15   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 03/31] iomap: Export iomap_writepage_end_bio() Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 04/31] iomap: Introduce iomap_readpage_ops Goldwyn Rodrigues
2021-06-15 14:44   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 05/31] btrfs: writepage() lock extent before pages Goldwyn Rodrigues
2021-06-15 15:47   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 06/31] btrfs: lock extents while truncating Goldwyn Rodrigues
2021-06-16  6:42   ` Nikolay Borisov
2021-06-16 13:13   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 07/31] btrfs: write() perform extent locks before locking page Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 08/31] btrfs: btrfs_em_to_iomap () to convert em to iomap Goldwyn Rodrigues
2021-06-16  6:49   ` Nikolay Borisov
2021-06-16  6:51   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 09/31] btrfs: Don't process pages if locked_page is NULL Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 10/31] btrfs: Add btrfs_map_blocks to for iomap_writeback_ops Goldwyn Rodrigues
2021-06-16 14:15   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 11/31] btrfs: Use submit_io to submit btrfs writeback bios Goldwyn Rodrigues
2021-06-16 14:26   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 12/31] btrfs: endio sequence for writepage Goldwyn Rodrigues
2021-06-13 13:39 ` Goldwyn Rodrigues [this message]
2021-06-16 14:46   ` [RFC PATCH 13/31] btrfs: do not checksum for free space inode Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 14/31] btrfs: end EXTENT_MAP_INLINE writeback early Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 15/31] btrfs: Switch to iomap_writepages() Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 16/31] btrfs: remove force_page_uptodate Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 17/31] btrfs: Introduce btrfs_iomap Goldwyn Rodrigues
2021-06-16 20:02   ` David Sterba
2021-06-13 13:39 ` [RFC PATCH 18/31] btrfs: Add btrfs_iomap_release() Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 19/31] btrfs: Add reservation information to btrfs_iomap Goldwyn Rodrigues
2021-06-16 20:03   ` David Sterba
2021-06-13 13:39 ` [RFC PATCH 20/31] btrfs: Carve out btrfs_buffered_iomap_begin() from write path Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 21/31] btrfs: Carve out btrfs_buffered_iomap_end from the " Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 22/31] btrfs: Set extents delalloc in iomap_end Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 23/31] btrfs: define iomap_page_ops Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 24/31] btrfs: Switch to iomap_file_buffered_write() Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 25/31] btrfs: remove all page related functions Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 26/31] btrfs: use srcmap for read-before-write cases Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 27/31] btrfs: Rename end_bio_extent_readpage to btrfs_readpage_endio Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 28/31] btrfs: iomap_begin() for buffered read Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 29/31] btrfs: Use iomap_readpage_ops to allocate and submit bio Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 30/31] btrfs: Do not call btrfs_io_bio_free_csum() if BTRFS_INODE_NODATASUM is not set Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 31/31] btrfs: Switch to iomap_readpage() and iomap_readahead() Goldwyn Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acd977c106057ee19f4c965b718460605add1cc0.1623567940.git.rgoldwyn@suse.com \
    --to=rgoldwyn@suse.de \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rgoldwyn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.