bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fwrite_unlocked problem? [Re: mv does incomplete move without warning


From: Jim Meyering
Subject: fwrite_unlocked problem? [Re: mv does incomplete move without warning
Date: Sat, 23 Feb 2002 09:51:08 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.2.50 (i686-pc-linux-gnu)

Adam Duck <address@hidden> wrote:
> Hi, I'm using RedHat Linux 7.3 with
> $> rpm -q fileutils
> fileutils-4.1-4
>
> Today I moved a file from an ext3-partition to a fat32 one. The Problem
> was that there wasn't enough diskspace on the fat32-partition. `mv'
> moved it, truncated the file and didn't signal any errors. Of course,
> it deleted the file from my ext3-partition ;-(.
>
> I have found this thread in geocrawler, but it only says something
> about NFS, not fat32 ...
>
> http://www.geocrawler.com/mail/thread.php3?subject=Fileutils+2.1+-+corrupt+files+on+NFS+filesystems&list=379
>
> So, is this a bug or a "feature"? Or can't you simply do anything
> about it because of the partition being fat32?

[sorry, this got a bit long]

Thanks for the report.
I am unable to reproduce it using the 2.4.17 kernel, mv-4.1,
and a file system I just created on a floppy disk:

  # mkdosfs -F 32 /dev/fd0
  mkdosfs 2.8 (28 Feb 2001)
  # mkdir /tmp/fat
  # mount -t vfat /dev/fd0 /tmp/fat
  # head --bytes=2m < /dev/zero > /tmp/2meg
  # mv /tmp/2meg /tmp/fat
  mv: writing `/tmp/fat/2meg': No space left on device
  [Exit 1]

I'm not sure what changes are in RedHat's fileutils-4.1-4.
You may want to try the latest test release:

  ftp://alpha.gnu.org/gnu/fetish/fileutils-4.1.5.tar.gz

Could this be a problem with the FAT support in your kernel?
Or maybe it's a problem with FAT only on scsi or ide disks.

You might be able to tell which by running the mv command under strace
and/or ltrace.

  strace -o mv-log mv big-file /fat/partition
  ltrace -S -o mv-log2 mv big-file /fat/partition

Then please send me the `mv-log*' files.

BTW, I did notice a minor problem in that this command doesn't
report the system error (No space left on device) as it should:

  # ltrace -S -o log ./head --bytes=2m < /dev/zero > /tmp/fat/too-big
  ./head: write error

Here's a snippet of the log that appears to show fwrite_unlocked
returning 512, even though the underlying SYS_write failed:

  [all SYS_write calls before this succeeded]

  fwrite_unlocked(0xbfffec40, 1, 4096, 0x4013b380, 0 <unfinished ...>
  SYS_write(1, "", 512)                             = 512
  SYS_write(1, "", 3584)                            = 3584
  <... fwrite_unlocked resumed> )                   = 4096
  read(0,  <unfinished ...>
  SYS_read(0, "", 4096)                             = 4096
  <... read resumed> "", 4096)                      = 4096
  fwrite_unlocked(0xbfffec40, 1, 4096, 0x4013b380, 0 <unfinished ...>
  SYS_write(1, "", 512)                             = 512
  SYS_write(1, "", 3584)                            = -28
  <... fwrite_unlocked resumed> )                   = 512
  read(0,  <unfinished ...>
  SYS_read(0, "", 4096)                             = 4096
  <... read resumed> "", 4096)                      = 4096

  [all SYS_write calls (to stdout) after this failed]

I haven't investigated, so don't know if this is a problem with
the GNU C library (I'm using libc-2.2.5) or with the underlying kernel.
I've Cc'd the libc list.
If this is a kernel problem, would you please forward this to them?

Jim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]