Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
cifs: don't use CIFSGetSrvInodeNumber in is_path_accessible
cifs: clean up handling when server doesn't consistently support inode numbers

+21 -16
+1
fs/cifs/cifsproto.h
··· 388 388 const struct nls_table *nls_codepage, int remap_special_chars); 389 389 extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon, 390 390 const int netfid, __u64 *pExtAttrBits, __u64 *pMask); 391 + extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb); 391 392 #endif /* _CIFSPROTO_H */
-8
fs/cifs/connect.c
··· 2220 2220 struct cifs_sb_info *cifs_sb, const char *full_path) 2221 2221 { 2222 2222 int rc; 2223 - __u64 inode_num; 2224 2223 FILE_ALL_INFO *pfile_info; 2225 - 2226 - rc = CIFSGetSrvInodeNumber(xid, tcon, full_path, &inode_num, 2227 - cifs_sb->local_nls, 2228 - cifs_sb->mnt_cifs_flags & 2229 - CIFS_MOUNT_MAP_SPECIAL_CHR); 2230 - if (rc != -EOPNOTSUPP) 2231 - return rc; 2232 2224 2233 2225 pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); 2234 2226 if (pfile_info == NULL)
+2 -5
fs/cifs/inode.c
··· 512 512 cifs_sb->local_nls, 513 513 cifs_sb->mnt_cifs_flags & 514 514 CIFS_MOUNT_MAP_SPECIAL_CHR); 515 - if (rc1) { 515 + if (rc1 || !fattr.cf_uniqueid) { 516 516 cFYI(1, ("GetSrvInodeNum rc %d", rc1)); 517 517 fattr.cf_uniqueid = iunique(sb, ROOT_I); 518 - /* disable serverino if call not supported */ 519 - if (rc1 == -EINVAL) 520 - cifs_sb->mnt_cifs_flags &= 521 - ~CIFS_MOUNT_SERVER_INUM; 518 + cifs_autodisable_serverino(cifs_sb); 522 519 } 523 520 } else { 524 521 fattr.cf_uniqueid = iunique(sb, ROOT_I);
+14
fs/cifs/misc.c
··· 715 715 ctoUCS_out: 716 716 return i; 717 717 } 718 + 719 + void 720 + cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb) 721 + { 722 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { 723 + cifs_sb->mnt_cifs_flags &= CIFS_MOUNT_SERVER_INUM; 724 + cERROR(1, ("Autodisabling the use of server inode numbers on " 725 + "%s. This server doesn't seem to support them " 726 + "properly. Hardlinks will not be recognized on this " 727 + "mount. Consider mounting with the \"noserverino\" " 728 + "option to silence this message.", 729 + cifs_sb->tcon->treeName)); 730 + } 731 + }
+4 -3
fs/cifs/readdir.c
··· 727 727 cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *) 728 728 pfindEntry, cifs_sb); 729 729 730 - /* FIXME: make _to_fattr functions fill this out */ 731 - if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_ID_FULL_DIR_INFO) 730 + if (inum && (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) { 732 731 fattr.cf_uniqueid = inum; 733 - else 732 + } else { 734 733 fattr.cf_uniqueid = iunique(sb, ROOT_I); 734 + cifs_autodisable_serverino(cifs_sb); 735 + } 735 736 736 737 ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid); 737 738 tmp_dentry = cifs_readdir_lookup(file->f_dentry, &qstring, &fattr);