Bug 460265 - sys/mtio.h defines non-existing default tape device
Summary: sys/mtio.h defines non-existing default tape device
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 289381
TreeView+ depends on / blocked
 
Reported: 2008-08-27 07:57 UTC by Dan Horák
Modified: 2008-12-02 14:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-16 05:17:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dan Horák 2008-08-27 07:57:05 UTC
There is a problem with the definition of default tape device for recent Linux systems that are using udev for maintaining device nodes.

from <sys/mtio.h>
...
/* Specify default tape device.  */
#ifndef DEFTAPE
# define DEFTAPE	"/dev/tape"
#endif

On recent systems /dev/tape is a directory, so every application using DEFTAPE throws an error when used without specifying explicit tape device.

references:
https://bugzilla.novell.com/show_bug.cgi?id=355241
https://bugzilla.redhat.com/show_bug.cgi?id=289381

Comment 1 Dan Horák 2008-08-27 07:58:30 UTC
adding Harald as the udev maintainer

Comment 2 Denys Vlasenko 2008-08-27 12:04:02 UTC
There will never be a lasting consensus what is the "correct" default tape dirve name.

On a machine with two or more identical tape drives it's even not nonsensical.

I'd suggest explicitly naming the device you work with.

Comment 3 Harald Hoyer 2008-08-28 10:37:10 UTC
the /dev/tape directory is considered a quasi standard across all distributions, which use the udev standard rule files.

Comment 4 Dan Horák 2008-09-08 13:12:14 UTC
(In reply to comment #2)
> There will never be a lasting consensus what is the "correct" default tape
> dirve name.
> 
> On a machine with two or more identical tape drives it's even not nonsensical.
> 
> I'd suggest explicitly naming the device you work with.

But we want to be consistent across different utilities that are using tapes - mt, mtx, cpio, tar, ...
In the pre-udev times the /dev/tape was a symlink to first tape device found. I think there are two ways out of this
1. find a new name for default tape, let udev create it as a symlink and define it in sys/mtio.h
2. rename the /dev/tape directory in udev to something else and let udev create the /dev/tape as symlink

Comment 5 Denys Vlasenko 2008-09-08 13:28:40 UTC
>But we want to be consistent across different utilities
> that are using tapes - mt, mtx, cpio, tar, ...

Yes. My proposal is to make them complain if tape device name is not explicitly given.

By analogy, cp does not have "default target directory", just "cp /bin/sh" does not work. You have to specify where to copy the file.

These utilities already have options to specify target tape device. For example, mtx [-f <scsi-generic-device>]. Just make them fail if this option is not given.

Just my 0.02 euros

Comment 6 Ulrich Drepper 2008-09-16 05:17:49 UTC
I'm closing this bug.  In glibc I won't make a decision.  Get the appropriate people to agre on a way to locate a default device and then I'll make a change.


Note You need to log in before you can comment on or make changes to this bug.