From: Darrick J. Wong Date: Fri, 12 Sep 2025 22:26:01 +0000 (-0700) Subject: fuse2fs: check free space when creating a symlink X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebaa6cd230888d048fed8a4ada7bb54cf1b0f222;p=thirdparty%2Fe2fsprogs.git fuse2fs: check free space when creating a symlink Make sure we have enough space to create the symlink and its remote block. Cc: # v1.43 Fixes: 81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs") Signed-off-by: "Darrick J. Wong" --- diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index 68644664..210807ea 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -1825,6 +1825,10 @@ static int op_symlink(const char *src, const char *dest) *node_name = 0; pthread_mutex_lock(&ff->bfl); + if (!fs_can_allocate(ff, 1)) { + ret = -ENOSPC; + goto out2; + } err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, temp_path, &parent); *node_name = a;