On Thu, 2019-03-14 at 23:52 +0100, David Disseldorp wrote: > Thanks for the feedback Patrick and Greg... > > On Thu, 14 Mar 2019 13:09:48 -0700, Patrick Donnelly wrote: > > > Hello David, > > > > On Thu, Mar 14, 2019 at 12:20 PM David Disseldorp <ddiss@xxxxxxx> wrote: > > > I'm working on adding Samba integration with CephFS snapshots, so that > > > they can be accessed in Explorer via file/folder right-click -> > > > restore previous versions. > > > > How are you actually planning to effect a restore from snapshot? > > That's all handled by the client. Basically the client takes a @GMT-X > value from the enum response and provides it as a "timewarp" token along > with the regular (non-snapshot) path on open. Samba then needs to do a > reverse snap-create-time -> snap-dir lookup for path resolution. > > Ideally, having the snap-create-time in the snapshot's stx_btime would > make the enum + reverse lookup more efficient, as we would be able to > get everything via ceph_readdirplus_r(). xattr should work too though, > be it a little slower. > I wouldn't overload stx_btime with this value as it has its own meaning, and applications should be able to get to that value in a snapshot too. One of the goals with statx was to make a stat struct that was extendable. If performance is a factor then just extend ceph_statx with a new stx_snap_btime field. If performance is not a big deal here, then an xattr would probably be simpler to implement. Cheers, -- Jeff Layton <jlayton@xxxxxxxxxxxxxxx>