From: David Chinner <dgc@sgi.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Missing TAKE 958522 (was Re: [Bug 756] New: File data corruption.....)
Date: Wed, 2 May 2007 23:11:44 +1000 [thread overview]
Message-ID: <20070502131144.GZ77450368@melbourne.sgi.com> (raw)
In-Reply-To: <20070502105241.GA15399@lst.de>
On Wed, May 02, 2007 at 12:52:41PM +0200, Christoph Hellwig wrote:
> > Note that a similar issue existed in the 2.6 SGI kernel up until it was resolved
> > by this recent change:
> > http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c.diff?r1=1.258;r2=1.259;f=h
>
> Seems like someone forgot to send TAKEs to the xfs list once again..
Hmmm - that was a bad one to miss considering the importance of the
problem it fixes......
-----
TAKE 958522 - XFS has conflicting strategies between metadata and file data flushing
Fix to prevent the notorious 'NULL files' problem after a crash.
The problem that has been addressed is that of synchronising updates of
the file size with writes that extend a file. Without the fix the update
of a file's size, as a result of a write beyond eof, is independent of
when the cached data is flushed to disk. Often the file size update would
be written to the filesystem log before the data is flushed to disk. When
a system crashes between these two events and the filesystem log is
replayed on mount the file's size will be set but since the contents never
made it to disk the file is full of holes. If some of the cached data was
flushed to disk then it may just be a section of the file at the end that
has holes.
There are existing fixes to help alleviate this problem, particularly in
the case where a file has been truncated, that force cached data to be
flushed to disk when the file is closed. If the system crashes while the
file(s) are still open then this flushing will never occur.
The fix that we have implemented is to introduce a second file size, called
the in-memory file size, that represents the current file size as viewed by
the user. The existing file size, called the on-disk file size, is the one
that get's written to the filesystem log and we only update it when it is
safe to do so. When we write to a file beyond eof we only update the in-
memory file size in the write operation. Later when the I/O operation, that
flushes the cached data to disk completes, an I/O completion routine will
update the on-disk file size. The on-disk file size will be updated to the
maximum offset of the I/O or to the value of the in-memory file size if the
I/O includes eof.
Date: Fri Mar 30 02:24:06 AEST 2007
Workarea: vpn-emea-sw-emea-160-18.emea.sgi.com:/home/lachlan/isms/2.6.x-null
Inspected by: dgc,tes
The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb
Modid: xfs-linux-melb:xfs-kern:28322a
fs/xfs/xfsidbg.c - 1.312 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.312&r2=text&tr2=1.311&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/xfs_vnodeops.c - 1.693 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.693&r2=text&tr2=1.692&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/xfs_iocore.c - 1.52 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iocore.c.diff?r1=text&tr1=1.52&r2=text&tr2=1.51&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/xfs_inode.c - 1.463 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.463&r2=text&tr2=1.462&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/xfs_inode.h - 1.219 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.219&r2=text&tr2=1.218&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/xfs_bmap.c - 1.367 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.367&r2=text&tr2=1.366&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/xfs_iomap.h - 1.10 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iomap.h.diff?r1=text&tr1=1.10&r2=text&tr2=1.9&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/xfs_iomap.c - 1.52 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iomap.c.diff?r1=text&tr1=1.52&r2=text&tr2=1.51&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/linux-2.6/xfs_lrw.c - 1.259 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_lrw.c.diff?r1=text&tr1=1.259&r2=text&tr2=1.258&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/linux-2.6/xfs_aops.c - 1.142 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_aops.c.diff?r1=text&tr1=1.142&r2=text&tr2=1.141&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
fs/xfs/dmapi/xfs_dm.c - 1.34 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.34&r2=text&tr2=1.33&f=h
- Fix to prevent the notorious 'NULL files' problem after a crash.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
prev parent reply other threads:[~2007-05-02 13:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200705012104.l41L4CI3029767@oss.sgi.com>
2007-05-02 10:52 ` [Bug 756] New: File data corruption when writing to files with DM_EVENT_WRITE enabled over NFS (2.4 kernel) Christoph Hellwig
2007-05-02 13:11 ` David Chinner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070502131144.GZ77450368@melbourne.sgi.com \
--to=dgc@sgi.com \
--cc=hch@lst.de \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox