mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-16 03:20:50 +02:00
fix(mount): skip metadata flush for unlinked-while-open files (#9027)
When a file is unlinked while still open (open-unlink-close pattern), the synchronous doFlush path would recreate the entry on the filer during close. Check fh.isDeleted before flushing metadata, matching the async flush path which already had this check.
This commit is contained in:
@@ -144,6 +144,13 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32, allowAsync bool) fuse.S
|
||||
return fuse.OK
|
||||
}
|
||||
|
||||
// Skip metadata flush if the file was unlinked while open.
|
||||
// The filer entry is already gone; flushing would recreate it.
|
||||
if fh.isDeleted {
|
||||
glog.V(3).Infof("doFlush %s fh %d: file was unlinked, skipping metadata flush", fileFullPath, fh.fh)
|
||||
return fuse.OK
|
||||
}
|
||||
|
||||
if isOverQuota {
|
||||
return fuse.Status(syscall.ENOSPC)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user