Bug 8503 - File on XFS is truncated at reboot with 2.6.22-rc1
Summary: File on XFS is truncated at reboot with 2.6.22-rc1
Status: CLOSED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: XFS (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: XFS Guru
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-18 13:31 UTC by Maurice van der Pot
Modified: 2008-09-23 11:17 UTC (History)
0 users

See Also:
Kernel Version: 2.6.22-rc1
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Maurice van der Pot 2007-05-18 13:31:09 UTC
Most recent kernel where this bug did *NOT* occur: 2.6.21.1
Distribution: Gentoo
Hardware Environment: PC, P4 3G, 1G mem
Problem Description:

I have a file on my XFS root filesystem (/etc/env.d/03opengl) that gets
truncated to 33 bytes at each reboot, under the following two conditions:

1) i have modified the file under a 2.6.22-rc1 kernel. If I change it under a
2.6.21.1 kernel the problem does not occur. It does not make a difference if I
boot to a 2.6.22-rc1 or 2.6.21.1 kernel.

2) the file has a specific inode. This particular file is generated by a script
(eselect opengl set nvidia) on my system and when it is generated like this it
gets inode 33554562. The problem occurs only with this inode. If I overwrite the
file with vim it gets inode 33554595 or 33554596 and the problem does not occur.

An observation about the content of the file:
- any modifications I make to the part of the file before the point where it is
truncated, are visible in the truncated file after reboot.

Steps to reproduce:
These are the steps I take to reproduce this on my system:
1) boot to kernel 2.6.22-rc1 with init=/bin/bash
2) mount -o remount,rw /
3) eselect opengl set nvidia (generates the file /etc/env.d/03opengl)
4) mount -o remount,ro /
5) sync
6) reboot
7) boot to any kernel with init=/bin/bash
8) cat /etc/env.d/03opengl
Comment 1 Maurice van der Pot 2007-05-19 16:30:52 UTC
The following issue from the known regressions with patches list seems to be the
same. That patch solves the problem on my system.

File systems

Subject    : 2.6.21-git10/11: files getting truncated on xfs
References : http://lkml.org/lkml/2007/5/9/410
Submitter  : Jeremy Fitzhardinge <jeremy@goop.org>
Handled-By : David Chinner <dgc@sgi.com>
Patch      : http://lkml.org/lkml/2007/5/12/93
Status     : patch available
Comment 2 Julien Muchembled 2008-01-11 11:07:39 UTC
This bug should be closed:

Date: Thu, 24 May 2007 05:27:03 +0000 (+1000)
Subject: [XFS] Write at EOF may not update filesize correctly.
X-Git-Tag: v2.6.22-rc4~91^2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=df3c7244264f1d12562413aa32d56be802486516

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