Bug 15035 - shadow_copy2 fails listing snapshotted dirs with shadow:fixinodes
Summary: shadow_copy2 fails listing snapshotted dirs with shadow:fixinodes
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.16.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on: 15022 15038
Blocks:
  Show dependency treegraph
 
Reported: 2022-03-25 11:08 UTC by Ralph Böhme
Modified: 2022-05-02 09:48 UTC (History)
2 users (show)

See Also:


Attachments
Patch for 4.15 and 4.16 backported from master (13.58 KB, patch)
2022-04-01 14:54 UTC, Ralph Böhme
no flags Details
Patch for 4.15 and 4.16 backported from master - on top of #15022, #15038 (13.04 KB, patch)
2022-04-01 17:31 UTC, Jeremy Allison
no flags Details
Patch for 4.15 and 4.16 backported from master - on top of #15022, #15038 (13.45 KB, patch)
2022-04-04 16: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 Ralph Böhme 2022-03-25 11:08:15 UTC
Since 4.14 we call openat_pathref_fsp() for every directory entry which in 4.16 and below still does a stat() vs fstat() dev/ino comparison. SInce the stat info in this case comes from SMB_VFS_READDIR(), as this is not implemented in shadow_copy2, the module can't update the inode number for the path based stat (provided via fstatat() in vfswrap_readdir()) so it won't match the subsequent fstat() which is handled by shadow_copy2.

In master we now have SMB_VFS_FSTATAT() which is correctly implemented in shadow_copy2 including the inode update logic, so this bug doesn't exist in master (iirc we also removed the dev/ino stat vs fstat check from openat_pathref_fsp in master).

But in 4.16 and below we have to implement readdir() in shadow_copy2.

Have patch, need bugnumber.
Comment 1 Samba QA Contact 2022-03-31 18:48:06 UTC
This bug was referenced in samba master:

f734e960eb7ad98808ad8757de51c51d3db86a2b
ba9c5ba8ec54e72d68e3f753a5350afe0fb50a7c
9fa67ba8eeb6249d4b91b894e80eb1985c845314
Comment 2 Ralph Böhme 2022-04-01 14:54:12 UTC
Created attachment 17259 [details]
Patch for 4.15 and 4.16 backported from master

Just a minor conflict in tests.py...
Comment 3 Jeremy Allison 2022-04-01 17:27:08 UTC
We need to sort out the order of application of the patches in:

https://bugzilla.samba.org/show_bug.cgi?id=15022
https://bugzilla.samba.org/show_bug.cgi?id=15038

and this patchset as they all mess with tests.py, and this patch conflicts if applied after the two above.

I tested #15022 and #15038 applied in order, and they work, but this patch doesn't apply on top. I'll upload a new version modified to work on top of these (as we need all 3 of these patches for 4.16.next and 4.15.next).
Comment 4 Jeremy Allison 2022-04-01 17:31:05 UTC
Created attachment 17260 [details]
Patch for 4.15 and 4.16 backported from master - on top of #15022, #15038

Fixed to apply on top of #15022, #15038.
Comment 5 Jeremy Allison 2022-04-01 17:33:39 UTC
Jule, once Ralph +1's the fix, can you apply the patches in:

https://bugzilla.samba.org/show_bug.cgi?id=15022
https://bugzilla.samba.org/show_bug.cgi?id=15038
https://bugzilla.samba.org/show_bug.cgi?id=15035

in that order please !
Comment 6 Jeremy Allison 2022-04-04 16:32:18 UTC
Created attachment 17263 [details]
Patch for 4.15 and 4.16 backported from master - on top of #15022, #15038

Missed one chunk in the backport of the first patch. This one should match what is in master.
Comment 7 Jeremy Allison 2022-04-05 02:33:39 UTC
Ping Ralph. Can we get the back-ports for:


https://bugzilla.samba.org/show_bug.cgi?id=15022
https://bugzilla.samba.org/show_bug.cgi?id=15038
https://bugzilla.samba.org/show_bug.cgi?id=15035

reviewed and in for 4.15.next, 4.16.next ? They're already in master.
Comment 8 Ralph Böhme 2022-04-05 17:39:04 UTC
Reassigning to Jule for inclusion in 4.15 and 4.16.

Beware of the ordering requirements! :)
Comment 9 Jule Anger 2022-04-11 07:46:34 UTC
Pushed to autobuild-v4-{16,15}-test.
Comment 10 Samba QA Contact 2022-04-11 08:51:28 UTC
This bug was referenced in samba v4-16-test:

829f203c2f3838d619e845d02d25c9443703ec4a
d6b48ec3795bf4bb6b7665be6ce9009932f59db6
bf221a9b207dcd085171fbe8458e33a96a1d0869
Comment 11 Samba QA Contact 2022-04-11 09:22:28 UTC
This bug was referenced in samba v4-15-test:

4d4848e4faec551677fa0bb24c6ba1cbe4196c70
fbcbe7b96c52e1d6e6c030d7fc311d03b22ec3e9
a275f517628e86c4a9a1bcb1bb86921592f91b17
Comment 12 Jule Anger 2022-04-11 11:20:52 UTC
Closing out bug report.

Thanks!
Comment 13 Samba QA Contact 2022-04-26 14:44:12 UTC
This bug was referenced in samba v4-15-stable (Release samba-4.15.7):

4d4848e4faec551677fa0bb24c6ba1cbe4196c70
fbcbe7b96c52e1d6e6c030d7fc311d03b22ec3e9
a275f517628e86c4a9a1bcb1bb86921592f91b17
Comment 14 Samba QA Contact 2022-05-02 09:48:15 UTC
This bug was referenced in samba v4-16-stable (Release samba-4.16.1):

829f203c2f3838d619e845d02d25c9443703ec4a
d6b48ec3795bf4bb6b7665be6ce9009932f59db6
bf221a9b207dcd085171fbe8458e33a96a1d0869