NetBSD Problem Report #45605

From gregoire.sutre@gmail.com  Sat Nov 12 13:51:46 2011
Return-Path: <gregoire.sutre@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 42A3563B8A8
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 12 Nov 2011 13:51:46 +0000 (UTC)
Message-Id: <20111112135134.F1EEE362EB@yosemite.localdomain>
Date: Sat, 12 Nov 2011 14:51:34 +0100 (CET)
From: gregoire.sutre@gmail.com
Reply-To: gregoire.sutre@gmail.com
To: gnats-bugs@gnats.NetBSD.org
Subject: Data corruption with NILFS(2)
X-Send-Pr-Version: 3.95

>Number:         45605
>Category:       kern
>Synopsis:       Data corruption when reading a NILFS(2) file system
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    reinoud
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 12 13:55:00 +0000 2011
>Closed-Date:    Wed May 15 19:09:26 +0000 2013
>Last-Modified:  Thu Jun 13 11:00:00 +0000 2013
>Originator:     Gregoire Sutre
>Release:        NetBSD 5.99.56
>Organization:
>Environment:
System: NetBSD yosemite 5.99.56 NetBSD 5.99.56 (GENERIC) #0: Fri Nov 11 17:26:37 CET 2011 sutre@tahoe:/data/sutre/build-amd64/home/sutre/NetBSD/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
I observed data corruption when reading files in a freshly created
NILFS(2) file system, stored on a USB key.  The NILFS(2) file system
was created and populated on a system running Debian GNU/Linux.

>How-To-Repeat:

>> Creation of the file system on Debian GNU/Linux <<

$ /sbin/fdisk -l /dev/sdf

Disk /dev/sdf: 2030 MB, 2030043136 bytes
44 heads, 10 sectors/track, 9011 cylinders, total 3964928 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xda754b80

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1            2048     1026047      512000   83  Linux

$ /sbin/mkfs.nilfs2 /dev/sdf1
mkfs.nilfs2 (nilfs-utils 2.1.0-rc2)
Start writing file system initial data to the device
       Blocksize:4096  Device:/dev/sdf1  Device Size:524288000
File system initialization succeeded !!

$ mount /dev/sdf1 /mnt/disk
$ pushd /mnt/disk
$ dd if=/dev/urandom of=rand.bin bs=2M count=1
$ i=1; while [ "$i" -le "10" ]; do cp -p rand.bin copy-$i.bin; i=$((i+1)); done
$ popd
$ umount /mnt/disk


>> Reading the file system on NetBSD <<

$ mount_nilfs /dev/sd0e /mnt/disk
$ cd /mnt/disk
$ i=1; while [ "$i" -le "10" ]; do cmp rand.bin copy-$i.bin; i=$((i+1)); done
rand.bin copy-1.bin differ: char 2095114, line 8235
rand.bin copy-2.bin differ: char 2095114, line 8235
rand.bin copy-3.bin differ: char 2095114, line 8235
rand.bin copy-4.bin differ: char 2095113, line 8235
rand.bin copy-5.bin differ: char 2095114, line 8235
rand.bin copy-6.bin differ: char 2095114, line 8235
rand.bin copy-7.bin differ: char 2095114, line 8235
rand.bin copy-8.bin differ: char 2095113, line 8235
rand.bin copy-9.bin differ: char 2095113, line 8235
rand.bin copy-10.bin differ: char 2095113, line 8235
$ cd
$ umount /mnt/disk


>> Checking that the file system reads fine on Debian GNU/Linux <<

$ mount /dev/sdf1 /mnt/disk
$ pushd /mnt/disk
$ i=1; while [ "$i" -le "10" ]; do cmp rand.bin copy-$i.bin; i=$((i+1)); done
$ popd
$ umount /mnt/disk


Note: testing with 1M random file (instead of 2M) does not trigger
the problem.

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->reinoud
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sun, 13 Nov 2011 17:30:07 +0000
Responsible-Changed-Why:
Over to nilfs maintainer. (If you can't or don't want to handle it, set it
back.)

I'm not sure to what extent nilfs is expected to actually work right now...


From: "Reinoud Zandijk" <reinoud@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45605 CVS commit: src/sys/fs/nilfs
Date: Wed, 8 May 2013 10:29:22 +0000

 Module Name:	src
 Committed By:	reinoud
 Date:		Wed May  8 10:29:22 UTC 2013

 Modified Files:
 	src/sys/fs/nilfs: nilfs_vnops.c

 Log Message:
 Fix serious file read problem due to not-so-clear VOP_BMAP description. Should
 fix PR 45605.


 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 src/sys/fs/nilfs/nilfs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= <gregoire.sutre@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: Reinoud Zandijk <reinoud@netbsd.org>, gnats-admin@netbsd.org, 
 netbsd-bugs@netbsd.org
Subject: Re: PR/45605 CVS commit: src/sys/fs/nilfs
Date: Wed, 15 May 2013 19:10:42 +0200

 I confirm that the problem is fixed in -current.  Thanks.

State-Changed-From-To: open->closed
State-Changed-By: reinoud@NetBSD.org
State-Changed-When: Wed, 15 May 2013 19:09:26 +0000
State-Changed-Why:
Due to the submitted patch, the corruption seen is fixed. Confirmed by the submitter of the patch.


From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45605 CVS commit: [netbsd-6] src/sys/fs/nilfs
Date: Thu, 13 Jun 2013 06:49:08 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Thu Jun 13 06:49:08 UTC 2013

 Modified Files:
 	src/sys/fs/nilfs [netbsd-6]: nilfs_vnops.c

 Log Message:
 Pull up following revision(s) (requested by reinoud in ticket #894):
 	sys/fs/nilfs/nilfs_vnops.c: revision 1.22-1.23
 Fix serious file read problem due to not-so-clear VOP_BMAP description. Should
 fix PR 45605.


 To generate a diff of this commit:
 cvs rdiff -u -r1.16.6.1 -r1.16.6.2 src/sys/fs/nilfs/nilfs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45605 CVS commit: [netbsd-6-0] src/sys/fs/nilfs
Date: Thu, 13 Jun 2013 10:53:00 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Thu Jun 13 10:53:00 UTC 2013

 Modified Files:
 	src/sys/fs/nilfs [netbsd-6-0]: nilfs_vnops.c

 Log Message:
 Pull up following revision(s) (requested by reinoud in ticket #894):
 	sys/fs/nilfs/nilfs_vnops.c: revision 1.22-1.23
 Fix serious file read problem due to not-so-clear VOP_BMAP description. Should
 fix PR 45605.


 To generate a diff of this commit:
 cvs rdiff -u -r1.16.6.1 -r1.16.6.1.4.1 src/sys/fs/nilfs/nilfs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45605 CVS commit: [netbsd-6-1] src/sys/fs/nilfs
Date: Thu, 13 Jun 2013 10:55:59 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Thu Jun 13 10:55:59 UTC 2013

 Modified Files:
 	src/sys/fs/nilfs [netbsd-6-1]: nilfs_vnops.c

 Log Message:
 Pull up following revision(s) (requested by reinoud in ticket #894):
 	sys/fs/nilfs/nilfs_vnops.c: revision 1.22-1.23
 Fix serious file read problem due to not-so-clear VOP_BMAP description. Should
 fix PR 45605.


 To generate a diff of this commit:
 cvs rdiff -u -r1.16.6.1 -r1.16.6.1.6.1 src/sys/fs/nilfs/nilfs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:
 Sources from 2011-11-11.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.