Commit:     4efa53f0907bb4378015c129a2c11b8d3a90bce2
Parent:     15745320f374aa6cbfe4836b76469159c0f49640
Author:     Steve French <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 11 05:50:53 2007 +0000
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Tue Sep 11 05:50:53 2007 +0000

    [CIFS] lock inode open file list in close in case racing with open
    Harmless since it only protected turning off caching for the
    inode, but cleaner to lock around this in case we have a close
    racing with open.
    Signed-off-by: Shaggy <[EMAIL PROTECTED]>
    CC: Cyrill Gorcunov <[EMAIL PROTECTED]>
    Signed-off-by: Steve French <[EMAIL PROTECTED]>
 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 b1807fd..7925491 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -545,6 +545,7 @@ int cifs_close(struct inode *inode, struct file *file)
        } else
                rc = -EBADF;
+       read_lock(&GlobalSMBSeslock);
        if (list_empty(&(CIFS_I(inode)->openFileList))) {
                cFYI(1, ("closing last open instance for inode %p", inode));
                /* 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)
                CIFS_I(inode)->clientCanCacheRead = FALSE;
                CIFS_I(inode)->clientCanCacheAll  = FALSE;
+       read_unlock(&GlobalSMBSeslock);
        if ((rc == 0) && CIFS_I(inode)->write_behind_rc)
                rc = CIFS_I(inode)->write_behind_rc;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to