Skip to content

Commit

Permalink
cifs: don't allow cifs_iget to match inodes of the wrong type
Browse files Browse the repository at this point in the history
If the type is different from what we think it should be, then don't
match the existing inode.

Signed-off-by: Jeff Layton <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
jtlayton authored and Steve French committed Aug 2, 2010
1 parent 9f84159 commit f30b9c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/cifs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,14 @@ cifs_find_inode(struct inode *inode, void *opaque)
{
struct cifs_fattr *fattr = (struct cifs_fattr *) opaque;

/* don't match inode with different uniqueid */
if (CIFS_I(inode)->uniqueid != fattr->cf_uniqueid)
return 0;

/* don't match inode of different type */
if ((inode->i_mode & S_IFMT) != (fattr->cf_mode & S_IFMT))
return 0;

/*
* uh oh -- it's a directory. We can't use it since hardlinked dirs are
* verboten. Disable serverino and return it as if it were found, the
Expand Down

0 comments on commit f30b9c1

Please sign in to comment.