From: Dan Carpenter <error27@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Yan Zheng <zheng.yan@oracle.com>, Josef Bacik <josef@redhat.com>,
Jens Axboe <jens.axboe@oracle.com>,
Christoph Hellwig <hch@lst.de>,
kernel-janitors@vger.kernel.org,
Chris Mason <chris.mason@oracle.com>
Subject: [patch 4/11] btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
Date: Sat, 29 May 2010 09:44:10 +0000 [thread overview]
Message-ID: <20100529094410.GE5483@bicker> (raw)
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);
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Yan Zheng <zheng.yan@oracle.com>, Josef Bacik <josef@redhat.com>,
Jens Axboe <jens.axboe@oracle.com>,
Christoph Hellwig <hch@lst.de>,
kernel-janitors@vger.kernel.org,
Chris Mason <chris.mason@oracle.com>
Subject: [patch 4/11] btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
Date: Sat, 29 May 2010 11:44:10 +0200 [thread overview]
Message-ID: <20100529094410.GE5483@bicker> (raw)
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);
next reply other threads:[~2010-05-29 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-29 9:44 Dan Carpenter [this message]
2010-05-29 9:44 ` [patch 4/11] btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs Dan Carpenter
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=20100529094410.GE5483@bicker \
--to=error27@gmail.com \
--cc=chris.mason@oracle.com \
--cc=hch@lst.de \
--cc=jens.axboe@oracle.com \
--cc=josef@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=zheng.yan@oracle.com \
/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 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.