* [PATCH] btrfs: Fix a memory allocation failure test
@ 2022-10-30 7:35 Christophe JAILLET
2022-10-30 18:32 ` Nikolay Borisov
2022-10-31 14:07 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2022-10-30 7:35 UTC (permalink / raw)
To: Chris Mason, Josef Bacik, David Sterba, Nikolay Borisov
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-btrfs
'dip' is tested instead of 'dip->csums'.
Fix it.
Fixes: 642c5d34da53 ("btrfs: allocate the btrfs_dio_private as part of the iomap dio bio")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
fs/btrfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 966cc050cdbb..3bbd2dc6282f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8078,7 +8078,7 @@ static void btrfs_submit_direct(const struct iomap_iter *iter,
*/
status = BLK_STS_RESOURCE;
dip->csums = kcalloc(nr_sectors, fs_info->csum_size, GFP_NOFS);
- if (!dip)
+ if (!dip->csums)
goto out_err;
status = btrfs_lookup_bio_sums(inode, dio_bio, dip->csums);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: Fix a memory allocation failure test
2022-10-30 7:35 [PATCH] btrfs: Fix a memory allocation failure test Christophe JAILLET
@ 2022-10-30 18:32 ` Nikolay Borisov
2022-10-31 14:07 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Borisov @ 2022-10-30 18:32 UTC (permalink / raw)
To: Christophe JAILLET, Chris Mason, Josef Bacik, David Sterba
Cc: linux-kernel, kernel-janitors, linux-btrfs
On 30.10.22 г. 9:35 ч., Christophe JAILLET wrote:
> 'dip' is tested instead of 'dip->csums'.
> Fix it.
>
> Fixes: 642c5d34da53 ("btrfs: allocate the btrfs_dio_private as part of the iomap dio bio")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
> ---
> fs/btrfs/inode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 966cc050cdbb..3bbd2dc6282f 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -8078,7 +8078,7 @@ static void btrfs_submit_direct(const struct iomap_iter *iter,
> */
> status = BLK_STS_RESOURCE;
> dip->csums = kcalloc(nr_sectors, fs_info->csum_size, GFP_NOFS);
> - if (!dip)
> + if (!dip->csums)
> goto out_err;
>
> status = btrfs_lookup_bio_sums(inode, dio_bio, dip->csums);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: Fix a memory allocation failure test
2022-10-30 7:35 [PATCH] btrfs: Fix a memory allocation failure test Christophe JAILLET
2022-10-30 18:32 ` Nikolay Borisov
@ 2022-10-31 14:07 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2022-10-31 14:07 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Chris Mason, Josef Bacik, David Sterba, Nikolay Borisov,
linux-kernel, kernel-janitors, linux-btrfs
On Sun, Oct 30, 2022 at 08:35:28AM +0100, Christophe JAILLET wrote:
> 'dip' is tested instead of 'dip->csums'.
> Fix it.
>
> Fixes: 642c5d34da53 ("btrfs: allocate the btrfs_dio_private as part of the iomap dio bio")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Added to misc-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-31 14:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-30 7:35 [PATCH] btrfs: Fix a memory allocation failure test Christophe JAILLET
2022-10-30 18:32 ` Nikolay Borisov
2022-10-31 14:07 ` David Sterba
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.