[PATCH 3/3] fuse2fs: catch positive errnos coming from libext2fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

Something in libext2fs is returning EOVERFLOW (positive) to us.  We need
to pass negative errnos back to the fuse driver, so perform this
translation.

Cc: <linux-ext4@xxxxxxxxxxxxxxx> # v1.43
Fixes: 81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
---
 misc/fuse2fs.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)


diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index cc023065727fd5..2bf7413bebb70c 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -4633,8 +4633,18 @@ static int __translate_error(ext2_filsys fs, ext2_ino_t ino, errcode_t err,
 	int is_err = 0;
 
 	/* Translate ext2 error to unix error code */
-	if (err < EXT2_ET_BASE)
+	if (err < EXT2_ET_BASE) {
+		if (err > 0) {
+			/*
+			 * Apparently libext2fs can throw positive errno
+			 * numbers at us.  We need to return negative errnos
+			 * to the fuse driver.
+			 */
+			is_err = 1;
+			ret = -err;
+		}
 		goto no_translation;
+	}
 	switch (err) {
 	case EXT2_ET_NO_MEMORY:
 	case EXT2_ET_TDB_ERR_OOM:





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux