Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
cifs: guard against hardlinking directories

+20 -2
+1
fs/cifs/cifsglob.h
··· 502 502 #define CIFS_FATTR_DFS_REFERRAL 0x1 503 503 #define CIFS_FATTR_DELETE_PENDING 0x2 504 504 #define CIFS_FATTR_NEED_REVAL 0x4 505 + #define CIFS_FATTR_INO_COLLISION 0x8 505 506 506 507 struct cifs_fattr { 507 508 u32 cf_flags;
+19 -2
fs/cifs/inode.c
··· 715 715 if (CIFS_I(inode)->uniqueid != fattr->cf_uniqueid) 716 716 return 0; 717 717 718 + /* 719 + * uh oh -- it's a directory. We can't use it since hardlinked dirs are 720 + * verboten. Disable serverino and return it as if it were found, the 721 + * caller can discard it, generate a uniqueid and retry the find 722 + */ 723 + if (S_ISDIR(inode->i_mode) && !list_empty(&inode->i_dentry)) { 724 + fattr->cf_flags |= CIFS_FATTR_INO_COLLISION; 725 + cifs_autodisable_serverino(CIFS_SB(inode->i_sb)); 726 + } 727 + 718 728 return 1; 719 729 } 720 730 ··· 744 734 unsigned long hash; 745 735 struct inode *inode; 746 736 737 + retry_iget5_locked: 747 738 cFYI(1, ("looking for uniqueid=%llu", fattr->cf_uniqueid)); 748 739 749 740 /* hash down to 32-bits on 32-bit arch */ 750 741 hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid); 751 742 752 743 inode = iget5_locked(sb, hash, cifs_find_inode, cifs_init_inode, fattr); 753 - 754 - /* we have fattrs in hand, update the inode */ 755 744 if (inode) { 745 + /* was there a problematic inode number collision? */ 746 + if (fattr->cf_flags & CIFS_FATTR_INO_COLLISION) { 747 + iput(inode); 748 + fattr->cf_uniqueid = iunique(sb, ROOT_I); 749 + fattr->cf_flags &= ~CIFS_FATTR_INO_COLLISION; 750 + goto retry_iget5_locked; 751 + } 752 + 756 753 cifs_fattr_to_inode(inode, fattr); 757 754 if (sb->s_flags & MS_NOATIME) 758 755 inode->i_flags |= S_NOATIME | S_NOCMTIME;