diff mbox series

[OpenWrt-Devel] fstools: mount ntfs with ntfs-3g utility if it exists

Message ID 20180930030404.5589-1-rosysong@rosinson.com
State Rejected
Headers show
Series [OpenWrt-Devel] fstools: mount ntfs with ntfs-3g utility if it exists | expand

Commit Message

Rosy Song Sept. 30, 2018, 3:04 a.m. UTC
From: Rosy Song <rosysong@rosinson.com>
Subject: [OpenWrt-Devel] [PATCH] fstools: mount ntfs with ntfs-3g utility if it exists

This patch can mount ntfs with fuseblk fs type and make the deivces to be
mounted writable.

Comments

Hans Dedecker Sept. 30, 2018, 5:12 p.m. UTC | #1
On Sun, Sep 30, 2018 at 5:05 AM Rosy Song <rosysong@rosinson.com> wrote:
>
> From: Rosy Song <rosysong@rosinson.com>
> Subject: [OpenWrt-Devel] [PATCH] fstools: mount ntfs with ntfs-3g utility if it exists
>
> This patch can mount ntfs with fuseblk fs type and make the deivces to be
> mounted writable.
Did you create the patch via git format-patch ?
The patch is also missing a SoB; please have a look at
https://openwrt.org/submitting-patches

Hans
>
> --- a/block.c
> +++ b/block.c
> @@ -881,7 +881,13 @@ static int handle_mount(const char *sour
>         size_t mount_opts_len;
>         char *mount_opts = NULL, *ptr;
>
> -       err = mount(source, target, fstype, m ? m->flags : 0,
> +       if (!strncmp(fstype, "ntfs", strlen(fstype)) &&
> +           !access("/sbin/mount.ntfs-3g", X_OK)) {
> +           // mount ntfs filesystem with ntfs-3g utility
> +           err = -1;
> +           errno = ENODEV;
> +       } else
> +           err = mount(source, target, fstype, m ? m->flags : 0,
>                     (m && m->options) ? m->options : "");
>
>         /* Requested file system type is not available in kernel,
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Philip Prindeville Sept. 30, 2018, 8:48 p.m. UTC | #2
Comments inline


> On Sep 29, 2018, at 9:04 PM, Rosy Song <rosysong@rosinson.com> wrote:
> 
> From: Rosy Song <rosysong@rosinson.com>
> Subject: [OpenWrt-Devel] [PATCH] fstools: mount ntfs with ntfs-3g utility if it exists
> 
> This patch can mount ntfs with fuseblk fs type and make the deivces to be
> mounted writable.
> 
> --- a/block.c
> +++ b/block.c
> @@ -881,7 +881,13 @@ static int handle_mount(const char *sour
> 	size_t mount_opts_len;
> 	char *mount_opts = NULL, *ptr;
> 
> -	err = mount(source, target, fstype, m ? m->flags : 0,
> +	if (!strncmp(fstype, "ntfs", strlen(fstype)) &&


How is this any different from !strcmp(fstype, “ntfs”) ?


> +	    !access("/sbin/mount.ntfs-3g", X_OK)) {
> +	    // mount ntfs filesystem with ntfs-3g utility
> +	    err = -1;
> +	    errno = ENODEV;
> +	} else
> +	    err = mount(source, target, fstype, m ? m->flags : 0,
> 	            (m && m->options) ? m->options : "");
> 
> 	/* Requested file system type is not available in kernel,
>
diff mbox series

Patch

--- a/block.c
+++ b/block.c
@@ -881,7 +881,13 @@  static int handle_mount(const char *sour
 	size_t mount_opts_len;
 	char *mount_opts = NULL, *ptr;
 
-	err = mount(source, target, fstype, m ? m->flags : 0,
+	if (!strncmp(fstype, "ntfs", strlen(fstype)) &&
+	    !access("/sbin/mount.ntfs-3g", X_OK)) {
+	    // mount ntfs filesystem with ntfs-3g utility
+	    err = -1;
+	    errno = ENODEV;
+	} else
+	    err = mount(source, target, fstype, m ? m->flags : 0,
 	            (m && m->options) ? m->options : "");
 
 	/* Requested file system type is not available in kernel,