util-linux.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 --]

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <003d01cdb74b$0c3fa420$24beec60$%kim@samsung.com>
     [not found] ` <201211021439.02797.Martin@lichtvoll.de>
     [not found]   ` <CAOtxgye-sqJFe17EyfJQ0RrMwQqsPbDv5m+4cJT0BjnRnGv56w@mail.gmail.com>
     [not found]     ` <201211101933.38434.Martin@lichtvoll.de>
     [not found]       ` <8A3372F6-6294-404E-909B-3FDE0C2368B7@dubeyko.com>
     [not found]         ` <1352634168.1893.9.camel@kjgkr>
2012-11-23  0:23           ` NeilBrown [this message]
2012-11-26 13:27             ` util-linux bug: was Re: [PATCH 00/16 v3] f2fs: introduce flash-friendly file system Karel Zak
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).