mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-25 14:30:22 +00:00
fscrypt: Update mount info before create context
NewContextFrom{Mountpoint,Path} functions use cached `/proc/self/mountinfo` to find mounted file systems by device ID. Since we run fscrypt as a library in a long-lived process the cached information is likely to be stale. Stale entries may map device IDs to mount points of already destroyed RBDs and fail context creation. Updating the cache beforehand prevents this. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
This commit is contained in:
parent
a52314356e
commit
97cb1b6672
@ -333,6 +333,11 @@ func Unlock(
|
||||
return err
|
||||
}
|
||||
|
||||
err = fscryptfilesystem.UpdateMountInfo()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fscryptContext, err := fscryptactions.NewContextFromMountpoint(stagingTargetPath, nil)
|
||||
if err != nil {
|
||||
log.ErrorLog(ctx, "fscrypt: failed to create context from mountpoint %v: %w", stagingTargetPath, err)
|
||||
|
Loading…
Reference in New Issue
Block a user