Skip to content

Commit

Permalink
accounting: always drop references to underlying src fs.Object
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal-Leszczynski committed Nov 28, 2023
1 parent 5ef09c5 commit 23aae6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion fs/accounting/accounting.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ func (acc *Account) Close() error {
if acc.close == nil {
return nil
}
return acc.close.Close()
acc.in = nil
acc.origIn = nil
err := acc.close.Close()
acc.close = nil
return err
}

// Done with accounting - must be called to free accounting goroutine
Expand Down
7 changes: 5 additions & 2 deletions fs/operations/reopen.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (

// NewReOpen makes a handle which will reopen itself and seek to where it was on errors
//
// If hashOption is set this will be applied when reading from the start
// # If hashOption is set this will be applied when reading from the start
//
// If rangeOption is set then this will applied when reading from the
// start, and updated on retries.
Expand Down Expand Up @@ -140,5 +140,8 @@ func (h *ReOpen) Close() error {
}
h.opened = false
h.err = errorFileClosed
return h.rc.Close()
h.src = nil
err := h.rc.Close()
h.rc = nil
return err
}

0 comments on commit 23aae6f

Please sign in to comment.