linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jaegeuk Kim <jaegeuk.kim@gmail.com>, util-linux@vger.kernel.org
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>,
	Martin Steigerwald <Martin@lichtvoll.de>,
	linux-kernel@vger.kernel.org,
	Jaegeuk Kim <jaegeuk.kim@samsung.com>,
	linux-fsdevel@vger.kernel.org, gregkh@linuxfoundation.org,
	viro@zeniv.linux.org.uk, arnd@arndb.de, tytso@mit.edu,
	chur.lee@samsung.com, cm224.lee@samsung.com,
	jooyoung.hwang@samsung.com
Subject: util-linux bug: was Re: [PATCH 00/16 v3] f2fs: introduce flash-friendly file system
Date: Fri, 23 Nov 2012 11:23:09 +1100	[thread overview]
Message-ID: <20121123112309.52429ceb@notabene.brown> (raw)
In-Reply-To: <1352634168.1893.9.camel@kjgkr>

[-- Attachment #1: Type: text/plain, Size: 2945 bytes --]

On Sun, 11 Nov 2012 20:42:48 +0900 Jaegeuk Kim <jaegeuk.kim@gmail.com> wrote:

> 2012-11-11 (일), 00:55 +0300, Vyacheslav Dubeyko:
> > Hi,
> > 
> > On Nov 10, 2012, at 9:33 PM, Martin Steigerwald wrote:
> > 
> > [snip]
> > > 
> > > merkaba:~> mkfs.f2fs /dev/sdb1
> > > Info: sector size = 512
> > > Info: total sectors = 4093951 (in 512bytes)
> > > Info: zone aligned segment0 blkaddr: 256
> > > Info: This device doesn't support TRIM
> > > Info: format successful
> > > merkaba:~> mount /dev/sdb1 /mnt/zeit
> > > mount: you must specify the filesystem type
> > > merkaba:~#32> mount -t f2fs /dev/sdb1 /mnt/zeit
> > > merkaba:~> df -hT /mnt/zeit
> > > Dateisystem    Typ  Größe Benutzt Verf. Verw% Eingehängt auf
> > > /dev/sdb1      f2fs  2,0G    147M  1,8G    8% /mnt/zeit
> > > 
> > 
> > Do you really have trouble with f2fs mount without definition of filesystem type? If so, it is a bug.
> 
> Could you explain this bug in mor)e detail?
> Or, can anyone comment this?
> 
> Actually, I've looking at the *mount* in linux-utils.
> I suspect something does not support f2fs in linux-utils.
> 

This is a bug in util-linux.

If 'blkid' doesn't recognise the filesystem, mount reads /etc/filesystems
and tries everything listed there.  If that file ends with a '*', it should
read /proc/filesystems and try everything else listed that (that doesn't
start with 'nodev').

However it currently ignores the '*' and just adds everything
from /proc/filesystems.  So the list it uses will have a '*' in the
middle, which will be before 'f2fs' appears.

When it tries each filesystem type in turn, it will abort if it get any error
other than EINVAL.
When it tries with filesystem type '*' it gets 'ENODEV' and so gives up.

