Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] Fix CIFS readdir access denied when SE Linux enabled
  • Loading branch information
Linus Torvalds committed Sep 13, 2006
2 parents 7366935 + b835beb commit 48c068e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ static int construct_dentry(struct qstr *qstring, struct file *file,
if(*ptmp_inode == NULL)
return rc;
rc = 1;
d_instantiate(tmp_dentry, *ptmp_inode);
}
} else {
tmp_dentry = d_alloc(file->f_dentry, qstring);
Expand All @@ -99,9 +98,7 @@ static int construct_dentry(struct qstr *qstring, struct file *file,
tmp_dentry->d_op = &cifs_dentry_ops;
if(*ptmp_inode == NULL)
return rc;
rc = 1;
d_instantiate(tmp_dentry, *ptmp_inode);
d_rehash(tmp_dentry);
rc = 2;
}

tmp_dentry->d_time = jiffies;
Expand Down Expand Up @@ -870,6 +867,12 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
pfindEntry, &obj_type, rc);
else
fill_in_inode(tmp_inode, 1 /* NT */, pfindEntry, &obj_type, rc);

if(rc) /* new inode - needs to be tied to dentry */ {
d_instantiate(tmp_dentry, tmp_inode);
if(rc == 2)
d_rehash(tmp_dentry);
}


rc = filldir(direntry,qstring.name,qstring.len,file->f_pos,
Expand Down

0 comments on commit 48c068e

Please sign in to comment.