Bug 14896 - vnf_snapper don't work as Windows "Previous Versions"
Summary: vnf_snapper don't work as Windows "Previous Versions"
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.14.9
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-08 03:16 UTC by yasuhiro.handa
Modified: 2022-08-11 18:28 UTC (History)
3 users (show)

See Also:


Attachments
smb.conf log.smbd journal log image1.png image2.png (432.80 KB, application/zip)
2021-11-08 03:16 UTC, yasuhiro.handa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description yasuhiro.handa 2021-11-08 03:16:16 UTC
Created attachment 16965 [details]
smb.conf log.smbd journal log image1.png image2.png

vnf_snapper doesn't work as Windows "Previous Versions".
I tried samba 4.12.15, and it worked fine.
But, 4.14.9 and 4.15.0 don't work.
I tried Fedora 34, 33 and openSUSE 15.3 clean install, but same result.

Symptoms
  Top shared directory is fine.
    image1.png

  Sub directories do not work with an error.
    image2.png

Error within journal.
Nov 07 23:21:24 fedora smbd[34580]: [2021/11/07 23:21:24.956684,  0, pid=34580, effective(0, 0), real(0, 0)] ../../source3/smbd/filename.c:2007(filename_convert_inte>
Nov 07 23:21:24 fedora smbd[34580]:   filename_convert_internal: open_pathref_fsp [test {@GMT-2021.11.07-14.19.41}] failed: NT_STATUS_ACCESS_DENIED

Looks like a dev/ino mismatch has occurred.
log.smbd (log level = 10)
[2021/11/07 23:21:24.956657, 10, pid=34580, effective(0, 0), real(0, 0)] ../../source3/smbd/files.c:537(openat_pathref_fsp)
  openat_pathref_fsp: file [test {@GMT-2021.11.07-14.19.41}] - dev/ino mismatch. Old (dev=55, ino=257). New (dev=55, ino=256).
[2021/11/07 23:21:24.956664, 10, pid=34580, effective(0, 0), real(0, 0)] ../../source3/smbd/files.c:571(openat_pathref_fsp)
  openat_pathref_fsp: Opening pathref for [test {@GMT-2021.11.07-14.19.41}] failed: NT_STATUS_ACCESS_DENIED

I will attach some detailed information.
Comment 1 yasuhiro.handa 2021-11-10 10:59:23 UTC
I tried 4.13.14 with Fedora 34. Same issue occurred.
Comment 2 Yasuma Takeda 2022-07-12 05:36:52 UTC
I found the same problem and have investigated the details.

1. conditions
(1) Setup snapper to get snapshot under a share folder.
(2) The share folder has one or more sub directories.
(3) I try to recover the share folder from snapshot by windows explorer,
    it fails in the progress.

2. versions
4.13.0 and later versions : NG
4.12.15 and before versions : No problem

I investigated why this problem is occured.
I found O_PATH based operations is introduced in Samba 4.13.

The Linux "snapper" creates a new filesystem for a snapshot.
Then vfs-snapper module maps the file and directory which contains
the time information to the files in the backup taken by snapper.

"check_same_dev_ino()" fails because the inode number of the
subdirectory to be restored and the directory under the snapshot
do not match. As a result, NT_STATUS_ACCESS_DENIED error occurs.

I guess that this problem is caused by operations of O_PATH.
But it is difficult to fix by myself.