misc/172349: Samba previous versions (vfs shadow_copy2) does not work with SMB2 enabled

Eric Dombroski eric at edombroski.com
Fri Oct 5 03:40:20 UTC 2012


>Number:         172349
>Category:       misc
>Synopsis:       Samba previous versions (vfs shadow_copy2) does not work with SMB2 enabled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 05 03:40:18 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Eric Dombroski
>Release:        9.0-RELEASE-p4
>Organization:
>Environment:
FreeBSD umaro 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012     root at amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
It appears with Samba 3.6.7 the shadow_copy2 VFS module (enabling "Previous Versions" support in Windows) does not function properly when SMB2 is enabled ("max protocol = SMB2"), at least when used ontop of ZFS with the zfsacl module.

/usr/local/etc/smb.conf (works - Previous Versions are viewable via Windows 7):


[global]
workgroup = WORKGROUP
security = user
log file = /var/log/samba/samba.log
max log size = 10000000
unix extensions = no
aio read size = 1
aio write size = 1



[homes]
comment = Home Directories
browseable = no
writable = yes

[shared]
path = /storage/shared
vfs objects = zfsacl shadow_copy2
nfs4:mode = special
nfs4:acedup = merge
nfs4:chown = yes
shadow:snapdir = .zfs/snapshot
shadow:format = %Y.%m.%d-%H.%M
shadow:sort = desc
shadow:localtime = yes
writeable = yes
nt acl support = yes
map acl inherit = yes
inherit permissions = yes
inherit acls = yes
inherit owner = yes
acl map full control = true
follow symlinks = yes
wide links = yes
veto files = /.zfs/
hide files = /Desktop.ini/Thumbs.db/
map readonly = no
map archive = no
map hidden = no
map system = no





Doesn't work:


[global]
workgroup = WORKGROUP
security = user
log file = /var/log/samba/samba.log
max log size = 10000000
unix extensions = no
aio read size = 1
aio write size = 1
#seems to break previous versions
max protocol = SMB2



[homes]
comment = Home Directories
browseable = no
writable = yes

[shared]
path = /storage/shared
vfs objects = zfsacl shadow_copy2
nfs4:mode = special
nfs4:acedup = merge
nfs4:chown = yes
shadow:snapdir = .zfs/snapshot
shadow:format = %Y.%m.%d-%H.%M
shadow:sort = desc
shadow:localtime = yes
writeable = yes
nt acl support = yes
map acl inherit = yes
inherit permissions = yes
inherit acls = yes
inherit owner = yes
acl map full control = true
follow symlinks = yes
wide links = yes
veto files = /.zfs/
hide files = /Desktop.ini/Thumbs.db/
map readonly = no
map archive = no
map hidden = no
map system = no



ZFS info:

umaro# zfs get all storage/shared
NAME            PROPERTY              VALUE                  SOURCE
storage/shared  type                  filesystem             -
storage/shared  creation              Sun Oct 14 16:12 2012  -
storage/shared  used                  134G                   -
storage/shared  available             10.5T                  -
storage/shared  referenced            126G                   -
storage/shared  compressratio         1.00x                  -
storage/shared  mounted               yes                    -
storage/shared  quota                 none                   default
storage/shared  reservation           none                   default
storage/shared  recordsize            128K                   default
storage/shared  mountpoint            /storage/shared        default
storage/shared  sharenfs              off                    local
storage/shared  checksum              on                     default
storage/shared  compression           off                    default
storage/shared  atime                 on                     default
storage/shared  devices               on                     default
storage/shared  exec                  on                     default
storage/shared  setuid                on                     default
storage/shared  readonly              off                    default
storage/shared  jailed                off                    default
storage/shared  snapdir               visible                local
storage/shared  aclmode               passthrough            local
storage/shared  aclinherit            passthrough            local
storage/shared  canmount              on                     default
storage/shared  xattr                 off                    temporary
storage/shared  copies                1                      default
storage/shared  version               5                      -
storage/shared  utf8only              off                    -
storage/shared  normalization         none                   -
storage/shared  casesensitivity       sensitive              -
storage/shared  vscan                 off                    default
storage/shared  nbmand                off                    default
storage/shared  sharesmb              off                    default
storage/shared  refquota              none                   default
storage/shared  refreservation        none                   default
storage/shared  primarycache          all                    default
storage/shared  secondarycache        all                    default
storage/shared  usedbysnapshots       8.17G                  -
storage/shared  usedbydataset         126G                   -
storage/shared  usedbychildren        0                      -
storage/shared  usedbyrefreservation  0                      -
storage/shared  logbias               latency                default
storage/shared  dedup                 off                    default
storage/shared  mlslabel                                     -
storage/shared  sync                  standard               default
storage/shared  refcompressratio      1.00x                  -






>How-To-Repeat:
Enable previous versions support in smb.conf:

vfs objects = shadow_copy2
shadow:snapdir = .zfs/snapshot
shadow:format = %Y.%m.%d-%H.%M
shadow.sort = desc
shadow.localtime = yes


And also enable SMB2:

max protocol = SMB2


Commenting out max protocol = SMB2, and restarting the 'Workstation' service on the client switches it to use SMB1, and the previous versions show up.  At least for me.

I don't have much more time to look into this at the moment, but I thought I might at least report it.
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list