Skip to content

Commit

Permalink
Make OpenFile directory protection condition consistent with Release
Browse files Browse the repository at this point in the history
Even though it doesn't matter a lot because dead files aren't opened at all
  • Loading branch information
vitalif committed Aug 11, 2023
1 parent 1f92bca commit 64dede0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/handles.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ func (inode *Inode) OpenFile() (fh *FileHandle, err error) {
fh = NewFileHandle(inode)

n := atomic.AddInt32(&inode.fileHandles, 1)
if n == 1 && inode.CacheState == ST_CACHED {
if n == 1 && inode.CacheState <= ST_DEAD {
// This is done to try to protect directories with open files
inode.Parent.addModified(1)
}
return
Expand Down

0 comments on commit 64dede0

Please sign in to comment.