···715715 if (CIFS_I(inode)->uniqueid != fattr->cf_uniqueid)716716 return 0;717717718718+ /*719719+ * uh oh -- it's a directory. We can't use it since hardlinked dirs are720720+ * verboten. Disable serverino and return it as if it were found, the721721+ * caller can discard it, generate a uniqueid and retry the find722722+ */723723+ if (S_ISDIR(inode->i_mode) && !list_empty(&inode->i_dentry)) {724724+ fattr->cf_flags |= CIFS_FATTR_INO_COLLISION;725725+ cifs_autodisable_serverino(CIFS_SB(inode->i_sb));726726+ }727727+718728 return 1;719729}720730···744734 unsigned long hash;745735 struct inode *inode;746736737737+retry_iget5_locked:747738 cFYI(1, ("looking for uniqueid=%llu", fattr->cf_uniqueid));748739749740 /* hash down to 32-bits on 32-bit arch */750741 hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);751742752743 inode = iget5_locked(sb, hash, cifs_find_inode, cifs_init_inode, fattr);753753-754754- /* we have fattrs in hand, update the inode */755744 if (inode) {745745+ /* was there a problematic inode number collision? */746746+ if (fattr->cf_flags & CIFS_FATTR_INO_COLLISION) {747747+ iput(inode);748748+ fattr->cf_uniqueid = iunique(sb, ROOT_I);749749+ fattr->cf_flags &= ~CIFS_FATTR_INO_COLLISION;750750+ goto retry_iget5_locked;751751+ }752752+756753 cifs_fattr_to_inode(inode, fattr);757754 if (sb->s_flags & MS_NOATIME)758755 inode->i_flags |= S_NOATIME | S_NOCMTIME;