From 82285f9c28a4aafeeb7e85a4b33a6de3411c57de Mon Sep 17 00:00:00 2001 From: Abhinav Agarwal Date: Sun, 17 May 2026 18:17:23 -0700 Subject: [PATCH] fix statfs divide-by-zero when blksize is 0 On macOS, sshfs.blksize is set to 0. The statfs fallback path (used when the server lacks the statvfs extension) divides by f_frsize, which inherits that zero. Use 4096 as the default. --- sshfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sshfs.c b/sshfs.c index febbe767..299cd3ca 100644 --- a/sshfs.c +++ b/sshfs.c @@ -3382,7 +3382,7 @@ static int sshfs_statfs(const char *path, struct statvfs *buf) return sshfs_ext_statvfs(path, buf); buf->f_namemax = 255; - buf->f_bsize = sshfs.blksize; + buf->f_bsize = sshfs.blksize ? sshfs.blksize : 4096; /* * df seems to use f_bsize instead of f_frsize, so make them * the same