lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121123112309.52429ceb@notabene.brown>
Date:	Fri, 23 Nov 2012 11:23:09 +1100
From:	NeilBrown <neilb@...e.de>
To:	Jaegeuk Kim <jaegeuk.kim@...il.com>, util-linux@...r.kernel.org
Cc:	Vyacheslav Dubeyko <slava@...eyko.com>,
	Martin Steigerwald <Martin@...htvoll.de>,
	linux-kernel@...r.kernel.org,
	Jaegeuk Kim <jaegeuk.kim@...sung.com>,
	linux-fsdevel@...r.kernel.org, gregkh@...uxfoundation.org,
	viro@...iv.linux.org.uk, arnd@...db.de, tytso@....edu,
	chur.lee@...sung.com, cm224.lee@...sung.com,
	jooyoung.hwang@...sung.com
Subject: util-linux bug: was Re: [PATCH 00/16 v3] f2fs: introduce
 flash-friendly file system

On Sun, 11 Nov 2012 20:42:48 +0900 Jaegeuk Kim <jaegeuk.kim@...il.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@...e.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);
 }

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