/* For windows me and 9x we do not want to request more than it negotiated since it will refuse the read then */ if((pTcon->ses) && !(pTcon->ses->capabilities & CAP_LARGE_FILES)) { current_read_size = min_t(const int, current_read_size, pTcon->ses->server->maxBuf - 128); } 
static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,	loff_t *poffset){	int rc = -EACCES;	unsigned int bytes_read = 0;	unsigned int total_read;	unsigned int current_read_size;	struct cifs_sb_info *cifs_sb;	struct cifsTconInfo *pTcon;	int xid;	char *current_offset;	struct cifsFileInfo *open_file;	xid = GetXid();	cifs_sb = CIFS_SB(file->f_dentry->d_sb);	pTcon = cifs_sb->tcon;	if (file->private_data == NULL) {		FreeXid(xid);		return -EBADF;	}	open_file = (struct cifsFileInfo *)file->private_data;	if ((file->f_flags & O_ACCMODE) == O_WRONLY)		cFYI(1, ("attempting read on write only file instance"));	for (total_read = 0, current_offset = read_data; 	     read_size > total_read;	     total_read += bytes_read, current_offset += bytes_read) {		current_read_size = min_t(const int, read_size - total_read,					  cifs_sb->rsize);		rc = -EAGAIN;		while (rc == -EAGAIN) {			if ((open_file->invalidHandle) && 			    (!open_file->closePend)) {				rc = cifs_reopen_file(file->f_dentry->d_inode,					file, TRUE);				if (rc != 0)					break;			}			rc = CIFSSMBRead(xid, pTcon,					open_file->netfid,					current_read_size, *poffset,					&bytes_read, &current_offset);		}		if (rc || (bytes_read == 0)) {			if (total_read) {				break;			} else {				FreeXid(xid);				return rc;			}		} else {			cifs_stats_bytes_read(pTcon, total_read);			*poffset += bytes_read;		}	}	FreeXid(xid);	return total_read;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f9f5c81769f88bccd177423a30a7d30461754c39/file.c/buggy/fs/cifs/file.c