if(rc1) { 
if (rc1) { 
int cifs_get_inode_info(struct inode **pinode,	const unsigned char *search_path, FILE_ALL_INFO *pfindData,	struct super_block *sb, int xid){	int rc = 0;	struct cifsTconInfo *pTcon;	struct inode *inode;	struct cifs_sb_info *cifs_sb = CIFS_SB(sb);	char *tmp_path;	char *buf = NULL;	pTcon = cifs_sb->tcon;	cFYI(1,("Getting info on %s ", search_path));	if((pfindData == NULL) && (*pinode != NULL)) {		if(CIFS_I(*pinode)->clientCanCacheRead) {			cFYI(1,("No need to revalidate cached inode sizes"));			return rc;		}	}	/* if file info not passed in then get it from server */	if(pfindData == NULL) {		buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);		if(buf == NULL)			return -ENOMEM;		pfindData = (FILE_ALL_INFO *)buf;		/* could do find first instead but this returns more info */		rc = CIFSSMBQPathInfo(xid, pTcon, search_path, pfindData,			      cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 				CIFS_MOUNT_MAP_SPECIAL_CHR);	}	/* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */	if (rc) {		if (rc == -EREMOTE) {			tmp_path =			    kmalloc(strnlen				    (pTcon->treeName,				     MAX_TREE_SIZE + 1) +				    strnlen(search_path, MAX_PATHCONF) + 1,				    GFP_KERNEL);			if (tmp_path == NULL) {				kfree(buf);				return -ENOMEM;			}			strncpy(tmp_path, pTcon->treeName, MAX_TREE_SIZE);			strncat(tmp_path, search_path, MAX_PATHCONF);			rc = connect_to_dfs_path(xid, pTcon->ses,						 /* treename + */ tmp_path,						 cifs_sb->local_nls, 						 cifs_sb->mnt_cifs_flags & 						   CIFS_MOUNT_MAP_SPECIAL_CHR);			kfree(tmp_path);			/* BB fix up inode etc. */		} else if (rc) {			kfree(buf);			return rc;		}	} else {		struct cifsInodeInfo *cifsInfo;		__u32 attr = le32_to_cpu(pfindData->Attributes);		/* get new inode */		if (*pinode == NULL) {			*pinode = new_inode(sb);			if (*pinode == NULL)				return -ENOMEM;			/* Is an i_ino of zero legal? Can we use that to check			   if the server supports returning inode numbers?  Are			   there other sanity checks we can use to ensure that			   the server is really filling in that field? */			/* We can not use the IndexNumber field by default from			   Windows or Samba (in ALL_INFO buf) but we can request			   it explicitly.  It may not be unique presumably if			   the server has multiple devices mounted under one			   share */			/* There may be higher info levels that work but are			   there Windows server or network appliances for which			   IndexNumber field is not guaranteed unique? */#ifdef CONFIG_CIFS_EXPERIMENTAL					if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM){				int rc1 = 0;				__u64 inode_num;				rc1 = CIFSGetSrvInodeNumber(xid, pTcon, 					search_path, &inode_num, 					cifs_sb->local_nls,					cifs_sb->mnt_cifs_flags &						CIFS_MOUNT_MAP_SPECIAL_CHR);				if(rc1) {					cFYI(1,("GetSrvInodeNum rc %d", rc1));					/* BB EOPNOSUPP disable SERVER_INUM? */				} else /* do we need cast or hash to ino? */					(*pinode)->i_ino = inode_num;			} /* else ino incremented to unique num in new_inode*/#endif /* CIFS_EXPERIMENTAL */			insert_inode_hash(*pinode);		}		inode = *pinode;		cifsInfo = CIFS_I(inode);		cifsInfo->cifsAttrs = attr;		cFYI(1, (" Old time %ld ", cifsInfo->time));		cifsInfo->time = jiffies;		cFYI(1, (" New time %ld ", cifsInfo->time));		/* blksize needs to be multiple of two. So safer to default to		blksize and blkbits set in superblock so 2**blkbits and blksize		will match rather than setting to:		(pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;*/		/* Linux can not store file creation time unfortunately so we ignore it */		inode->i_atime =		    cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastAccessTime));		inode->i_mtime =		    cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastWriteTime));		inode->i_ctime =		    cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));		cFYI(0, (" Attributes came in as 0x%x ", attr));		/* set default mode. will override for dirs below */		if (atomic_read(&cifsInfo->inUse) == 0)			/* new inode, can safely set these fields */			inode->i_mode = cifs_sb->mnt_file_mode;/*		if (attr & ATTR_REPARSE)  */		/* We no longer handle these as symlinks because we could not		   follow them due to the absolute path with drive letter */		if (attr & ATTR_DIRECTORY) {		/* override default perms since we do not do byte range locking		   on dirs */			inode->i_mode = cifs_sb->mnt_dir_mode;			inode->i_mode |= S_IFDIR;		} else {			inode->i_mode |= S_IFREG;			/* treat the dos attribute of read-only as read-only			   mode e.g. 555 */			if (cifsInfo->cifsAttrs & ATTR_READONLY)				inode->i_mode &= ~(S_IWUGO);		/* BB add code here -		   validate if device or weird share or device type? */		}		if (is_size_safe_to_change(cifsInfo)) {			/* can not safely change the file size here if the			   client is writing to it due to potential races */			i_size_write(inode,le64_to_cpu(pfindData->EndOfFile));			/* 512 bytes (2**9) is the fake blocksize that must be			   used for this calculation */			inode->i_blocks = (512 - 1 + le64_to_cpu(					   pfindData->AllocationSize)) >> 9;		}		inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks);		/* BB fill in uid and gid here? with help from winbind? 		   or retrieve from NTFS stream extended attribute */		if (atomic_read(&cifsInfo->inUse) == 0) {			inode->i_uid = cifs_sb->mnt_uid;			inode->i_gid = cifs_sb->mnt_gid;			/* set so we do not keep refreshing these fields with			   bad data after user has changed them in memory */			atomic_set(&cifsInfo->inUse,1);		}		if (S_ISREG(inode->i_mode)) {			cFYI(1, (" File inode "));			inode->i_op = &cifs_file_inode_ops;			if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)				inode->i_fop = &cifs_file_direct_ops;			else				inode->i_fop = &cifs_file_ops;			inode->i_data.a_ops = &cifs_addr_ops;		} else if (S_ISDIR(inode->i_mode)) {			cFYI(1, (" Directory inode "));			inode->i_op = &cifs_dir_inode_ops;			inode->i_fop = &cifs_dir_ops;		} else if (S_ISLNK(inode->i_mode)) {			cFYI(1, (" Symbolic Link inode "));			inode->i_op = &cifs_symlink_inode_ops;		} else {			init_special_inode(inode, inode->i_mode,					   inode->i_rdev);		}	}	kfree(buf);	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d0d2f2df65ddea9a30ddd117f769bfff65d3fc56/inode.c/buggy/fs/cifs/inode.c