diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index cb9ce90d1deb..72e55db948d2 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1307,7 +1307,7 @@ xfs_fs_fill_super( | |||
1307 | void *data, | 1307 | void *data, |
1308 | int silent) | 1308 | int silent) |
1309 | { | 1309 | { |
1310 | struct inode *rootvp; | 1310 | struct inode *root; |
1311 | struct xfs_mount *mp = NULL; | 1311 | struct xfs_mount *mp = NULL; |
1312 | struct xfs_mount_args *args = xfs_args_allocate(sb, silent); | 1312 | struct xfs_mount_args *args = xfs_args_allocate(sb, silent); |
1313 | int error; | 1313 | int error; |
@@ -1345,19 +1345,18 @@ xfs_fs_fill_super( | |||
1345 | sb->s_time_gran = 1; | 1345 | sb->s_time_gran = 1; |
1346 | set_posix_acl_flag(sb); | 1346 | set_posix_acl_flag(sb); |
1347 | 1347 | ||
1348 | rootvp = igrab(mp->m_rootip->i_vnode); | 1348 | root = igrab(mp->m_rootip->i_vnode); |
1349 | if (!rootvp) { | 1349 | if (!root) { |
1350 | error = ENOENT; | 1350 | error = ENOENT; |
1351 | goto fail_unmount; | 1351 | goto fail_unmount; |
1352 | } | 1352 | } |
1353 | 1353 | if (is_bad_inode(root)) { | |
1354 | sb->s_root = d_alloc_root(vn_to_inode(rootvp)); | 1354 | error = EINVAL; |
1355 | if (!sb->s_root) { | ||
1356 | error = ENOMEM; | ||
1357 | goto fail_vnrele; | 1355 | goto fail_vnrele; |
1358 | } | 1356 | } |
1359 | if (is_bad_inode(sb->s_root->d_inode)) { | 1357 | sb->s_root = d_alloc_root(root); |
1360 | error = EINVAL; | 1358 | if (!sb->s_root) { |
1359 | error = ENOMEM; | ||
1361 | goto fail_vnrele; | 1360 | goto fail_vnrele; |
1362 | } | 1361 | } |
1363 | 1362 | ||
@@ -1379,7 +1378,7 @@ fail_vnrele: | |||
1379 | dput(sb->s_root); | 1378 | dput(sb->s_root); |
1380 | sb->s_root = NULL; | 1379 | sb->s_root = NULL; |
1381 | } else { | 1380 | } else { |
1382 | VN_RELE(rootvp); | 1381 | iput(root); |
1383 | } | 1382 | } |
1384 | 1383 | ||
1385 | fail_unmount: | 1384 | fail_unmount: |