diff --git a/weed/mount/weedfs_file_sync.go b/weed/mount/weedfs_file_sync.go index 88c88ea97..adfefebd2 100644 --- a/weed/mount/weedfs_file_sync.go +++ b/weed/mount/weedfs_file_sync.go @@ -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) }