<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/xfs, branch v2.6.30</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs</title>
<updated>2009-06-02T16:47:21+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-06-02T16:47:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4157fd85fc794bb7896b65c0cf686aa89d711d57'/>
<id>4157fd85fc794bb7896b65c0cf686aa89d711d57</id>
<content type='text'>
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: prevent deadlock in xfs_qm_shake()
  xfs: fix overflow in xfs_growfs_data_private
  xfs: fix double unlock in xfs_swap_extents()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: prevent deadlock in xfs_qm_shake()
  xfs: fix overflow in xfs_growfs_data_private
  xfs: fix double unlock in xfs_swap_extents()
</pre>
</div>
</content>
</entry>
<entry>
<title>xfs: prevent deadlock in xfs_qm_shake()</title>
<updated>2009-06-02T03:59:45+00:00</updated>
<author>
<name>Felix Blyakher</name>
<email>felixb@sgi.com</email>
</author>
<published>2009-06-01T18:13:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1b17d766463d51904cb242f194a780737e5f73ef'/>
<id>1b17d766463d51904cb242f194a780737e5f73ef</id>
<content type='text'>
It's possible to recurse into filesystem from the memory
allocation, which deadlocks in xfs_qm_shake(). Add check
for __GFP_FS, and bail out if it is not set.

Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Hedi Berriche &lt;hedi@sgi.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's possible to recurse into filesystem from the memory
allocation, which deadlocks in xfs_qm_shake(). Add check
for __GFP_FS, and bail out if it is not set.

Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Hedi Berriche &lt;hedi@sgi.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xfs: fix overflow in xfs_growfs_data_private</title>
<updated>2009-06-02T03:59:38+00:00</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@sandeen.net</email>
</author>
<published>2009-05-23T19:30:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e6da7c9fed111ba1243297ee6eda8e24ae11c384'/>
<id>e6da7c9fed111ba1243297ee6eda8e24ae11c384</id>
<content type='text'>
In the case where growing a filesystem would leave the last AG
too small, the fixup code has an overflow in the calculation
of the new size with one fewer ag, because "nagcount" is a 32
bit number.  If the new filesystem has &gt; 2^32 blocks in it
this causes a problem resulting in an EINVAL return from growfs:

 # xfs_io -f -c "truncate 19998630180864" fsfile
 # mkfs.xfs -f -bsize=4096 -dagsize=76288719b,size=3905982455b fsfile
 # mount -o loop fsfile /mnt
 # xfs_growfs /mnt

meta-data=/dev/loop0             isize=256    agcount=52,
agsize=76288719 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=3905982455, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=32768, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Invalid argument

Reported-by: richard.ems@cape-horn-eng.com
Signed-off-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the case where growing a filesystem would leave the last AG
too small, the fixup code has an overflow in the calculation
of the new size with one fewer ag, because "nagcount" is a 32
bit number.  If the new filesystem has &gt; 2^32 blocks in it
this causes a problem resulting in an EINVAL return from growfs:

 # xfs_io -f -c "truncate 19998630180864" fsfile
 # mkfs.xfs -f -bsize=4096 -dagsize=76288719b,size=3905982455b fsfile
 # mount -o loop fsfile /mnt
 # xfs_growfs /mnt

meta-data=/dev/loop0             isize=256    agcount=52,
agsize=76288719 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=3905982455, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=32768, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Invalid argument

Reported-by: richard.ems@cape-horn-eng.com
Signed-off-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xfs: fix double unlock in xfs_swap_extents()</title>
<updated>2009-06-02T03:59:29+00:00</updated>
<author>
<name>Felix Blyakher</name>
<email>felixb@sgi.com</email>
</author>
<published>2009-05-08T00:49:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1f23920dbf1377fa9e4aef4f3d20c34a06a71a35'/>
<id>1f23920dbf1377fa9e4aef4f3d20c34a06a71a35</id>
<content type='text'>
Regreesion from commit ef8f7fc, which rearranged the code in
xfs_swap_extents() leading to double unlock of xfs inode ilock.
That resulted in xfs_fsr deadlocking itself on platforms, which
don't handle double unlock of rw_semaphore nicely. It caused the
count go negative, which represents the write holder, without
really having one. ia64 is one of the platforms where deadlock
was easily reproduced and the fix was tested.

