diff options
Diffstat (limited to 'fs/cifs/file.c')
| -rw-r--r-- | fs/cifs/file.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 06e27ac6d82c..97090693d182 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
| @@ -338,10 +338,12 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file, | |||
| 338 | atomic_inc(&tcon->num_local_opens); | 338 | atomic_inc(&tcon->num_local_opens); |
| 339 | 339 | ||
| 340 | /* if readable file instance put first in list*/ | 340 | /* if readable file instance put first in list*/ |
| 341 | spin_lock(&cinode->open_file_lock); | ||
| 341 | if (file->f_mode & FMODE_READ) | 342 | if (file->f_mode & FMODE_READ) |
| 342 | list_add(&cfile->flist, &cinode->openFileList); | 343 | list_add(&cfile->flist, &cinode->openFileList); |
| 343 | else | 344 | else |
| 344 | list_add_tail(&cfile->flist, &cinode->openFileList); | 345 | list_add_tail(&cfile->flist, &cinode->openFileList); |
| 346 | spin_unlock(&cinode->open_file_lock); | ||
| 345 | spin_unlock(&tcon->open_file_lock); | 347 | spin_unlock(&tcon->open_file_lock); |
| 346 | 348 | ||
| 347 | if (fid->purge_cache) | 349 | if (fid->purge_cache) |
| @@ -413,7 +415,9 @@ void _cifsFileInfo_put(struct cifsFileInfo *cifs_file, bool wait_oplock_handler) | |||
| 413 | cifs_add_pending_open_locked(&fid, cifs_file->tlink, &open); | 415 | cifs_add_pending_open_locked(&fid, cifs_file->tlink, &open); |
| 414 | 416 | ||
| 415 | /* remove it from the lists */ | 417 | /* remove it from the lists */ |
| 418 | spin_lock(&cifsi->open_file_lock); | ||
| 416 | list_del(&cifs_file->flist); | 419 | list_del(&cifs_file->flist); |
| 420 | spin_unlock(&cifsi->open_file_lock); | ||
| 417 | list_del(&cifs_file->tlist); | 421 | list_del(&cifs_file->tlist); |
| 418 | atomic_dec(&tcon->num_local_opens); | 422 | atomic_dec(&tcon->num_local_opens); |
| 419 | 423 | ||
| @@ -1950,9 +1954,9 @@ refind_writable: | |||
| 1950 | return 0; | 1954 | return 0; |
| 1951 | } | 1955 | } |
| 1952 | 1956 | ||
| 1953 | spin_lock(&tcon->open_file_lock); | 1957 | spin_lock(&cifs_inode->open_file_lock); |
| 1954 | list_move_tail(&inv_file->flist, &cifs_inode->openFileList); | 1958 | list_move_tail(&inv_file->flist, &cifs_inode->openFileList); |
| 1955 | spin_unlock(&tcon->open_file_lock); | 1959 | spin_unlock(&cifs_inode->open_file_lock); |
| 1956 | cifsFileInfo_put(inv_file); | 1960 | cifsFileInfo_put(inv_file); |
| 1957 | ++refind; | 1961 | ++refind; |
| 1958 | inv_file = NULL; | 1962 | inv_file = NULL; |
