* [patch 4/11] btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
@ 2010-05-29 9:44 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-05-29 9:44 UTC (permalink / raw)
To: linux-btrfs
Cc: Yan Zheng, Josef Bacik, Jens Axboe, Christoph Hellwig,
kernel-janitors, Chris Mason
btrfs_read_fs_root_no_name() returns ERR_PTRs on error so I added a
check for that. It's not clear to me if it can also return NULL
pointers or not so I left the original NULL pointer check as is.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 73895ba..34f7c37 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1985,6 +1985,10 @@ struct btrfs_root *open_ctree(struct super_block *sb,
fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location);
if (!fs_info->fs_root)
goto fail_trans_kthread;
+ if (IS_ERR(fs_info->fs_root)) {
+ err = PTR_ERR(fs_info->fs_root);
+ goto fail_trans_kthread;
+ }
if (!(sb->s_flags & MS_RDONLY)) {
down_read(&fs_info->cleanup_work_sem);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-29 9:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29 9:44 [patch 4/11] btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs Dan Carpenter
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).