<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/xfs, branch v2.6.26</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Fix reference counting race on log buffers</title>
<updated>2008-07-11T18:37:18+00:00</updated>
<author>
<name>Dave Chinner</name>
<email>david@fromorbit.com</email>
</author>
<published>2008-07-11T07:43:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=49641f1acfdfd437ed9b0a70b86bf36626c02afe'/>
<id>49641f1acfdfd437ed9b0a70b86bf36626c02afe</id>
<content type='text'>
When we release the iclog, we do an atomic_dec_and_lock to determine if
we are the last reference and need to trigger update of log headers and
writeout.  However, in xlog_state_get_iclog_space() we also need to
check if we have the last reference count there.  If we do, we release
the log buffer, otherwise we decrement the reference count.

But the compare and decrement in xlog_state_get_iclog_space() is not
atomic, so both places can see a reference count of 2 and neither will
release the iclog.  That leads to a filesystem hang.

Close the race by replacing the atomic_read() and atomic_dec() pair with
atomic_add_unless() to ensure that they are executed atomically.

Signed-off-by: Dave Chinner &lt;david@fromorbit.com&gt;
Reviewed-by: Tim Shimmin &lt;tes@sgi.com&gt;
Tested-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we release the iclog, we do an atomic_dec_and_lock to determine if
we are the last reference and need to trigger update of log headers and
writeout.  However, in xlog_state_get_iclog_space() we also need to
check if we have the last reference count there.  If we do, we release
the log buffer, otherwise we decrement the reference count.

But the compare and decrement in xlog_state_get_iclog_space() is not
atomic, so both places can see a reference count of 2 and neither will
release the iclog.  That leads to a filesystem hang.

Close the race by replacing the atomic_read() and atomic_dec() pair with
atomic_add_unless() to ensure that they are executed atomically.

Signed-off-by: Dave Chinner &lt;david@fromorbit.com&gt;
Reviewed-by: Tim Shimmin &lt;tes@sgi.com&gt;
Tested-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] Fix memory corruption with small buffer reads</title>
<updated>2008-05-23T08:12:49+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2008-05-19T06:34:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6ab455eeaff6893cd06da33843e840d888cdc04a'/>
<id>6ab455eeaff6893cd06da33843e840d888cdc04a</id>
<content type='text'>
When we have multiple buffers in a single page for a blocksize == pagesize
filesystem we might overwrite the page contents if two callers hit it
shortly after each other. To prevent that we need to keep the page locked
until I/O is completed and the page marked uptodate.

Thanks to Eric Sandeen for triaging this bug and finding a reproducible
testcase and Dave Chinner for additional advice.

This should fix kernel.org bz #10421.

Tested-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;

SGI-PV: 981813
SGI-Modid: xfs-linux-melb:xfs-kern:31173a

Signed-off-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we have multiple buffers in a single page for a blocksize == pagesize
filesystem we might overwrite the page contents if two callers hit it
shortly after each other. To prevent that we need to keep the page locked
until I/O is completed and the page marked uptodate.

Thanks to Eric Sandeen for triaging this bug and finding a reproducible
testcase and Dave Chinner for additional advice.

This should fix kernel.org bz #10421.

Tested-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;

SGI-PV: 981813
SGI-Modid: xfs-linux-melb:xfs-kern:31173a

Signed-off-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] Fix inode list allocation size in writeback.</title>
<updated>2008-05-23T05:26:15+00:00</updated>
<author>
<name>David Chinner</name>
<email>dgc@sgi.com</email>
</author>
<published>2008-05-20T01:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c8f5f12e46f079a954d4f7163ba59dadee08ca26'/>
<id>c8f5f12e46f079a954d4f7163ba59dadee08ca26</id>
<content type='text'>
We only need to allocate space for the number of inodes in the cluster
when writing back inodes, not every byte in the inode cluster. This
reduces the amount of memory needing to be allocated to 256 bytes instead
of 64k.

SGI-PV: 981949
SGI-Modid: xfs-linux-melb:xfs-kern:31182a

Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We only need to allocate space for the number of inodes in the cluster
when writing back inodes, not every byte in the inode cluster. This
reduces the amount of memory needing to be allocated to 256 bytes instead
of 64k.

SGI-PV: 981949
SGI-Modid: xfs-linux-melb:xfs-kern:31182a

Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] Don't allow memory reclaim to wait on the filesystem in inode</title>
<updated>2008-05-23T05:26:03+00:00</updated>
<author>
<name>David Chinner</name>
<email>dgc@sgi.com</email>
</author>
<published>2008-05-19T06:29:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=49383b0e98ad1f69ff4c816eb1961f703df12318'/>
<id>49383b0e98ad1f69ff4c816eb1961f703df12318</id>
<content type='text'>
writeback

If we allow memory reclaim to wait on the pages under writeback in inode
cluster writeback we could deadlock because we are currently holding the
ILOCK on the initial writeback inode which is needed in data I/O
completion to change the file size or do unwritten extent conversion
before the pages are taken out of writeback state.

SGI-PV: 981091
SGI-Modid: xfs-linux-melb:xfs-kern:31015a

Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
writeback

If we allow memory reclaim to wait on the pages under writeback in inode
cluster writeback we could deadlock because we are currently holding the
ILOCK on the initial writeback inode which is needed in data I/O
completion to change the file size or do unwritten extent conversion
before the pages are taken out of writeback state.

SGI-PV: 981091
SGI-Modid: xfs-linux-melb:xfs-kern:31015a

Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] Fix fsync() b0rkage.</title>
<updated>2008-05-23T05:25:25+00:00</updated>
<author>
<name>David Chinner</name>
<email>dgc@sgi.com</email>
</author>
<published>2008-05-19T06:29:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=978b7237123d007b9fa983af6e0e2fa8f97f9934'/>
<id>978b7237123d007b9fa983af6e0e2fa8f97f9934</id>
<content type='text'>
xfs_fsync() fails to wait for data I/O completion before checking if the
inode is dirty or clean to decide whether to log the inode or not. This
misses inode size updates when the data flushed by the fsync() is
extending the file.

Hence, like fdatasync(), we need to wait for I/o completion first, then
check the inode for cleanliness. Doing so makes the behaviour of
xfs_fsync() identical for fsync and fdatasync and we *always* use
synchronous semantics if the inode is dirty. Therefore also kill the
differences and remove the unused flags from the xfs_fsync function and
callers.

SGI-PV: 981296
SGI-Modid: xfs-linux-melb:xfs-kern:31033a

Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
xfs_fsync() fails to wait for data I/O completion before checking if the
inode is dirty or clean to decide whether to log the inode or not. This
misses inode size updates when the data flushed by the fsync() is
extending the file.

Hence, like fdatasync(), we need to wait for I/o completion first, then
check the inode for cleanliness. Doing so makes the behaviour of
xfs_fsync() identical for fsync and fdatasync and we *always* use
synchronous semantics if the inode is dirty. Therefore also kill the
differences and remove the unused flags from the xfs_fsync function and
callers.

SGI-PV: 981296
SGI-Modid: xfs-linux-melb:xfs-kern:31033a

Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] Include linux/random.h in all builds, not just debug builds.</title>
<updated>2008-04-30T08:17:44+00:00</updated>
<author>
<name>David Chinner</name>
<email>dgc@sgi.com</email>
</author>
<published>2008-04-30T08:15:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a94477da38e0b261a7ecea71f4c95a3bcd5be69c'/>
<id>a94477da38e0b261a7ecea71f4c95a3bcd5be69c</id>
<content type='text'>
SGI-PV: 979416
SGI-Modid: xfs-linux-melb:xfs-kern:31008a

Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SGI-PV: 979416
SGI-Modid: xfs-linux-melb:xfs-kern:31008a

Signed-off-by: David Chinner &lt;dgc@sgi.com&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] Fix build failure after enabling CONFIG_XFS_DEBUG</title>
<updated>2008-04-29T06:08:44+00:00</updated>
<author>
<name>Stephen Rothwell</name>
<email>sfr@canb.auug.org.au</email>
</author>
<published>2008-04-22T05:26:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=adaa693b845373296631766176ebf0f73a342e10'/>
<id>adaa693b845373296631766176ebf0f73a342e10</id>
<content type='text'>
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] remove dmapi cruft in xfs_file.c</title>
<updated>2008-04-29T06:08:27+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2008-04-21T08:11:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c5acbaf43da139fe014d78d1f0ca7754fa856ddb'/>
<id>c5acbaf43da139fe014d78d1f0ca7754fa856ddb</id>
<content type='text'>
The dmapi cruft in xfs_file.c is totally out of date in mainline vs
CVS, and at this point just removing this code which can't be used on
mainline at all seems to be the best option to keep it maintainable.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The dmapi cruft in xfs_file.c is totally out of date in mainline vs
CVS, and at this point just removing this code which can't be used on
mainline at all seems to be the best option to keep it maintainable.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] remove sendfile leftovers</title>
<updated>2008-04-29T06:08:14+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2008-04-21T07:25:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3a738a5c73e0617d11b27ac46dd6a1a8f752017b'/>
<id>3a738a5c73e0617d11b27ac46dd6a1a8f752017b</id>
<content type='text'>
Remove the last sendfile leftovers in mainline.  This code is already
gone in CVS.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the last sendfile leftovers in mainline.  This code is already
gone in CVS.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[XFS] allow enabling CONFIG_XFS_DEBUG</title>
<updated>2008-04-29T06:07:48+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2008-04-21T07:22:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7788fae6cce616fe2c624273fcfe54cf50f5c38b'/>
<id>7788fae6cce616fe2c624273fcfe54cf50f5c38b</id>
<content type='text'>
Back when I first submitted XFS for mainline inclusion we made the
decision that the debug code is far to extensive to be accidentally
enabled by users in mainline.  But then again it's often quite useful
to track problems down and hacking the makefile all the time is rather
annoying.  Given all the debug options with even more overhead like
lockdep or DEBUG_PAGE_ALLOC users (or rather developers) should know
by now what they're doing.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Back when I first submitted XFS for mainline inclusion we made the
decision that the debug code is far to extensive to be accidentally
enabled by users in mainline.  But then again it's often quite useful
to track problems down and hacking the makefile all the time is rather
annoying.  Given all the debug options with even more overhead like
lockdep or DEBUG_PAGE_ALLOC users (or rather developers) should know
by now what they're doing.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Lachlan McIlroy &lt;lachlan@sgi.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
