public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: reject encoded write if inode has nodatasum flag set
Date: Mon, 5 Feb 2024 16:37:35 +0100	[thread overview]
Message-ID: <20240205153735.GG355@twin.jikos.cz> (raw)
In-Reply-To: <5e9fccf6a2c57b6bbd28427ca864fe838b43d394.1706876439.git.fdmanana@suse.com>

On Fri, Feb 02, 2024 at 12:22:53PM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> Currently we allow an encoded write against inodes that have the NODATASUM
> flag set, either because they are NOCOW files or they were created while
> the filesystem was mounted with "-o nodatasum". This results in having
> compressed extents without corresponding checksums, which is a filesystem
> inconsistency reported by 'btrfs check'.
> 
> For example, running btrfs/281 with MOUNT_OPTIONS="-o nodatacow" triggers
> this and 'btrfs check' errors out with:
> 
>    [1/7] checking root items
>    [2/7] checking extents
>    [3/7] checking free space tree
>    [4/7] checking fs roots
>    root 256 inode 257 errors 1040, bad file extent, some csum missing
>    root 256 inode 258 errors 1040, bad file extent, some csum missing
>    ERROR: errors found in fs roots
>    (...)
> 
> So reject encoded writes if the target inode has NODATASUM set.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>

      parent reply	other threads:[~2024-02-05 15:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 12:22 [PATCH] btrfs: reject encoded write if inode has nodatasum flag set fdmanana
2024-02-02 12:38 ` Johannes Thumshirn
2024-02-05 15:37 ` David Sterba [this message]

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=20240205153735.GG355@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox