Skip to contentSkip to conversation

cifs: Silently ignore unknown oplock break handle

PATCH Applied Vincent Whitchurch 4 participants 4 messages Mar 19, 2021 – Mar 25, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 cifs: Silently ignore unknown oplock break handle

Make SMB2 not print out an error when an oplock break is received for an unknown handle, similar to SMB1. The debug message which is printed for these unknown handles may also be misleading, so fix that too.

The SMB2 lease break path is not affected by this patch.

Without this, a program which writes to a file from one thread, and opens, reads, and writes the same file from another thread triggers the below errors several times a minute when run against a Samba server configured with "smb2 leases = no".

CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2

 00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
 00000010: 00000001 00000000 ffffffff ffffffff  ................
 00000020: 00000000 00000000 00000000 00000000  ................
 00000030: 00000000 00000000 00000000 00000000  ................

---

Notes:
v3:
- Change debug print to Tom Talpey's suggestion

v2:
- Drop change to lease break
- Rewrite commit message

 fs/cifs/smb2misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/smb2misc.c +2 -2
index 60d4bd1eae2b..76cd05b8d53b 100644
@@ -754,8 +754,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
 		}
 	}
 	spin_unlock(&cifs_tcp_ses_lock);
-	cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
-	return false;
+	cifs_dbg(FYI, "No file id matched, oplock break ignored\n");
+	return true;
 }
 
 void
Signature · 1 line
2.28.0
reviewer Reviewed-by on v3 1/1
#1 lore raw

LGTM feel free to add

Quoted 47 lines · Vincent Whitchurch

Make SMB2 not print out an error when an oplock break is received for an unknown handle, similar to SMB1. The debug message which is printed for these unknown handles may also be misleading, so fix that too.

The SMB2 lease break path is not affected by this patch.

Without this, a program which writes to a file from one thread, and opens, reads, and writes the same file from another thread triggers the below errors several times a minute when run against a Samba server configured with "smb2 leases = no".

CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2

  00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
  00000010: 00000001 00000000 ffffffff ffffffff  ................
  00000020: 00000000 00000000 00000000 00000000  ................
  00000030: 00000000 00000000 00000000 00000000  ................

---

Notes:
v3:
- Change debug print to Tom Talpey's suggestion

v2:
- Drop change to lease break
- Rewrite commit message

  fs/cifs/smb2misc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/smb2misc.c +2 -2
index 60d4bd1eae2b..76cd05b8d53b 100644
@@ -754,8 +754,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
  		}
  	}
  	spin_unlock(&cifs_tcp_ses_lock);
-	cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
-	return false;
+	cifs_dbg(FYI, "No file id matched, oplock break ignored\n");
+	return true;
  }
 
  void
Applied
#2 lore raw

merged into cifs-2.6.git for-next

Quoted 54 lines · Tom Talpey via samba-technical

LGTM feel free to add

Quoted 47 lines · Vincent Whitchurch

Make SMB2 not print out an error when an oplock break is received for an unknown handle, similar to SMB1. The debug message which is printed for these unknown handles may also be misleading, so fix that too.

The SMB2 lease break path is not affected by this patch.

Without this, a program which writes to a file from one thread, and opens, reads, and writes the same file from another thread triggers the below errors several times a minute when run against a Samba server configured with "smb2 leases = no".

CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2

  00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
  00000010: 00000001 00000000 ffffffff ffffffff  ................
  00000020: 00000000 00000000 00000000 00000000  ................
  00000030: 00000000 00000000 00000000 00000000  ................

---

Notes:
v3:
- Change debug print to Tom Talpey's suggestion

v2:
- Drop change to lease break
- Rewrite commit message

  fs/cifs/smb2misc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/smb2misc.c +2 -2
index 60d4bd1eae2b..76cd05b8d53b 100644
@@ -754,8 +754,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
              }
      }
      spin_unlock(&cifs_tcp_ses_lock);
-     cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
-     return false;
+     cifs_dbg(FYI, "No file id matched, oplock break ignored\n");
+     return true;
  }
 
  void
Signature · 3 lines
Thanks,

Steve
Reviewed-by on v3 1/1
#3 lore raw
In reply to Vincent Whitchurch
Quoted 24 lines · Vincent Whitchurch

Make SMB2 not print out an error when an oplock break is received for an unknown handle, similar to SMB1. The debug message which is printed for these unknown handles may also be misleading, so fix that too.

The SMB2 lease break path is not affected by this patch.

Without this, a program which writes to a file from one thread, and opens, reads, and writes the same file from another thread triggers the below errors several times a minute when run against a Samba server configured with "smb2 leases = no".

CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2

 00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
 00000010: 00000001 00000000 ffffffff ffffffff  ................
 00000020: 00000000 00000000 00000000 00000000  ................
 00000030: 00000000 00000000 00000000 00000000  ................

---

Notes:
v3:
- Change debug print to Tom Talpey's suggestion

Quoted 6 lines

v2:
- Drop change to lease break
- Rewrite commit message

 fs/cifs/smb2misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)