From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vyacheslav Dubeyko Subject: [PATCH v2 06/15] hfsplus: fix remount issue Date: Fri, 24 Jan 2014 19:27:00 +0400 Message-ID: <1390577220.2287.80.camel@slavad-ubuntu-12.04> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Al Viro , ChristophHellwig , Hin-Tak Leung , Andrew Morton To: Linux FS devel list Return-path: Received: from gproxy4-pub.mail.unifiedlayer.com ([69.89.23.142]:42168 "HELO gproxy4-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752525AbaAXP1I (ORCPT ); Fri, 24 Jan 2014 10:27:08 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Vyacheslav Dubeyko Subject: [PATCH v2 06/15] hfsplus: fix remount issue Current implementation of HFS+ driver has small issue with remount option. Namely, for example, you are unable to remount from RO mode into RW mode by means of command "mount -o remount,rw /dev/loop0 /mnt/hfsplus". Trying to execute sequence of commands is resulted with error message: mount /dev/loop0 /mnt/hfsplus mount -o remount,ro /dev/loop0 /mnt/hfsplus mount -o remount,rw /dev/loop0 /mnt/hfsplus mount: you must specify the filesystem type mount -t hfsplus -o remount,rw /dev/loop0 /mnt/hfsplus mount: /mnt/hfsplus not mounted or bad option The reason of such issue is failure of mount syscall: mount("/dev/loop0", "/mnt/hfsplus", 0x2282a60, MS_MGC_VAL|MS_REMOUNT, NULL) = -1 EINVAL (Invalid argument) Namely, hfsplus_parse_options_remount() method receives empty "input" argument and return false in such case. As a result, hfsplus_remount() returns -EINVAL error code. This patch fixes the issue by means of return true for the case of empty "input" argument in hfsplus_parse_options_remount() method. Signed-off-by: Vyacheslav Dubeyko CC: Al Viro CC: Christoph Hellwig CC: Hin-Tak Leung --- fs/hfsplus/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c index 4ad835e..60829cd 100644 --- a/fs/hfsplus/options.c +++ b/fs/hfsplus/options.c @@ -76,7 +76,7 @@ int hfsplus_parse_options_remount(char *input, struct hfsplus_sb_info *sbi) int token; if (!input) - return 0; + return 1; while ((p = strsep(&input, ",")) != NULL) { if (!*p) -- 1.7.9.5