]> git.sven.stormbind.net Git - sven/fuse-exfat.git/commitdiff
Add debian/patches/fix-fuse-read-write-return-r336.patch Fixes "Operation not permitt...
authorSven Hoexter <sven@stormbind.net>
Fri, 25 Jan 2013 21:17:29 +0000 (22:17 +0100)
committerSven Hoexter <sven@stormbind.net>
Fri, 25 Jan 2013 21:41:18 +0000 (22:41 +0100)
debian/changelog
debian/patches/fix-fuse-read-write-return-r336.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]

index 3cbb27677c1be66d87f9ffac3a5c61616a446412..09027d93a892d2681a83229743123ba194ea5f7e 100644 (file)
@@ -1,6 +1,8 @@
 fuse-exfat (1.0.0-2) UNRELEASED; urgency=low
 
   * Build depend on quilt, use dh --with quilt.
+  * Add debian/patches/fix-fuse-read-write-return-r336.patch
+    Fixes "Operation not permitted" error reporting on empty files.
 
  -- Sven Hoexter <hoexter@debian.org>  Fri, 25 Jan 2013 21:53:16 +0100
 
diff --git a/debian/patches/fix-fuse-read-write-return-r336.patch b/debian/patches/fix-fuse-read-write-return-r336.patch
new file mode 100644 (file)
index 0000000..045933e
--- /dev/null
@@ -0,0 +1,52 @@
+Fixed "Operation not permitted" error on reading an empty file: FUSE read/write
+ops should return a number of bytes actually read/written or -errno on error.
+Picked from upstream svn r336.
+Index: fuse/main.c
+===================================================================
+--- fuse/main.c.orig   2013-01-25 22:09:08.293124286 +0100
++++ fuse/main.c        2013-01-25 22:10:19.745121679 +0100
+@@ -155,19 +155,25 @@
+ static int fuse_exfat_read(const char* path, char* buffer, size_t size,
+               off_t offset, struct fuse_file_info* fi)
+ {
++      ssize_t ret;
++
+       exfat_debug("[%s] %s (%zu bytes)", __func__, path, size);
+-      if (exfat_generic_pread(&ef, get_node(fi), buffer, size, offset) != size)
+-              return EOF;
+-      return size;
++      ret = exfat_generic_pread(&ef, get_node(fi), buffer, size, offset);
++      if (ret < 0)
++              return -EIO;
++      return ret;
+ }
+ static int fuse_exfat_write(const char* path, const char* buffer, size_t size,
+               off_t offset, struct fuse_file_info* fi)
+ {
++      ssize_t ret;
++
+       exfat_debug("[%s] %s (%zu bytes)", __func__, path, size);
+-      if (exfat_generic_pwrite(&ef, get_node(fi), buffer, size, offset) != size)
+-              return EOF;
+-      return size;
++      ret = exfat_generic_pwrite(&ef, get_node(fi), buffer, size, offset);
++      if (ret < 0)
++              return -EIO;
++      return ret;
+ }
+ static int fuse_exfat_unlink(const char* path)
+Index: libexfat/io.c
+===================================================================
+--- libexfat/io.c.orig 2013-01-25 22:09:08.293124286 +0100
++++ libexfat/io.c      2013-01-25 22:10:19.745121679 +0100
+@@ -341,7 +341,7 @@
+       }
+       if (!ef->ro && !ef->noatime)
+               exfat_update_atime(node);
+-      return size - remainder;
++      return MIN(size, node->size - offset) - remainder;
+ }
+ ssize_t exfat_generic_pwrite(struct exfat* ef, struct exfat_node* node,
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..171ad0e
--- /dev/null
@@ -0,0 +1,2 @@
+fix-fuse-read-write-return-r336.patch -p0
+fix-unexpected-removal-on-dir-move-r337.patch -p0