diff mbox series

[8/9] cifs: don't unlock cifs_tcp_ses_lock in cached_dir_lease_break()

Message ID 20220809021156.3086869-9-lsahlber@redhat.com (mailing list archive)
State New, archived
Headers show
Series [1/9] cifs: Move cached-dir functions into a separate file | expand

Commit Message

Ronnie Sahlberg Aug. 9, 2022, 2:11 a.m. UTC
Unlock it from the caller, which is also where the lock is taken.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/cached_dir.c | 1 -
 fs/cifs/smb2misc.c   | 4 +++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Paulo Alcantara Aug. 11, 2022, 1:38 p.m. UTC | #1
Ronnie Sahlberg <lsahlber@redhat.com> writes:

> Unlock it from the caller, which is also where the lock is taken.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/cached_dir.c | 1 -
>  fs/cifs/smb2misc.c   | 4 +++-
>  2 files changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Steve French Aug. 11, 2022, 3:27 p.m. UTC | #2
FYI - I have merged this patch into patch1 to make it clearer

On Thu, Aug 11, 2022 at 8:37 AM Paulo Alcantara <pc@cjr.nz> wrote:
>
> Ronnie Sahlberg <lsahlber@redhat.com> writes:
>
> > Unlock it from the caller, which is also where the lock is taken.
> >
> > Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> > ---
> >  fs/cifs/cached_dir.c | 1 -
> >  fs/cifs/smb2misc.c   | 4 +++-
> >  2 files changed, 3 insertions(+), 2 deletions(-)
>
> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
diff mbox series

Patch

diff --git a/fs/cifs/cached_dir.c b/fs/cifs/cached_dir.c
index 5f2d01833f1e..9d221f0bf976 100644
--- a/fs/cifs/cached_dir.c
+++ b/fs/cifs/cached_dir.c
@@ -389,7 +389,6 @@  int cached_dir_lease_break(struct cifs_tcon *tcon, __u8 lease_key[16])
 			  smb2_cached_lease_break);
 		queue_work(cifsiod_wq,
 			   &cfid->lease_break);
-		spin_unlock(&cifs_tcp_ses_lock);
 		return true;
 	}
 	return false;
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
index d3d9174ddd7c..2cc038aca5bc 100644
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -640,8 +640,10 @@  smb2_is_valid_lease_break(char *buffer)
 				}
 				spin_unlock(&tcon->open_file_lock);
 
-				if (cached_dir_lease_break(tcon, rsp->LeaseKey))
+				if (cached_dir_lease_break(tcon, rsp->LeaseKey)) {
+					spin_unlock(&cifs_tcp_ses_lock);
 					return true;
+				}
 			}
 		}
 	}