From 76738392282b6b1d032fd91e17d19970770dcb07 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 29 Sep 2020 00:42:43 +0300 Subject: [PATCH] lib/{fs,filestream}: small consistency-related updates after cc90a548b1822f536988cf4cfc3f4f52c34afcf5 --- lib/filestream/filestream_openbsd.go | 2 +- lib/fs/fs.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/filestream/filestream_openbsd.go b/lib/filestream/filestream_openbsd.go index 9e5383193..631a915d4 100644 --- a/lib/filestream/filestream_openbsd.go +++ b/lib/filestream/filestream_openbsd.go @@ -20,8 +20,8 @@ func (st *streamTracker) adviseDontNeed(n int, fdatasync bool) error { return fmt.Errorf("unix.Fsync error: %w", err) } } + st.offset += blockSize st.length -= blockSize - return nil } diff --git a/lib/fs/fs.go b/lib/fs/fs.go index b434b46b1..fb05fa876 100644 --- a/lib/fs/fs.go +++ b/lib/fs/fs.go @@ -338,6 +338,5 @@ func mustGetFreeSpace(path string) uint64 { if err := unix.Fstatfs(int(fd), &stat); err != nil { logger.Panicf("FATAL: cannot determine free disk space on %q: %s", path, err) } - return freeSpace(stat) }