From patchwork Mon Oct 1 03:04:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosy Song X-Patchwork-Id: 977007 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rosinson.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IaI4WdnF"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42NnFg04fPz9s3x for ; Mon, 1 Oct 2018 13:04:54 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=RhQqIe/w9suMojcRXtKs9Z5cfdg6pNAKktoHztDL624=; b=IaI4WdnF57IHNX nkvVFz02aLj2yd4m+59EK1qlPyPaegGPfNdfp5cObrjecAQ1YX2w1dV11+flR57ZwtVLDivT+/tWp EF77s6zRiVMVOMl4nYkbCHTqF7Cj26L1ch7s+TITK54qQ9v2GHvVPwehEAiyKP0ZnzIeBZgYIbL9q eAW379zpFzKB3PIHU9PabWufOEDnTdws5igAtbi6NNR0KJj/Lsg3VnX7aKaSHiuHAcOmyuDp9im1F 4zfzy5CvebBtoKCTYBhjG9ppNtbBKx4UjDvZZ24sW/JMSt6PR5gSTjMgmTrd6EhXhwwF2CHtVRw8N 0CfNQq/4WppXkrUVpffA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g6oVn-0008Lh-Ov; Mon, 01 Oct 2018 03:04:43 +0000 Received: from out20-111.mail.aliyun.com ([115.124.20.111]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g6oVk-0008KM-Cx for openwrt-devel@lists.openwrt.org; Mon, 01 Oct 2018 03:04:42 +0000 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.08464203|-1; CH=green; FP=10374013540367967347|1|1|1|0|-1|-1|-1; HT=e02c03299; MF=rosysong@rosinson.com; NM=1; PH=DS; RN=2; RT=2; SR=0; TI=SMTPD_---.Cy4.-oT_1538363056; Received: from banglang-PC.lan(mailfrom:rosysong@rosinson.com fp:SMTPD_---.Cy4.-oT_1538363056) by smtp.aliyun-inc.com(10.147.41.121); Mon, 01 Oct 2018 11:04:16 +0800 From: Rosy Song To: openwrt-devel@lists.openwrt.org Date: Mon, 1 Oct 2018 11:04:13 +0800 Message-Id: <20181001030413.5053-1-rosysong@rosinson.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180930_200440_689021_B28F731A X-CRM114-Status: UNSURE ( 6.32 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [115.124.20.111 listed in list.dnswl.org] 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Subject: [OpenWrt-Devel] [PATCH, V2] fstools: mount ntfs with ntfs-3g utility if it exist X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rosy Song MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Rosy Song Signed-off-by: Rosy Song --- block.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 2651c86..b2cd32b 100644 --- a/block.c +++ b/block.c @@ -881,7 +881,13 @@ static int handle_mount(const char *source, const char *target, size_t mount_opts_len; char *mount_opts = NULL, *ptr; - err = mount(source, target, fstype, m ? m->flags : 0, + /* Mount ntfs filesystem with ntfs-3g utility */ + if (!strcmp(fstype, "ntfs") && + !access("/sbin/mount.ntfs-3g", X_OK)) { + 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,