The following patch (against git://github.com/karelzak/util-linux.git) fixes
it for me,  though I suspect it should possible ignore 'ENODEV' too -
otherwise if /etc/filesystems contains an invalid filesystem name, it will
silently ignore all others.

As a quick hack, just add 'f2fs' to /etc/filesystems

NeilBrown



Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index 624633d..054f266 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -462,6 +462,10 @@ static int get_filesystems(const char *filename, char ***filesystems, const char
 			continue;
 		if (sscanf(line, " %128[^\n ]\n", name) != 1)
 			continue;
+		if (strcmp(name, "*") == 0) {
+			rc = 1;	
+			break;
+		}
 		if (pattern && !mnt_match_fstype(name, pattern))
 			continue;
 		rc = add_filesystem(filesystems, name);
@@ -486,7 +490,7 @@ int mnt_get_filesystems(char ***filesystems, const char *pattern)
 	*filesystems = NULL;
 
 	rc = get_filesystems(_PATH_FILESYSTEMS, filesystems, pattern);
-	if (rc)
+	if (rc != 1)
 		return rc;
 	return get_filesystems(_PATH_PROC_FILESYSTEMS, filesystems, pattern);
 }

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  parent reply	other threads:[~2012-11-23  0:23 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31  9:35 [PATCH 00/16 v3] f2fs: introduce flash-friendly file system Jaegeuk Kim
2012-10-31  9:38 ` [PATCH 01/17] f2fs: add document Jaegeuk Kim
2012-10-31  9:39 ` [PATCH 02/17] f2fs: add on-disk layout Jaegeuk Kim
2012-10-31  9:41 ` [PATCH 03/17] f2fs: add superblock and major in-memory structure Jaegeuk Kim
2012-10-31  9:58   ` [PATCH 03/17 v2] " Jaegeuk Kim
2012-10-31 22:53     ` [PATCH 03/17 v3] " Jaegeuk Kim
2012-10-31  9:41 ` [PATCH 04/17] f2fs: add super block operations Jaegeuk Kim
2012-10-31  9:43 ` [PATCH 05/17] f2fs: add checkpoint operations Jaegeuk Kim
2012-10-31  9:44 ` [PATCH 06/17] f2fs: add node operations Jaegeuk Kim
2012-10-31  9:44 ` [PATCH 08/17] f2fs: add file operations Jaegeuk Kim
2012-10-31  9:45 ` [PATCH 09/17] f2fs: add address space operations for data Jaegeuk Kim
2012-10-31  9:46 ` [PATCH 10/17] f2fs: add core inode operations Jaegeuk Kim
2012-10-31  9:47 ` [PATCH 11/17] f2fs: add inode operations for special inodes Jaegeuk Kim
2012-10-31  9:47 ` [PATCH 12/17] f2fs: add core directory operations Jaegeuk Kim
2012-10-31  9:48 ` [PATCH 13/17] f2fs: add xattr and acl functionalities Jaegeuk Kim
2012-10-31  9:48 ` [PATCH 14/17] f2fs: add garbage collection functions Jaegeuk Kim
2012-10-31  9:48 ` [PATCH 15/17] f2fs: add recovery routines for roll-forward Jaegeuk Kim
2012-10-31  9:49 ` [PATCH 16/17] f2fs: move proc files to debugfs Jaegeuk Kim
2012-10-31 15:51   ` Greg KH
2012-10-31 21:48     ` Jaegeuk Kim
2012-10-31 22:38       ` [PATCH 16/17 v2] " Jaegeuk Kim
2012-10-31 22:50         ` 'Greg KH'
2012-10-31  9:50 ` [PATCH 17/17] f2fs: update Kconfig and Makefile Jaegeuk Kim
2012-10-31  9:56 ` [PATCH 07/17] f2fs: add segment operations Jaegeuk Kim
2012-11-02 13:39 ` [PATCH 00/16 v3] f2fs: introduce flash-friendly file system Martin Steigerwald
2012-11-02 22:49   ` Kim Jaegeuk
2012-11-10 18:33     ` Martin Steigerwald
2012-11-10 18:40       ` Martin Steigerwald
2012-11-10 21:49       ` Arnd Bergmann
2012-11-12 15:16         ` Martin Steigerwald
2012-11-12 16:57           ` Arnd Bergmann
2012-11-14 15:57             ` Martin Steigerwald
2012-11-16 21:26               ` Arnd Bergmann
2012-11-10 21:55       ` Vyacheslav Dubeyko
2012-11-11 11:42         ` Jaegeuk Kim
2012-11-12  6:04           ` Vyacheslav Dubeyko
2012-11-23  0:23           ` NeilBrown [this message]
     [not found]             ` <20121123112309.52429ceb-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2012-11-26 13:27               ` util-linux bug: was " Karel Zak
     [not found]                 ` <20121126132700.GA28200-s5vVilr7EKH/9pzu0YdTqQ@public.gmane.org>
2012-11-26 21:06                   ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121123112309.52429ceb@notabene.brown \
    --to=neilb@suse.de \
    --cc=Martin@lichtvoll.de \
    --cc=arnd@arndb.de \
    --cc=chur.lee@samsung.com \
    --cc=cm224.lee@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaegeuk.kim@gmail.com \
    --cc=jaegeuk.kim@samsung.com \
    --cc=jooyoung.hwang@samsung.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    --cc=tytso@mit.edu \
    --cc=util-linux@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).