Date: Fri, 4 Jan 2013 03:43:57 GMT From: Eric Krausser <eric@krausser-edv.de> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/174960: sysutils/fusefs-ntfs mkntfs fails because of "no block device" Message-ID: <201301040343.r043hvSv085182@red.freebsd.org> Resent-Message-ID: <201301040350.r043o03R096043@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 174960 >Category: ports >Synopsis: sysutils/fusefs-ntfs mkntfs fails because of "no block device" >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 04 03:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Eric Krausser >Release: 9.1-RELEASE amd64 >Organization: private >Environment: FreeBSD schleppi.local 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Formatting a device with mkntfs fails, because "no block device" given. Please check ports/144852 This issue in sysutils/ntfsprogs is also valid for sysutils/fusefs-ntfs 2012.1.15, but in sysutils/ntfsprogs it's fixed with the appending patch. I guess more fixes and features from sysutils/ntfsprogs could be applied to improve sysutils/fusefs-ntfs, so sysutils/ntfsprogs should be obsolete. >How-To-Repeat: 1) install sysutils/fusefs-ntfs and load fuse.ko with /usr/local/etc/rc.d/fusefs onestart 2) create a device, e.g. "mdconfig -a -t malloc -s 16m -u 123" 3) try to format device with NTFS "mkntfs /dev/md123 /mnt/ntfs", it fails >Fix: copy the patch from /ports/sysutils/ntfsprogs/files/patch-ntfsprogs-mkntfs.c to /ports/sysutils/fusefs-ntfs/files/patch-ntfsprogs-mkntfs.c and reinstall the port sysutils/fusefs-ntfs Patch attached with submission follows: --- ntfsprogs/mkntfs.c 2007-09-19 18:51:09.000000000 +0200 +++ ntfsprogs/mkntfs.c 2010-03-16 17:26:42.000000000 +0100 @@ -552,12 +552,16 @@ total = 0LL; retry = 0; do { - bytes_written = dev->d_ops->write(dev, b, count); + bytes_written = (long long)dev->d_ops->write(dev, b, count); if (bytes_written == -1LL) { retry = errno; ntfs_log_perror("Error writing to %s", dev->d_name); errno = retry; return bytes_written; + } else if (bytes_written < 0) { + errno = EINVAL; + ntfs_log_error("Failed to write to device %s.\n", dev->d_name); + return -1; } else if (!bytes_written) { retry++; } else { @@ -3072,8 +3076,8 @@ goto done; } - if (!S_ISBLK(sbuf.st_mode)) { - ntfs_log_error("%s is not a block device.\n", vol->dev->d_name); + if (!S_ISCHR(sbuf.st_mode)) { + ntfs_log_error("%s is not a character device.\n", vol->dev->d_name); if (!opts.force) { ntfs_log_error("Refusing to make a filesystem here!\n"); goto done; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301040343.r043hvSv085182>