mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
sentry: do not release gofer inode file state loading lock upon error.
When an inode file state failed to load asynchronuously, we want to report the error instead of potentially panicing in another async loading goroutine incorrectly unblocked. PiperOrigin-RevId: 209683977 Change-Id: I591cde97710bbe3cdc53717ee58f1d28bbda9261
This commit is contained in:
@@ -108,9 +108,13 @@ func (i *inodeFileState) loadLoading(_ struct{}) {
|
||||
|
||||
// afterLoad is invoked by stateify.
|
||||
func (i *inodeFileState) afterLoad() {
|
||||
load := func() error {
|
||||
load := func() (err error) {
|
||||
// See comment on i.loading().
|
||||
defer i.loading.Unlock()
|
||||
defer func() {
|
||||
if err == nil {
|
||||
i.loading.Unlock()
|
||||
}
|
||||
}()
|
||||
|
||||
// Manually restore the p9.File.
|
||||
name, ok := i.s.inodeMappings[i.sattr.InodeID]
|
||||
@@ -121,7 +125,6 @@ func (i *inodeFileState) afterLoad() {
|
||||
}
|
||||
// TODO: Context is not plumbed to save/restore.
|
||||
ctx := &dummyClockContext{context.Background()}
|
||||
var err error
|
||||
|
||||
_, i.file, err = i.s.attach.walk(ctx, splitAbsolutePath(name))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user