Bug 12743 - vfs_shadow_copy2 fails to list snapshots from shares with GlusterFS backend
Summary: vfs_shadow_copy2 fails to list snapshots from shares with GlusterFS backend
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.6.2
Hardware: x64 Linux
: P5 major (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-13 10:37 UTC by Anoop C S
Modified: 2017-04-28 07:07 UTC (History)
4 users (show)

See Also:


Attachments
samba logs at level 10 (13.27 KB, text/plain)
2017-04-13 10:37 UTC, Anoop C S
no flags Details
git-am fix for 4.6.next, 4.5.next. (3.70 KB, patch)
2017-04-20 23:32 UTC, Jeremy Allison
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anoop C S 2017-04-13 10:37:33 UTC
Created attachment 13153 [details]
samba logs at level 10

While trying to restore previous versions via Windows from shares with GlusterFS backend, already available matching snapshots are not getting listed in 'Previous versions' tab. Following is the GlusterFS share section from smb.conf:

vfs objects = shadow_copy2 glusterfs
glusterfs:volume = fashion
glusterfs:logfile = /var/log/samba/glusterfs-fashion.%M.log
glusterfs:loglevel = 9
shadow:snapdir = /.snaps
shadow:basedir = /
shadow:sort = desc
shadow:sscanf = no
shadow:snapprefix = ^s[a-z0-9]*
shadow:format = _GMT-%Y.%m.%d-%H.%M.%S
path = /
read only = no
guest ok = yes

Following log entry confirms that matching GlusterFS snapshots are found with the above shadow_copy2 configuration:

[2017/04/11 05:35:21.055621, 10, pid=15814, effective(0, 0), real(0, 0)] ../source3/modules/vfs_shadow_copy2.c:1908(shadow_copy2_snapshot_to_gmt)
  shadow_copy2_snapshot_to_gmt: match _GMT-%Y.%m.%d-%H.%M.%S: snap2_GMT-2017.04.10-07.40.00

See attachment for details on following suspected error entries in logs during an attempt to restore previous versions of a directory named '2' present directly under root of the share by right-clicking on the folder-> "Restore Previous versions":

[2017/04/11 05:35:21.061838, 10, pid=15814, effective(0, 0), real(0, 0)] ../source3/modules/vfs_shadow_copy2.c:730(shadow_copy2_strip_snapshot_internal)
  ../source3/modules/vfs_shadow_copy2.c:730: path '/2' doesn't start with cwd '/

. . .

[2017/04/11 05:35:21.126502,  5, pid=15814, effective(0, 0), real(0, 0)] ../source3/smbd/filename.c:913(unix_convert)
  Intermediate not found @GMT-2017.04.10-07.40.00

. . .

[2017/04/11 05:35:21.126626, 10, pid=15814, effective(0, 0), real(0, 0)] ../source3/smbd/filename.c:1596(filename_convert_internal)
  filename_convert_internal: unix_convert failed for name 2/@GMT-2017.04.10-07.40.00 with NT_STATUS_OBJECT_PATH_NOT_FOUND
[2017/04/11 05:35:21.126669,  3, pid=15814, effective(0, 0), real(0, 0)] ../source3/smbd/smb2_server.c:3097(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_PATH_NOT_FOUND] || at ../source3/smbd/smb2_create.c:293
[2017/04/11 05:35:21.126697, 10, pid=15814, effective(0, 0), real(0, 0)] ../source3/smbd/smb2_server.c:2988(smbd_smb2_request_done_ex)
  smbd_smb2_request_done_ex: idx[1] status[NT_STATUS_OBJECT_PATH_NOT_FOUND] body[8] dyn[yes:1] at ../source3/smbd/smb2_server.c:3145
Comment 1 Jeremy Allison 2017-04-20 23:32:39 UTC
Created attachment 13165 [details]
git-am fix for 4.6.next, 4.5.next.

Cherry-pick from master. Hopefully this explains what to do next time to get a back-port Anoop.

Jeremy.
Comment 2 Ralph Böhme 2017-04-21 04:22:56 UTC
Reassiging to Karolin for inclusion in 4.5 and 4.6
Comment 3 Anoop C S 2017-04-21 05:59:35 UTC
(In reply to Jeremy Allison from comment #1)

Yeah.. I should have done the cherry-picks and attached to bug. Will keep that in mind. Thanks for taking care of it now.
Comment 4 Karolin Seeger 2017-04-21 07:09:23 UTC
Pushed to autobuild-v4-{6,5}-test after adding bug info.
Comment 5 Karolin Seeger 2017-04-28 07:07:09 UTC
(In reply to Karolin Seeger from comment #4)
Pushed to both branches.
Closing out bug report.

Thanks!