Project

General

Profile

Actions

Bug #16269

closed

SMB could allow persistent opens on directories

Added by Toomas Soome 12 days ago. Updated 7 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cifs - CIFS server and client
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
racktop:BSR-14755

Description

While testing Hyper-V support, we noticed event log messages complaining that the server failed to return a persistent handle for some open. After looking at the capture we see that the only open where persistence was requested but not granted is for an open of the VM/Virtual Machines directory.
We don't currently support persistent handles for directories, though we could.
We also don't support directory leases, which would make persistent handles on directories a lot more useful. If the client really wants persistent handles (as appears to be the case with Hyper-V) we can allow that without needing to implement directory leases.

Testing:

$ smbtorture ... //10.x.y.z/testca smb2.durable-v2-open.reopen2-lease-cadir
smbtorture 4.10.8
Using seed 1705590868
time: 2024-01-18 15:14:28.604403
test: reopen2-lease-cadir
time: 2024-01-18 15:14:28.605198
Password for [...]:
time: 2024-01-18 15:14:31.628176
success: reopen2-lease-cadir
$

Actions #1

Updated by Electric Monk 12 days ago

  • Gerrit CR set to 3285
Actions #2

Updated by Toomas Soome 9 days ago

Toomas Soome wrote:

While testing Hyper-V support, we noticed event log messages complaining that the server failed to return a persistent handle for some open. After looking at the capture we see that the only open where persistence was requested but not granted is for an open of the VM/Virtual Machines directory.
We don't currently support persistent handles for directories, though we could.
We also don't support directory leases, which would make persistent handles on directories a lot more useful. If the client really wants persistent handles (as appears to be the case with Hyper-V) we can allow that without needing to implement directory leases.

Testing:
[...]

And here is my own testing to confirm:

$ /usr/local/samba/bin/smbtorture  //192.168.150.13/testca smb2.durable-v2-open.reopen2-lease-cadir
smbtorture 4.10.8
Using seed 1707809273
time: 2024-02-13 07:27:53.863454
test: reopen2-lease-cadir
time: 2024-02-13 07:27:53.864292
Password for [WORKGROUP\tsoome]:
time: 2024-02-13 07:27:57.314592
success: reopen2-lease-cadir

Actions #3

Updated by Toomas Soome 9 days ago

  • Status changed from In Progress to Pending RTI
Actions #4

Updated by Electric Monk 7 days ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 90 to 100

git commit 19fa1385c0e0ac6b45d333702468f04c026d3f30

commit  19fa1385c0e0ac6b45d333702468f04c026d3f30
Author: Gordon Ross <gwr@racktopsystems.com>
Date:   2024-02-14T21:26:00.000Z

    16269 SMB could allow persistent opens on directories
    Reviewed by: Matt Barden <mbarden@racktopsystems.com>
    Reviewed by: Bill Sommerfeld <sommerfeld@hamachi.org>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF