diff options
-rw-r--r-- | fs/cifs/file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index b1807fd1ac40..792549193865 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -545,6 +545,7 @@ int cifs_close(struct inode *inode, struct file *file) | |||
545 | } else | 545 | } else |
546 | rc = -EBADF; | 546 | rc = -EBADF; |
547 | 547 | ||
548 | read_lock(&GlobalSMBSeslock); | ||
548 | if (list_empty(&(CIFS_I(inode)->openFileList))) { | 549 | if (list_empty(&(CIFS_I(inode)->openFileList))) { |
549 | cFYI(1, ("closing last open instance for inode %p", inode)); | 550 | cFYI(1, ("closing last open instance for inode %p", inode)); |
550 | /* if the file is not open we do not know if we can cache info | 551 | /* if the file is not open we do not know if we can cache info |
@@ -552,6 +553,7 @@ int cifs_close(struct inode *inode, struct file *file) | |||
552 | CIFS_I(inode)->clientCanCacheRead = FALSE; | 553 | CIFS_I(inode)->clientCanCacheRead = FALSE; |
553 | CIFS_I(inode)->clientCanCacheAll = FALSE; | 554 | CIFS_I(inode)->clientCanCacheAll = FALSE; |
554 | } | 555 | } |
556 | read_unlock(&GlobalSMBSeslock); | ||
555 | if ((rc == 0) && CIFS_I(inode)->write_behind_rc) | 557 | if ((rc == 0) && CIFS_I(inode)->write_behind_rc) |
556 | rc = CIFS_I(inode)->write_behind_rc; | 558 | rc = CIFS_I(inode)->write_behind_rc; |
557 | FreeXid(xid); | 559 | FreeXid(xid); |