* [PATCH] Btrfs: add missing brelse when superblock checksum fails
@ 2015-10-05 8:55 Anand Jain
2015-10-07 8:54 ` David Sterba
2015-10-07 9:23 ` [PATCH V2] " Anand Jain
0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2015-10-05 8:55 UTC (permalink / raw)
To: linux-btrfs
looks like oversight, call brelse() when checksum fails.
further down the code in the non error path we do call
brelse() and so we don't see brelse() in the goto error..
paths.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
fs/btrfs/disk-io.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 7191b32..99d0804 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2665,6 +2665,7 @@ int open_ctree(struct super_block *sb,
if (btrfs_check_super_csum(bh->b_data)) {
printk(KERN_ERR "BTRFS: superblock checksum mismatch\n");
err = -EINVAL;
+ brelse(bh);
goto fail_alloc;
}
--
2.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Btrfs: add missing brelse when superblock checksum fails
2015-10-05 8:55 [PATCH] Btrfs: add missing brelse when superblock checksum fails Anand Jain
@ 2015-10-07 8:54 ` David Sterba
2015-10-07 9:23 ` [PATCH V2] " Anand Jain
1 sibling, 0 replies; 4+ messages in thread
From: David Sterba @ 2015-10-07 8:54 UTC (permalink / raw)
To: Anand Jain; +Cc: linux-btrfs
On Mon, Oct 05, 2015 at 04:55:20PM +0800, Anand Jain wrote:
> looks like oversight, call brelse() when checksum fails.
> further down the code in the non error path we do call
> brelse() and so we don't see brelse() in the goto error..
> paths.
Good catch. Please reformat the changelog to use the full 74 char line
and start sentences with capital letters.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH V2] Btrfs: add missing brelse when superblock checksum fails
2015-10-05 8:55 [PATCH] Btrfs: add missing brelse when superblock checksum fails Anand Jain
2015-10-07 8:54 ` David Sterba
@ 2015-10-07 9:23 ` Anand Jain
2015-10-07 9:37 ` David Sterba
1 sibling, 1 reply; 4+ messages in thread
From: Anand Jain @ 2015-10-07 9:23 UTC (permalink / raw)
To: linux-btrfs; +Cc: dsterba, Anand Jain
Looks like oversight, call brelse() when checksum fails. Further down the
code, in the non error path, we do call brelse() and so we don't see
brelse() in the goto error paths.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
V2: Updated changelog
fs/btrfs/disk-io.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index c7c739f..1b72cb5 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2665,6 +2665,7 @@ int open_ctree(struct super_block *sb,
if (btrfs_check_super_csum(bh->b_data)) {
printk(KERN_ERR "BTRFS: superblock checksum mismatch\n");
err = -EINVAL;
+ brelse(bh);
goto fail_alloc;
}
--
2.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH V2] Btrfs: add missing brelse when superblock checksum fails
2015-10-07 9:23 ` [PATCH V2] " Anand Jain
@ 2015-10-07 9:37 ` David Sterba
0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2015-10-07 9:37 UTC (permalink / raw)
To: Anand Jain; +Cc: linux-btrfs, dsterba
On Wed, Oct 07, 2015 at 05:23:23PM +0800, Anand Jain wrote:
> Looks like oversight, call brelse() when checksum fails. Further down the
> code, in the non error path, we do call brelse() and so we don't see
> brelse() in the goto error paths.
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
Thanks!
Reviewed-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-07 9:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 8:55 [PATCH] Btrfs: add missing brelse when superblock checksum fails Anand Jain
2015-10-07 8:54 ` David Sterba
2015-10-07 9:23 ` [PATCH V2] " Anand Jain
2015-10-07 9:37 ` David Sterba
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).