Signed-off-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Reviewed-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Regreesion from commit ef8f7fc, which rearranged the code in
xfs_swap_extents() leading to double unlock of xfs inode ilock.
That resulted in xfs_fsr deadlocking itself on platforms, which
don't handle double unlock of rw_semaphore nicely. It caused the
count go negative, which represents the write holder, without
really having one. ia64 is one of the platforms where deadlock
was easily reproduced and the fix was tested.

Signed-off-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Reviewed-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs</title>
<updated>2009-05-02T23:52:50+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-05-02T23:52:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a'/>
<id>b4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a</id>
<content type='text'>
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: fix getbmap vs mmap deadlock
  xfs: a couple getbmap cleanups
  xfs: add more checks to superblock validation
  xfs_file_last_byte() needs to acquire ilock
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: fix getbmap vs mmap deadlock
  xfs: a couple getbmap cleanups
  xfs: add more checks to superblock validation
  xfs_file_last_byte() needs to acquire ilock
</pre>
</div>
</content>
</entry>
<entry>
<title>xfs: fix getbmap vs mmap deadlock</title>
<updated>2009-04-30T05:29:02+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2009-02-24T13:39:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=28e211700a81b0a934b6c7a4b8e7dda843634d2f'/>
<id>28e211700a81b0a934b6c7a4b8e7dda843634d2f</id>
<content type='text'>
xfs_getbmap (or rather the formatters called by it) copy out the getbmap
structures under the ilock, which can deadlock against mmap.  This has
been reported via bugzilla a while ago (#717) and has recently also
shown up via lockdep.

So allocate a temporary buffer to format the kernel getbmap structures
into and then copy them out after dropping the locks.

A little problem with this is that we limit the number of extents we
can copy out by the maximum allocation size, but I see no real way
around that.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Reviewed-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
xfs_getbmap (or rather the formatters called by it) copy out the getbmap
structures under the ilock, which can deadlock against mmap.  This has
been reported via bugzilla a while ago (#717) and has recently also
shown up via lockdep.

So allocate a temporary buffer to format the kernel getbmap structures
into and then copy them out after dropping the locks.

A little problem with this is that we limit the number of extents we
can copy out by the maximum allocation size, but I see no real way
around that.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Reviewed-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xfs: a couple getbmap cleanups</title>
<updated>2009-04-30T05:28:31+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2009-04-29T14:50:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5f79ed685fc6122018c4b5826e2e5bdb7bc6f109'/>
<id>5f79ed685fc6122018c4b5826e2e5bdb7bc6f109</id>
<content type='text'>
 - reshuffle various conditionals for data vs attr fork to make the code
   more readable
 - do fine-grainded goto-based error handling
 - exit early from conditionals instead of keeping a long else branch around
 - allow kmem_alloc to fail

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Reviewed-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - reshuffle various conditionals for data vs attr fork to make the code
   more readable
 - do fine-grainded goto-based error handling
 - exit early from conditionals instead of keeping a long else branch around
 - allow kmem_alloc to fail

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Eric Sandeen &lt;sandeen@sandeen.net&gt;
Reviewed-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xfs: add more checks to superblock validation</title>
<updated>2009-04-30T05:26:14+00:00</updated>
<author>
<name>Olaf Weber</name>
<email>olaf@sgi.com</email>
</author>
<published>2009-04-17T21:12:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b9ec9068d79e039507a247ebc5bc9c0ce53654ce'/>
<id>b9ec9068d79e039507a247ebc5bc9c0ce53654ce</id>
<content type='text'>
There had been reports where xfs filesystem was randomly
corrupted with fsfuzzer, and xfs failed to handle it
gracefully. This patch fixes couple of reported problem
by providing additional checks in the superblock
validation routine.

Signed-off-by: Olaf Weber &lt;olaf@sgi.com&gt;
Reviewed-by: Josef 'Jeff' Sipek &lt;jeffpc@josefsipek.net&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There had been reports where xfs filesystem was randomly
corrupted with fsfuzzer, and xfs failed to handle it
gracefully. This patch fixes couple of reported problem
by providing additional checks in the superblock
validation routine.

Signed-off-by: Olaf Weber &lt;olaf@sgi.com&gt;
Reviewed-by: Josef 'Jeff' Sipek &lt;jeffpc@josefsipek.net&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xfs_file_last_byte() needs to acquire ilock</title>
<updated>2009-04-30T05:25:25+00:00</updated>
<author>
<name>Lachlan McIlroy</name>
<email>lmcilroy@redhat.com</email>
</author>
<published>2009-04-24T02:18:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=def6b3ba56b637d58126ef67fc19bab57945fcc4'/>
<id>def6b3ba56b637d58126ef67fc19bab57945fcc4</id>
<content type='text'>
We had some systems crash with this stack:

[&lt;a00000010000cb20&gt;] ia64_leave_kernel+0x0/0x280
[&lt;a00000021291ca00&gt;] xfs_bmbt_get_startoff+0x0/0x20 [xfs]
[&lt;a0000002129080b0&gt;] xfs_bmap_last_offset+0x210/0x280 [xfs]
[&lt;a00000021295b010&gt;] xfs_file_last_byte+0x70/0x1a0 [xfs]
[&lt;a00000021295b200&gt;] xfs_itruncate_start+0xc0/0x1a0 [xfs]
[&lt;a0000002129935f0&gt;] xfs_inactive_free_eofblocks+0x290/0x460 [xfs]
[&lt;a000000212998fb0&gt;] xfs_release+0x1b0/0x240 [xfs]
[&lt;a0000002129ad930&gt;] xfs_file_release+0x70/0xa0 [xfs]
[&lt;a000000100162ea0&gt;] __fput+0x1a0/0x420
[&lt;a000000100163160&gt;] fput+0x40/0x60

The problem here is that xfs_file_last_byte() does not acquire the
inode lock and can therefore race with another thread that is modifying
the extext list.  While xfs_bmap_last_offset() is trying to lookup
what was the last extent some extents were merged and the extent list
shrunk so the index we lookup is now beyond the end of the extent list
and potentially in a freed buffer.

Signed-off-by: Lachlan McIlroy &lt;lmcilroy@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We had some systems crash with this stack:

[&lt;a00000010000cb20&gt;] ia64_leave_kernel+0x0/0x280
[&lt;a00000021291ca00&gt;] xfs_bmbt_get_startoff+0x0/0x20 [xfs]
[&lt;a0000002129080b0&gt;] xfs_bmap_last_offset+0x210/0x280 [xfs]
[&lt;a00000021295b010&gt;] xfs_file_last_byte+0x70/0x1a0 [xfs]
[&lt;a00000021295b200&gt;] xfs_itruncate_start+0xc0/0x1a0 [xfs]
[&lt;a0000002129935f0&gt;] xfs_inactive_free_eofblocks+0x290/0x460 [xfs]
[&lt;a000000212998fb0&gt;] xfs_release+0x1b0/0x240 [xfs]
[&lt;a0000002129ad930&gt;] xfs_file_release+0x70/0xa0 [xfs]
[&lt;a000000100162ea0&gt;] __fput+0x1a0/0x420
[&lt;a000000100163160&gt;] fput+0x40/0x60

The problem here is that xfs_file_last_byte() does not acquire the
inode lock and can therefore race with another thread that is modifying
the extext list.  While xfs_bmap_last_offset() is trying to lookup
what was the last extent some extents were merged and the extent list
shrunk so the index we lookup is now beyond the end of the extent list
and potentially in a freed buffer.

Signed-off-by: Lachlan McIlroy &lt;lmcilroy@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Felix Blyakher &lt;felixb@sgi.com&gt;
Signed-off-by: Felix Blyakher &lt;felixb@sgi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xfs: use memdup_user()</title>
<updated>2009-04-21T03:02:51+00:00</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-04-08T07:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0e639bdeef26faf287db77a15530f3f295a4ae04'/>
<id>0e639bdeef26faf287db77a15530f3f295a4ae04</id>
<content type='text'>
Remove open-coded memdup_user()

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove open-coded memdup_user()

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
