diff options
| author | Dan Carpenter <error27@gmail.com> | 2010-05-29 05:44:10 -0400 |
|---|---|---|
| committer | Chris Mason <chris.mason@oracle.com> | 2010-06-11 15:57:36 -0400 |
| commit | 3140c9a34b44cd4013baae8704fdb34a93a44475 (patch) | |
| tree | 824a5ecb5d6d1c50769d96cd48b8394c009334d5 | |
| parent | d327099a23e3d0c8ec09137e9b4b115449d4eb29 (diff) | |
Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
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>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
| -rw-r--r-- | fs/btrfs/disk-io.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 73895baf6e07..34f7c375567e 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, | |||
| 1985 | fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location); | 1985 | fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location); |
| 1986 | if (!fs_info->fs_root) | 1986 | if (!fs_info->fs_root) |
| 1987 | goto fail_trans_kthread; | 1987 | goto fail_trans_kthread; |
| 1988 | if (IS_ERR(fs_info->fs_root)) { | ||
| 1989 | err = PTR_ERR(fs_info->fs_root); | ||
| 1990 | goto fail_trans_kthread; | ||
| 1991 | } | ||
| 1988 | 1992 | ||
| 1989 | if (!(sb->s_flags & MS_RDONLY)) { | 1993 | if (!(sb->s_flags & MS_RDONLY)) { |
| 1990 | down_read(&fs_info->cleanup_work_sem); | 1994 | down_read(&fs_info->cleanup_work_sem); |
