diff options
author | Steve French <sfrench@us.ibm.com> | 2009-05-07 23:04:30 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-05-07 23:04:30 -0400 |
commit | 90e4ee5d311d4e0729daa676b1d7f754265b5874 (patch) | |
tree | d1731b21e054dab9edde4f6132e8999d9f269063 /fs/cifs/file.c | |
parent | ac68392460ffefed13020967bae04edc4d3add06 (diff) |
[CIFS] Fix double list addition in cifs posix open code
Remove adding open file entry twice to lists in the file
Do not fill file info twice in case of posix opens and creates
Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 50ca088d8860..38c06f826575 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, | |||
129 | struct file *file, struct cifsInodeInfo *pCifsInode, | 129 | struct file *file, struct cifsInodeInfo *pCifsInode, |
130 | struct cifsFileInfo *pCifsFile, int oplock, u16 netfid) | 130 | struct cifsFileInfo *pCifsFile, int oplock, u16 netfid) |
131 | { | 131 | { |
132 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | ||
133 | /* struct timespec temp; */ /* BB REMOVEME BB */ | ||
134 | 132 | ||
135 | file->private_data = kmalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); | 133 | file->private_data = kmalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); |
136 | if (file->private_data == NULL) | 134 | if (file->private_data == NULL) |
137 | return -ENOMEM; | 135 | return -ENOMEM; |
138 | pCifsFile = cifs_init_private(file->private_data, inode, file, netfid); | 136 | pCifsFile = cifs_init_private(file->private_data, inode, file, netfid); |
139 | write_lock(&GlobalSMBSeslock); | 137 | write_lock(&GlobalSMBSeslock); |
140 | list_add(&pCifsFile->tlist, &cifs_sb->tcon->openFileList); | ||
141 | 138 | ||
142 | pCifsInode = CIFS_I(file->f_path.dentry->d_inode); | 139 | pCifsInode = CIFS_I(file->f_path.dentry->d_inode); |
143 | if (pCifsInode == NULL) { | 140 | if (pCifsInode == NULL) { |
@@ -145,17 +142,6 @@ static inline int cifs_posix_open_inode_helper(struct inode *inode, | |||
145 | return -EINVAL; | 142 | return -EINVAL; |
146 | } | 143 | } |
147 | 144 | ||
148 | /* want handles we can use to read with first | ||
149 | in the list so we do not have to walk the | ||
150 | list to search for one in write_begin */ | ||
151 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) { | ||
152 | list_add_tail(&pCifsFile->flist, | ||
153 | &pCifsInode->openFileList); | ||
154 | } else { | ||
155 | list_add(&pCifsFile->flist, | ||
156 | &pCifsInode->openFileList); | ||
157 | } | ||
158 | |||
159 | if (pCifsInode->clientCanCacheRead) { | 145 | if (pCifsInode->clientCanCacheRead) { |
160 | /* we have the inode open somewhere else | 146 | /* we have the inode open somewhere else |
161 | no need to discard cache data */ | 147 | no need to discard cache data */ |