2007-12-14 16:56:12

by Jean-Marc Saffroy

[permalink] [raw]
Subject: fsx failure on ufs2

Hello,

For an embedded system, I'm currently evaluating the robustness of ufs2
write support on Linux, and my very first test, with fsx, shows serious
problems.

My test bed is a single CPU PC with a single IDE disk, that boots FreeBSD
6.2 and Ubuntu 7.10. The kernel on Ubuntu is a vanilla 2.6.23.9 with UFS2
write support. fsx is from the freebsd cvs (with a small patch to build on
Linux, see after my sig):
http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/fsx/

The test is as follows:

# mount -t ufs -o ufstype=ufs2 /dev/sda10 /mnt
(Yes, /dev/sda but it's really IDE.)

$ ./fsx -c100 -N 100000 /mnt/test_fsx

fsx exits in error, after producing the following files:

-rw-r--r-- 1 foo foo 196256 2007-12-14 16:56 test_fsx
-rw-r--r-- 1 foo foo 196256 2007-12-14 16:56 test_fsx.fsxgood
-rw-r--r-- 1 foo foo 63167 2007-12-14 16:56 test_fsx.fsxlog

The file test_fsx.fsxgood contains what fsx expected to be in test_fsx;
the files differ only in the last 4K chunk (it seems there should be only
zeroes, but it's not so).

There does not seem to be any problem with ext3.

Can anyone else confirm this problem?


Cheers,

--
Jean-Marc Saffroy - Silicomp / Orange Business Services
mailto:[email protected]

Trivial patch for fsx.

diff -r 6888f21e18de -r 1aa7894fc4f8 fsx.c
--- a/fsx.c Thu Dec 13 17:51:02 2007 +0100
+++ b/fsx.c Thu Dec 13 17:52:08 2007 +0100
@@ -61,6 +61,8 @@
#include <unistd.h>
#include <stdarg.h>
#include <errno.h>
+#include <stdint.h>
+#include <time.h>

#define NUMPRINTCOLUMNS 32 /* # columns of data to print on each line */


2007-12-16 21:11:49

by Evgeniy Dushistov

[permalink] [raw]
Subject: Re: fsx failure on ufs2

On Fri, Dec 14, 2007 at 05:21:31PM +0100, Jean-Marc Saffroy wrote:
> For an embedded system, I'm currently evaluating the robustness of ufs2
> write support on Linux, and my very first test, with fsx, shows serious
> problems.
>
> My test bed is a single CPU PC with a single IDE disk, that boots FreeBSD
> 6.2 and Ubuntu 7.10. The kernel on Ubuntu is a vanilla 2.6.23.9 with UFS2
> write support. fsx is from the freebsd cvs (with a small patch to build on
> Linux, see after my sig):
> http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/fsx/
>

I used fsx-linux.c from ext3-tools project, but ran it with
different options.

>
> Can anyone else confirm this problem?
>
Using your options I am able to reproduce this bug.
Looks like problem in ufs_alloc_lastblock, last page in file
contains zeros, but because of ufs_readpage, it can be contains
garbage. I will look at next week how it can be fixed.

--
/Evgeniy

2008-01-02 20:56:28

by Evgeniy Dushistov

[permalink] [raw]
Subject: Re: fsx failure on ufs2

Hi, sorry for delay.

On Fri, Dec 14, 2007 at 05:21:31PM +0100, Jean-Marc Saffroy wrote:
> For an embedded system, I'm currently evaluating the robustness of ufs2
> write support on Linux, and my very first test, with fsx, shows serious
> problems.
>
> My test bed is a single CPU PC with a single IDE disk, that boots FreeBSD
> 6.2 and Ubuntu 7.10. The kernel on Ubuntu is a vanilla 2.6.23.9 with UFS2
> write support. fsx is from the freebsd cvs (with a small patch to build on
> Linux, see after my sig):
> http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/fsx/
>

Can you try this patch (see attachment)?

--
/Evgeniy


Attachments:
(No filename) (639.00 B)
ufs_truncate_zero_fix.patch (2.48 kB)
Download all attachments