Closed NymanRobin closed 5 months ago
Another approach to fixing this would just be to compare the Mount
s by value rather than by pointer.
Happy to review any PR!
Great point @josephlr! I went ahead with the comparison as that removed the responsibility of removing unused mounts from the map and made it a tad bit easier
Fixed by 068b9f8f5dec46b222470f6d3f03244ba5b65f5c
Thanks for the helping me get this change in @ebiggers and @josephlr! I've got one more question: when could we expect a new release of fscrypt? Do you have any plans in mind? I'm asking because I'd like to get this fix into ceph-csi.
There was a release recently, and there haven't been many changes since then, so it probably will be at least a few months before we do another release.
In the filesystem/mountpoint.go file the mountsByDevice map is recreated on each call of update UpdateMountInfo. This causes problem, if these steps occurs!
This will result in the fact that the policy.context.Mount will have the old memory address from the old mountsByDevice map while the filesystems.findMount will find the new object and then in the comparison the following error will be thrown in the policy.apply function.
(%!w(*actions.ErrDifferentFilesystem=&{0xc00157b130 0xc00208a140}).
This currently affects the ceph-csi project and more information can be found in this issue: https://github.com/ceph/ceph-csi/issues/4592
I have tested a solution were only the new mount objects are updated and that would at least work for my specific use-case, I will open a PR for this and look forward to any feedback