Debian Bug report logs - #635173
ufsutils: mkfs.ufs and libufs not functional under standard Linux: "could not find special device"

version graph

Package: ufsutils; Maintainer for ufsutils is GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>; Source for ufsutils is src:ufsutils.

Reported by: Elie De Brauwer <eliedebrauwer@gmail.com>

Date: Sat, 23 Jul 2011 11:54:53 UTC

Severity: important

Tags: d-i

Found in version ufsutils/8.2-1

Fixed in version 8.2-2

Done: Aurelien Jarno <aurelien@aurel32.net>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#635173; Package ufsutils. (Sat, 23 Jul 2011 11:54:56 GMT) Full text and rfc822 format available.

Acknowledgement sent to Elie De Brauwer <eliedebrauwer@gmail.com>:
New Bug report received and forwarded. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Sat, 23 Jul 2011 11:55:07 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Elie De Brauwer <eliedebrauwer@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: ufsutils: mkfs.ufs and libufs not functional under standard Linux: "could not find special device"
Date: Sat, 23 Jul 2011 13:53:42 +0200
Package: ufsutils
Version: 8.2-1
Severity: important

ufsutils version 7.1-2 exposed a similar bug which was reported/fixed in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526586  and the problem I am
experiencing is very closely related (if not exactly the same).

Let's create a blockdevice to get started with:


edb@lapedb:~$ sudo modprobe rd
edb@lapedb:~$ ls -hal /dev/ram0
brw-rw---- 1 root disk 1, 0 Jul 23 13:35 /dev/ram0

This gives us the following behavior:



edb@lapedb:~$ sudo mkfs.ufs  -O 2 -J -N  /dev/sdb5
mkfs.ufs: /dev/sdb5: could not find special device
edb@lapedb:~$ sudo ffsinfo /dev/ram0
ffsinfo: ufs_disk_fillout(/dev/ram0) failed: could not find special device:
Success
edb@lapedb:~$ sudo dumpfs.ufs /dev/ram0
dumpfs.ufs: /dev/ram0: could not find special device


A clear pattern is emerging.

When looking at an strace, we can clearly see it fails after a stat (and after
reading /etc/fstab):

stat64("/dev/sdb5", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 21), ...}) = 0
brk(0)                                  = 0x920d000
brk(0x922f000)                          = 0x922f000
open("/etc/fstab", O_RDONLY)            = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=665, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb776b000
read(3, "# /etc/fstab: static file system"..., 4096) = 665
read(3, "", 4096)                       = 0
write(2, "mkfs.ufs: ", 10mkfs.ufs: )              = 10
write(2, "/dev/sdb5: could not find specia"..., 40/dev/sdb5: could not find
special device) = 40
write(2, "\n", 1
)                       = 1
exit_group(1)                           = ?


After apt-get source ufsutils and running a make (btw I need to specify
CC=gcc-4.4 since gcc-4.6.1 is complaining a lot and even then I need to comment
some things out to build and link properly). Then a gdb shows the following
(after a breakpoint in stat):

(gdb)
0x0804f0ec in stat ()
(gdb) n
Single stepping until exit from function stat,
which has no line number information.
ufs_disk_fillout_blank (disk=0x8054ce0, name=0xbffffe15 "/dev/sdb5") at
type.c:111
111             if (ret >= 0 && S_ISREG(st.st_mode)) {
(gdb) print name
$1 = 0xbffffe15 "/dev/sdb5"
(gdb) print st
$2 = {st_dev = 5, __pad1 = 0, st_ino = 218104, st_mode = 25008, st_nlink = 1,
st_uid = 0, st_gid = 25, st_rdev = 2069, __pad2 = 0,
  st_size = 0, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec =
1311416552, tv_nsec = 146218743}, st_mtim = {
    tv_sec = 1311416552, tv_nsec = 146218743}, st_ctim = {tv_sec = 1311416552,
tv_nsec = 146218743}, __unused4 = 0, __unused5 = 0}
(gdb) s
117             } else if ((fs = getfsfile(name)) != NULL) {
(gdb) n
128             } else if (ret >= 0 && S_ISDIR(st.st_mode)) {
(gdb) quit


But this again points to type.c and near line 114 this shows:

 } else if (ret >= 0 && (S_ISCHR(st.st_mode) && S_ISBLK(st.st_mode))

(which is already a debian specific patch (ref
ufsutils-8.2/debian/patches/01_libufs.patch) which contains the following:

-       } else if (ret >= 0 && S_ISCHR(st.st_mode)) {
+       } else if (ret >= 0 && (S_ISCHR(st.st_mode) && S_ISBLK(st.st_mode))) {
                /* This is what we need, do nothing. */
                ;

However, as far as my humble knowledge goes, I don't see how a /dev entry can
be both a character _and_ a block device (hence a logical || instead of a &&
might be more suitable in that patch).

For my local testing I just hacked the following in there (which works for me,
but probably fails on *BSD, judging form the previous bugreport).

        } else if (ret >= 0 && (S_ISBLK(st.st_mode))) {
                /* This is what we need, do nothing. */
                ;

And when I rebuild this and test this locally, then everybody is happy:

lapedb:/tmp/ufsutils-8.2# ./sbin/newfs/mkfs.ufs /dev/ram0
/dev/ram0: 8.0MB (16384 sectors) block size 16384, fragment size 2048
        using 4 cylinder groups of 2.02MB, 129 blks, 320 inodes.
super-block backups (for fsck -b #) at:
 160, 4288, 8416, 12544


my 2 cents
E.




-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.39-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages ufsutils depends on:
ii  libbsd0                  0.3.0-1         utility functions from BSD systems
ii  libc6                    2.13-10         Embedded GNU C Library: Shared lib
ii  libedit2                 2.11-20080614-2 BSD editline and history libraries

ufsutils recommends no packages.

ufsutils suggests no packages.

-- no debconf information




Added tag(s) d-i. Request was from lunar@debian.org to control@bugs.debian.org. (Sat, 23 Jul 2011 17:03:09 GMT) Full text and rfc822 format available.

Reply sent to Aurelien Jarno <aurelien@aurel32.net>:
You have taken responsibility. (Sat, 23 Jul 2011 19:36:06 GMT) Full text and rfc822 format available.

Notification sent to Elie De Brauwer <eliedebrauwer@gmail.com>:
Bug acknowledged by developer. (Sat, 23 Jul 2011 19:36:06 GMT) Full text and rfc822 format available.

Message #12 received at 635173-done@bugs.debian.org (full text, mbox):

From: Aurelien Jarno <aurelien@aurel32.net>
To: Elie De Brauwer <eliedebrauwer@gmail.com>, 635173-done@bugs.debian.org
Subject: Re: Bug#635173: ufsutils: mkfs.ufs and libufs not functional under standard Linux: "could not find special device"
Date: Sat, 23 Jul 2011 21:24:25 +0200
Version: 8.2-2

On Sat, Jul 23, 2011 at 01:53:42PM +0200, Elie De Brauwer wrote:
> Package: ufsutils
> Version: 8.2-1
> Severity: important
> 
> ufsutils version 7.1-2 exposed a similar bug which was reported/fixed in
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526586  and the problem I am
> experiencing is very closely related (if not exactly the same).
> 

This bug has been fixed in version 8.2-2. Closing the bug.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 31 Aug 2011 07:36:15 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 10:55:04 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.