All of lore.kernel.org
 help / color / mirror / Atom feed
* Floppy disk strange behavior
@ 2001-01-09 20:33 Mathieu Chouquet-Stringer
  2001-01-09 21:22 ` Alexander Viro
  0 siblings, 1 reply; 7+ messages in thread
From: Mathieu Chouquet-Stringer @ 2001-01-09 20:33 UTC (permalink / raw)
  To: linux-kernel

	
	Hi!

I have switched a long time ago to linux-2.4 (and even 2.3 series) and I
have a wierd problem.
I use GRUB to boot my system. Basically, when you want to install GRUB on a
floppy disk, you do that:

dd if=stage1 of=/dev/fd0 bs=512 count=1
dd if=stage2 of=/dev/fd0 bs=512 seek=1

But since kernel 2.3.xx (I don't remember exactly), I got this error
message when I try to do the second dd (even as root):
dd: advancing past 1 blocks in output file `/dev/fd0': Permission denied

And this thing works properly when under 2.2.xx...

I try to look a the diff of floppy.c between 2.2.18 and 2.4.0 but at this
time, I didn't find anything...
-- 
Mathieu CHOUQUET-STRINGER              E-Mail : mchouque@e-steel.com
     Learning French is trivial: the word for horse is cheval, and
               everything else follows in the same way.
                        -- Alan J. Perlis
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Floppy disk strange behavior
@ 2001-01-09 23:03 Andries.Brouwer
  0 siblings, 0 replies; 7+ messages in thread
From: Andries.Brouwer @ 2001-01-09 23:03 UTC (permalink / raw)
  To: mchouque, viro; +Cc: linux-kernel

>> dd: advancing past 1 blocks in output file `/dev/fd0': Permission denied

> dd bug. It tries to ftruncate() the output file and gets all upset when
> kernel refuses to truncate a block device (surprise, surprise).

Yes. But EPERM means that something is wrong with privileges.
One would expect EINVAL or so when something is wrong with the
way the routine was called.

Let me find my docs :-)

===== austin - d5 ============================================
...
If fildes refers to a regular file, the ftruncate( ) function shall cause
the size of the file to be truncated to length. If the size of the file
previously exceeded length, the extra data shall no longer be available
to reads on the file. If the file previously was smaller than this size,
ftruncate( ) shall either increase the size of the file or fail.
XSI-conformant systems shall increase the size of the file.
If the file size is increased, the extended area shall appear as if it
were zero-filled. The value of the seek pointer shall not be modified
by a call to ftruncate( ).
...
If fildes refers to a directory, ftruncate( ) shall fail.
...
If fildes refers to any other file type, except a shared memory object,
the result is unspecified.
=============================================================

No info on errors here.

===== Digital Unix man ======================================
...
The path parameter must point to a pathname which names
a regular file for which the calling process has write permission.
...
[EINVAL] The file is not a regular file
=============================================================

So, as was to be expected, other systems use EINVAL in this
situation, and so should we.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-01-09 23:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-09 20:33 Floppy disk strange behavior Mathieu Chouquet-Stringer
2001-01-09 21:22 ` Alexander Viro
2001-01-09 21:37   ` Alan Cox
2001-01-09 21:57     ` Alexander Viro
2001-01-09 22:44       ` Mathieu Chouquet-Stringer
2001-01-09 23:20       ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2001-01-09 23:03 Andries.Brouwer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.