linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 1/4] btrfs: prepare more slots for checksum shash
Date: Thu, 4 Aug 2022 18:55:34 +0800	[thread overview]
Message-ID: <fbc8a68b-11ec-2b3e-305a-e3db12271008@oracle.com> (raw)
In-Reply-To: <42f231d8d6f95fdc731b423fdc7c3ae2a6685318.1659443199.git.dsterba@suse.com>


> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 6ac8d73d4b51..3c2251199f0c 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -65,8 +65,9 @@ static void btrfs_error_commit_super(struct btrfs_fs_info *fs_info);
>   
>   static void btrfs_free_csum_hash(struct btrfs_fs_info *fs_info)
>   {
> -	if (fs_info->csum_shash)
> -		crypto_free_shash(fs_info->csum_shash);
> +	for (int i = 0; i < CSUM_COUNT; i++)
> +		if (fs_info->csum_shash[i])
> +			crypto_free_shash(fs_info->csum_shash[i]);
>   }
>   

Right, for-loop has to start from 1, and

> @@ -2429,7 +2430,7 @@ static int btrfs_init_csum_hash(struct btrfs_fs_info *fs_info, u16 csum_type)
>   		return PTR_ERR(csum_shash);
>   	}
>   
> -	fs_info->csum_shash = csum_shash;
> +	fs_info->csum_shash[CSUM_DEFAULT] = csum_shash;
>   
>   	btrfs_info(fs_info, "using %s (%s) checksum algorithm",
>   			btrfs_super_csum_name(csum_type),

Merge patch 2/4 with 1/4. So csum_shash is in its respective slot.

  parent reply	other threads:[~2022-08-04 10:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 12:28 [PATCH v2 0/4] Selectable checksum implementation David Sterba
2022-08-02 12:28 ` [PATCH v2 1/4] btrfs: prepare more slots for checksum shash David Sterba
2022-08-02 13:00   ` Johannes Thumshirn
2022-08-03 13:34   ` David Sterba
2022-08-04 10:55   ` Anand Jain [this message]
2022-08-02 12:28 ` [PATCH v2 2/4] btrfs: assign checksum shash slots on init David Sterba
2022-08-02 20:30   ` kernel test robot
2022-08-02 21:10   ` kernel test robot
2022-08-02 12:28 ` [PATCH v2 3/4] btrfs: add checksum implementation selection after mount David Sterba
2022-08-02 13:00   ` Johannes Thumshirn
2022-08-02 13:21     ` David Sterba
2022-08-03  0:06   ` Anand Jain
2022-08-03 14:00     ` David Sterba
2022-08-04 11:12       ` Anand Jain
2022-08-03  0:22   ` Anand Jain
2022-08-03 13:24     ` David Sterba
2022-08-02 12:28 ` [PATCH v2 4/4] btrfs: sysfs: print all loaded csums implementations David Sterba
2022-08-02 13:16   ` Johannes Thumshirn
  -- strict thread matches above, loose matches on Subject: below --
2022-07-29 17:42 [PATCH v2 0/4] Selectable checksum implementation David Sterba
2022-07-29 17:42 ` [PATCH v2 1/4] btrfs: prepare more slots for checksum shash David Sterba

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=fbc8a68b-11ec-2b3e-305a-e3db12271008@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --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;
as well as URLs for NNTP newsgroup(s).