Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262226
b: refs/heads/master
c: 1748f84
h: refs/heads/master
v: v3
  • Loading branch information
Mark Fasheh committed Jul 14, 2011
1 parent 9a3ce8b commit 7da50d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0eb0e19cde6f01397ef8c0e094e44beb75c62a1e
refs/heads/master: 1748f843a0190ef4332d03a64263f383af72682b
22 changes: 17 additions & 5 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2518,7 +2518,9 @@ static void btrfs_read_locked_inode(struct inode *inode)
filled = true;

path = btrfs_alloc_path();
BUG_ON(!path);
if (!path)
goto make_bad;

path->leave_spinning = 1;
memcpy(&location, &BTRFS_I(inode)->location, sizeof(location));

Expand Down Expand Up @@ -3973,6 +3975,7 @@ struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location,
struct btrfs_root *root, int *new)
{
struct inode *inode;
int bad_inode = 0;

inode = btrfs_iget_locked(s, location->objectid, root);
if (!inode)
Expand All @@ -3982,10 +3985,19 @@ struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location,
BTRFS_I(inode)->root = root;
memcpy(&BTRFS_I(inode)->location, location, sizeof(*location));
btrfs_read_locked_inode(inode);
inode_tree_add(inode);
unlock_new_inode(inode);
if (new)
*new = 1;
if (!is_bad_inode(inode)) {
inode_tree_add(inode);
unlock_new_inode(inode);
if (new)
*new = 1;
} else {
bad_inode = 1;
}
}

if (bad_inode) {
iput(inode);
inode = ERR_PTR(-ESTALE);
}

return inode;
Expand Down

0 comments on commit 7da50d0

Please sign in to comment.