[Samba] ZFS and vfs_shadow_copy2

Peter Eriksson pen at lysator.liu.se
Thu Mar 24 13:05:48 UTC 2022


What’s your smb.conf settings?

We are using ZFS & snapshots on FreeBSD with Samba and previous versions on Windows clients show correct time stamps:

smb.conf:
shadow:snapdir = .zfs/snapshot
shadow:format = auto-%Y-%m-%d.%H:%M:%S
shadow:sort = desc
shadow:localtime = yes
shadow:snapdirseverywhere = yes
vfs objects = shadow_copy2 zfsacl full_audit

Specially the shadow:localtime I would check out….


> zfs list -r -t all DATA/staff/peter86 | tail -5
> DATA/staff/peter86 at auto-2022-03-24.10:00:00      0      -  39.6G  -
> DATA/staff/peter86 at auto-2022-03-24.11:00:00      0      -  39.6G  -
> DATA/staff/peter86 at auto-2022-03-24.12:00:00      0      -  39.6G  -
> DATA/staff/peter86 at auto-2022-03-24.13:00:00      0      -  39.6G  -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00      0      -  39.6G  -

> # zfs get all DATA/staff/peter86 at auto-2022-03-24.14:00:00
> NAME                                         PROPERTY              VALUE                  SOURCE
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  type                  snapshot               -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  creation              Thu Mar 24 14:00 2022  -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  used                  0                      -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  referenced            39.6G                  -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  compressratio         1.09x                  -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  devices               on                     default
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  exec                  on                     default
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  setuid                off                    inherited from DATA/staff
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  createtxg             31571581               -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  xattr                 off                    temporary
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  version               5                      -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  utf8only              on                     -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  normalization         none                   -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  casesensitivity       sensitive              -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  nbmand                off                    default
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  guid                  12020027953985750656   -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  primarycache          all                    default
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  secondarycache        all                    default
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  defer_destroy         off                    -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  userrefs              0                      -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  objsetid              615K                   -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  mlslabel                                     -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  refcompressratio      1.09x                  -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  written               0                      -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  clones                                       -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  logicalreferenced     42.2G                  -
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  volmode               default                default
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  se.liu.it:expires     1648213200             local
> DATA/staff/peter86 at auto-2022-03-24.14:00:00  :ttl                  1648213200             local


- Peter


> On 23 Mar 2022, at 16:17, Andrea Venturoli via samba <samba at lists.samba.org> wrote:
> 
> 
> On 3/23/22 13:52, Andrea Venturoli via samba wrote:
> 
>> At least now I know it's a client side problem.
> 
> After further investigation, maybe not.
> 
> I'm still looking into this, but it seems to be a problem with time conversion.
> 
> 
> 
> I have:
>> root at fs:~ # date -u
>> Wed Mar 23 14:46:22 UTC 2022
>> root at fs:~ # date
>> Wed Mar 23 15:46:23 CET 2022
> 
> (kernel clock set to UTC time).
> 
> 
> 
>> # zfs list -t snap
>> zroot/ezjail/fs/shares at auto_zroot-20210920080000       95.9K      -   117K  -
> > ...
> 
> 080000 is my local time (not UTC).
> 
> So, as per VFS_SHADOW_COPY2(8), I put "shadow:localtime=yes" in smb.conf.
> 
> 
> 
> For the above, the packet trace shows the following in the list:
> Snapshot: @GMT-2021.09.20-06.00.00
> 
> Seems right, as locat time was converted to UTC.
> 
> 
> However, after receiving such a list, the client tries to probe some of the snapshots, e.g.:
>> Create Request File: @Sep 20, 2021 06:00:00.000000000
> 
> and the server obviously answers:
>> NT Status: STATUS_UNSUCCESSFUL (0xc0000001)
> 
> Possibly this is the reason a wider range (long time ago, this year, last month, etc...) is excluded.
> 
> 
> 
> I have yet to test this in the wild, but putting "shadow:localtime=no" allowed me to see the full list.
> Of course all the snapshots are labeled as one hour later (the last being in the future).
> 
> Any hint?
> Is this a bug or feature?
> 
> bye & Thanks
> 	av.
> 
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba




More information about the samba mailing list