Message ID | 4a4634330905011316o65609395pb05c5676d66783f3@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, May 1, 2009 at 3:16 PM, Shirish Pargaonkar <shirishpargaonkar@gmail.com> wrote: > Remove adding open file entry twice to lists in case of posix opens > > Do not fill file info twice in case of posix opens and creates > > This fixes the regression in cifs which resulted in failure to pass > connectathon tests. > > diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c > index 461750e..97f68bd 100644 > --- a/fs/cifs/dir.c > +++ b/fs/cifs/dir.c > @@ -464,10 +464,8 @@ cifs_create_set_dentry: > Â Â Â Â if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { > Â Â Â Â Â Â Â Â /* mknod case - do not leave file open */ > Â Â Â Â Â Â Â Â CIFSSMBClose(xid, tcon, fileHandle); > - Â Â Â } else if (newinode) { > - Â Â Â Â Â Â Â Â Â Â Â cifs_fill_fileinfo(newinode, fileHandle, > - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â cifs_sb->tcon, write_only); > Â Â Â Â } > + > Â cifs_create_out: > Â Â Â Â kfree(buf); > Â Â Â Â kfree(full_path); > diff --git a/fs/cifs/file.c b/fs/cifs/file.c > index 50ca088..38c06f8 100644 > --- a/fs/cifs/file.c > +++ b/fs/cifs/file.c > @@ -129,15 +129,12 @@ static inline int > cifs_posix_open_inode_helper(struct inode *inode, > Â Â Â Â Â Â Â Â Â Â Â Â struct file *file, struct cifsInodeInfo *pCifsInode, > Â Â Â Â Â Â Â Â Â Â Â Â struct cifsFileInfo *pCifsFile, int oplock, u16 netfid) > Â { > - Â Â Â struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); > -/* Â Â struct timespec temp; */ Â /* BB REMOVEME BB */ > > Â Â Â Â file->private_data = kmalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); > Â Â Â Â if (file->private_data == NULL) > Â Â Â Â Â Â Â Â return -ENOMEM; > Â Â Â Â pCifsFile = cifs_init_private(file->private_data, inode, file, netfid); > Â Â Â Â write_lock(&GlobalSMBSeslock); > - Â Â Â list_add(&pCifsFile->tlist, &cifs_sb->tcon->openFileList); > > Â Â Â Â pCifsInode = CIFS_I(file->f_path.dentry->d_inode); > Â Â Â Â if (pCifsInode == NULL) { > @@ -145,17 +142,6 @@ static inline int > cifs_posix_open_inode_helper(struct inode *inode, > Â Â Â Â Â Â Â Â return -EINVAL; > Â Â Â Â } > > - Â Â Â /* want handles we can use to read with first > - Â Â Â Â Â in the list so we do not have to walk the > - Â Â Â Â Â list to search for one in write_begin */ > - Â Â Â if ((file->f_flags & O_ACCMODE) == O_WRONLY) { > - Â Â Â Â Â Â Â list_add_tail(&pCifsFile->flist, > - Â Â Â Â Â Â Â Â Â Â Â Â Â Â &pCifsInode->openFileList); > - Â Â Â } else { > - Â Â Â Â Â Â Â list_add(&pCifsFile->flist, > - Â Â Â Â Â Â Â Â Â Â Â Â &pCifsInode->openFileList); > - Â Â Â } > - > Â Â Â Â if (pCifsInode->clientCanCacheRead) { > Â Â Â Â Â Â Â Â /* we have the inode open somewhere else > Â Â Â Â Â Â Â Â Â no need to discard cache data */ > ~ > ~ > This patch can be ignored, spoke too soon, before testing against old samba server. Will post a patch which calls cifs_fill_fileinfo from cifs_create only in non-posix cases.
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 461750e..97f68bd 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -464,10 +464,8 @@ cifs_create_set_dentry: if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { /* mknod case - do not leave file open */ CIFSSMBClose(xid, tcon, fileHandle); - } else if (newinode) { - cifs_fill_fileinfo(newinode, fileHandle, - cifs_sb->tcon, write_only); } + cifs_create_out: kfree(buf); kfree(full_path); diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 50ca088..38c06f8 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -129,15 +129,12 @@ static inline int cifs_posix_open_inode_helper(struct inode *inode, struct file *file, struct cifsInodeInfo *pCifsInode, struct cifsFileInfo *pCifsFile, int oplock, u16 netfid) { - struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); -/* struct timespec temp; */ /* BB REMOVEME BB */ file->private_data = kmalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); if (file->private_data == NULL) return -ENOMEM; pCifsFile = cifs_init_private(file->private_data, inode, file, netfid); write_lock(&GlobalSMBSeslock); - list_add(&pCifsFile->tlist, &cifs_sb->tcon->openFileList); pCifsInode = CIFS_I(file->f_path.dentry->d_inode);