* [PATCH] Btrfs: check inode allocaton earlier in btrfs_fill_super
@ 2009-01-07 6:56 Shen Feng
0 siblings, 0 replies; only message in thread
From: Shen Feng @ 2009-01-07 6:56 UTC (permalink / raw)
To: linux-btrfs
Just after it's allocation.
Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
---
fs/btrfs/super.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index b4c101d..4c31c4f 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -322,6 +322,11 @@ static int btrfs_fill_super(struct super_block *sb,
disk_super = &tree_root->fs_info->super_copy;
inode = btrfs_iget_locked(sb, BTRFS_FIRST_FREE_OBJECTID,
tree_root->fs_info->fs_root);
+ if (!inode) {
+ err = -ENOMEM;
+ goto fail_close;
+ }
+
bi = BTRFS_I(inode);
bi->location.objectid = inode->i_ino;
bi->location.offset = 0;
@@ -329,10 +334,6 @@ static int btrfs_fill_super(struct super_block *sb,
btrfs_set_key_type(&bi->location, BTRFS_INODE_ITEM_KEY);
- if (!inode) {
- err = -ENOMEM;
- goto fail_close;
- }
if (inode->i_state & I_NEW) {
btrfs_read_locked_inode(inode);
unlock_new_inode(inode);
--
1.6.0.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-07 6:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 6:56 [PATCH] Btrfs: check inode allocaton earlier in btrfs_fill_super Shen Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox