Not sure what I was thinking when I added this, but the fstat handler in vfs_snapper doesn't look right: 2168 static int snapper_gmt_fstat(vfs_handle_struct *handle, files_struct *fsp, 2169 SMB_STRUCT_STAT *sbuf) 2170 { 2171 time_t timestamp; 2172 int ret; 2173 2174 ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf); 2175 if (ret == -1) { 2176 return ret; 2177 } 2178 if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, 2179 fsp->fsp_name->base_name, 2180 ×tamp, NULL)) { 2181 return 0; 2182 } 2183 return 0; 2184 } It returns zero regardless of whether fsp refers to a snapshot or not. I think this is a cut-n-paste error from shadow_copy2, which does some fiddling about with sbuf for snapshots. The entire handler can probably be dropped.
Yep, seems the right thing to do to me. Can you propose a patch and I'll review. Thanks, Jeremy.
(In reply to Jeremy Allison from comment #1) > Yep, seems the right thing to do to me. Can you propose a patch and I'll > review. Thanks! Sent to the list: https://lists.samba.org/archive/samba-technical/2019-March/133055.html
LGTM. RB+ and pushed. Back-port once it's in.
Created attachment 15059 [details] cherry-pick for 4.9.next and 4.10.next
Re-assigning to Karolin for inclusion in 4.10.next, 4.9.next.
(In reply to Jeremy Allison from comment #5) Pushed to autobuild-v4-{10,9}-test.
(In reply to Karolin Seeger from comment #6) Pushed to both branches. Closing out bug report. Thanks!