Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118461
b: refs/heads/master
c: 45cfbe3
h: refs/heads/master
i:
  118459: a311f9b
v: v3
  • Loading branch information
OGAWA Hirofumi authored and Linus Torvalds committed Nov 6, 2008
1 parent 74d0e86 commit 4fba865
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 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: 1c13a243a461dd5b089d29e5d57f260c990e462c
refs/heads/master: 45cfbe354785a5bc9a38354754d6f7322f598001
38 changes: 21 additions & 17 deletions trunk/fs/fat/namei_msdos.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,33 +203,37 @@ static struct dentry *msdos_lookup(struct inode *dir, struct dentry *dentry,
{
struct super_block *sb = dir->i_sb;
struct fat_slot_info sinfo;
struct inode *inode = NULL;
int res;

dentry->d_op = &msdos_dentry_operations;
struct inode *inode;
int err;

lock_super(sb);
res = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &sinfo);
if (res == -ENOENT)
goto add;
if (res < 0)
goto out;

err = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &sinfo);
if (err) {
if (err == -ENOENT) {
inode = NULL;
goto out;
}
goto error;
}

inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos);
brelse(sinfo.bh);
if (IS_ERR(inode)) {
res = PTR_ERR(inode);
goto out;
err = PTR_ERR(inode);
goto error;
}
add:
res = 0;
out:
unlock_super(sb);
dentry->d_op = &msdos_dentry_operations;
dentry = d_splice_alias(inode, dentry);
if (dentry)
dentry->d_op = &msdos_dentry_operations;
out:
return dentry;

error:
unlock_super(sb);
if (!res)
return dentry;
return ERR_PTR(res);
return ERR_PTR(err);
}

/***** Creates a directory entry (name is already formatted). */
Expand Down

0 comments on commit 4fba865

Please sign in to comment.