<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs, branch v3.2.41</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs?h=v3.2.41</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs?h=v3.2.41'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-03-20T15:03:41Z</updated>
<entry>
<title>NLS: improve UTF8 -&gt; UTF16 string conversion routine</title>
<updated>2013-03-20T15:03:41Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2011-11-17T21:42:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6022b67230dcb25c267e832d72223ffb54703cc8'/>
<id>urn:sha1:6022b67230dcb25c267e832d72223ffb54703cc8</id>
<content type='text'>
commit 0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd upstream.

The utf8s_to_utf16s conversion routine needs to be improved.  Unlike
its utf16s_to_utf8s sibling, it doesn't accept arguments specifying
the maximum length of the output buffer or the endianness of its
16-bit output.

This patch (as1501) adds the two missing arguments, and adjusts the
only two places in the kernel where the function is called.  A
follow-on patch will add a third caller that does utilize the new
capabilities.

The two conversion routines are still annoyingly inconsistent in the
way they handle invalid byte combinations.  But that's a subject for a
different patch.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>btrfs: use rcu_barrier() to wait for bdev puts at unmount</title>
<updated>2013-03-20T15:03:41Z</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@redhat.com</email>
</author>
<published>2013-03-09T15:18:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2d8db10e98fca5bb13e70c3f35d7c0ff79df638c'/>
<id>urn:sha1:2d8db10e98fca5bb13e70c3f35d7c0ff79df638c</id>
<content type='text'>
commit bc178622d40d87e75abc131007342429c9b03351 upstream.

Doing this would reliably fail with -EBUSY for me:

# mount /dev/sdb2 /mnt/scratch; umount /mnt/scratch; mkfs.btrfs -f /dev/sdb2
...
unable to open /dev/sdb2: Device or resource busy

because mkfs.btrfs tries to open the device O_EXCL, and somebody still has it.

Using systemtap to track bdev gets &amp; puts shows a kworker thread doing a
blkdev put after mkfs attempts a get; this is left over from the unmount
path:

btrfs_close_devices
	__btrfs_close_devices
		call_rcu(&amp;device-&gt;rcu, free_device);
			free_device
				INIT_WORK(&amp;device-&gt;rcu_work, __free_device);
				schedule_work(&amp;device-&gt;rcu_work);

so unmount might complete before __free_device fires &amp; does its blkdev_put.

Adding an rcu_barrier() to btrfs_close_devices() causes unmount to wait
until all blkdev_put()s are done, and the device is truly free once
unmount completes.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>block: use i_size_write() in bd_set_size()</title>
<updated>2013-03-20T15:03:40Z</updated>
<author>
<name>Guo Chao</name>
<email>yan@linux.vnet.ibm.com</email>
</author>
<published>2013-02-21T23:16:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c1a782a5c7a83f4aa3239533619e93b1fc3ab79d'/>
<id>urn:sha1:c1a782a5c7a83f4aa3239533619e93b1fc3ab79d</id>
<content type='text'>
commit d646a02a9d44d1421f273ae3923d97b47b918176 upstream.

blkdev_ioctl(GETBLKSIZE) uses i_size_read() to read size of block device.
If we update block size directly, reader may see intermediate result in
some machines and configurations.  Use i_size_write() instead.

Signed-off-by: Guo Chao &lt;yan@linux.vnet.ibm.com&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Guo Chao &lt;yan@linux.vnet.ibm.com&gt;
Cc: M. Hindess &lt;hindessm@uk.ibm.com&gt;
Cc: Nikanth Karthikesan &lt;knikanth@suse.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Fix: compat_rw_copy_check_uvector() misuse in aio, readv, writev, and security keys</title>
<updated>2013-03-20T15:03:37Z</updated>
<author>
<name>Mathieu Desnoyers</name>
<email>mathieu.desnoyers@efficios.com</email>
</author>
<published>2013-02-25T15:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d9737ff18a63da7671ff991f8d79a2d09fec66e5'/>
<id>urn:sha1:d9737ff18a63da7671ff991f8d79a2d09fec66e5</id>
<content type='text'>
commit 8aec0f5d4137532de14e6554fd5dd201ff3a3c49 upstream.

Looking at mm/process_vm_access.c:process_vm_rw() and comparing it to
compat_process_vm_rw() shows that the compatibility code requires an
explicit "access_ok()" check before calling
compat_rw_copy_check_uvector(). The same difference seems to appear when
we compare fs/read_write.c:do_readv_writev() to
fs/compat.c:compat_do_readv_writev().

This subtle difference between the compat and non-compat requirements
should probably be debated, as it seems to be error-prone. In fact,
there are two others sites that use this function in the Linux kernel,
and they both seem to get it wrong:

Now shifting our attention to fs/aio.c, we see that aio_setup_iocb()
also ends up calling compat_rw_copy_check_uvector() through
aio_setup_vectored_rw(). Unfortunately, the access_ok() check appears to
be missing. Same situation for
security/keys/compat.c:compat_keyctl_instantiate_key_iov().

I propose that we add the access_ok() check directly into
compat_rw_copy_check_uvector(), so callers don't have to worry about it,
and it therefore makes the compat call code similar to its non-compat
counterpart. Place the access_ok() check in the same location where
copy_from_user() can trigger a -EFAULT error in the non-compat code, so
the ABI behaviors are alike on both compat and non-compat.

While we are here, fix compat_do_readv_writev() so it checks for
compat_rw_copy_check_uvector() negative return values.

And also, fix a memory leak in compat_keyctl_instantiate_key_iov() error
handling.

Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Acked-by: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ext3: Fix format string issues</title>
<updated>2013-03-20T15:03:33Z</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2013-03-09T14:28:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=058f677c359d91e6692dc9a9da36b2e3eadf36ba'/>
<id>urn:sha1:058f677c359d91e6692dc9a9da36b2e3eadf36ba</id>
<content type='text'>
commit 8d0c2d10dd72c5292eda7a06231056a4c972e4cc upstream.

ext3_msg() takes the printk prefix as the second parameter and the
format string as the third parameter. Two callers of ext3_msg omit the
prefix and pass the format string as the second parameter and the first
parameter to the format string as the third parameter. In both cases
this string comes from an arbitrary source. Which means the string may
contain format string characters, which will
lead to undefined and potentially harmful behavior.

The issue was introduced in commit 4cf46b67eb("ext3: Unify log messages
in ext3") and is fixed by this patch.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>vfs: fix pipe counter breakage</title>
<updated>2013-03-20T15:03:29Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2013-03-12T02:59:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0edb34d87ec58f4f1f9309e4ca9d0fa85be474c3'/>
<id>urn:sha1:0edb34d87ec58f4f1f9309e4ca9d0fa85be474c3</id>
<content type='text'>
commit a930d8790552658140d7d0d2e316af4f0d76a512 upstream.

If you open a pipe for neither read nor write, the pipe code will not
add any usage counters to the pipe, causing the 'struct pipe_inode_info"
to be potentially released early.

That doesn't normally matter, since you cannot actually use the pipe,
but the pipe release code - particularly fasync handling - still expects
the actual pipe infrastructure to all be there.  And rather than adding
NULL pointer checks, let's just disallow this case, the same way we
already do for the named pipe ("fifo") case.

This is ancient going back to pre-2.4 days, and until trinity, nobody
naver noticed.

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cifs: ensure that cifs_get_root() only traverses directories</title>
<updated>2013-03-20T15:03:20Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2013-02-01T20:11:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=82db248291c30e0b83528ee21416047a6063fe28'/>
<id>urn:sha1:82db248291c30e0b83528ee21416047a6063fe28</id>
<content type='text'>
commit ce2ac52105aa663056dfc17966ebed1bf93e6e64 upstream.

Kjell Braden reported this oops:

[  833.211970] BUG: unable to handle kernel NULL pointer dereference at           (null)
[  833.212816] IP: [&lt;          (null)&gt;]           (null)
[  833.213280] PGD 1b9b2067 PUD e9f7067 PMD 0
[  833.213874] Oops: 0010 [#1] SMP
[  833.214344] CPU 0
[  833.214458] Modules linked in: des_generic md4 nls_utf8 cifs vboxvideo drm snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq bnep rfcomm snd_timer bluetooth snd_seq_device ppdev snd vboxguest parport_pc joydev mac_hid soundcore snd_page_alloc psmouse i2c_piix4 serio_raw lp parport usbhid hid e1000
[  833.215629]
[  833.215629] Pid: 1752, comm: mount.cifs Not tainted 3.0.0-rc7-bisectcifs-fec11dd9a0+ #18 innotek GmbH VirtualBox/VirtualBox
[  833.215629] RIP: 0010:[&lt;0000000000000000&gt;]  [&lt;          (null)&gt;]           (null)
[  833.215629] RSP: 0018:ffff8800119c9c50  EFLAGS: 00010282
[  833.215629] RAX: ffffffffa02186c0 RBX: ffff88000c427780 RCX: 0000000000000000
[  833.215629] RDX: 0000000000000000 RSI: ffff88000c427780 RDI: ffff88000c4362e8
[  833.215629] RBP: ffff8800119c9c88 R08: ffff88001fc15e30 R09: 00000000d69515c7
[  833.215629] R10: ffffffffa0201972 R11: ffff88000e8f6a28 R12: ffff88000c4362e8
[  833.215629] R13: 0000000000000000 R14: 0000000000000000 R15: ffff88001181aaa6
[  833.215629] FS:  00007f2986171700(0000) GS:ffff88001fc00000(0000) knlGS:0000000000000000
[  833.215629] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  833.215629] CR2: 0000000000000000 CR3: 000000001b982000 CR4: 00000000000006f0
[  833.215629] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  833.215629] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  833.215629] Process mount.cifs (pid: 1752, threadinfo ffff8800119c8000, task ffff88001c1c16f0)
[  833.215629] Stack:
[  833.215629]  ffffffff8116a9b5 ffff8800119c9c88 ffffffff81178075 0000000000000286
[  833.215629]  0000000000000000 ffff88000c4276c0 ffff8800119c9ce8 ffff8800119c9cc8
[  833.215629]  ffffffff8116b06e ffff88001bc6fc00 ffff88000c4276c0 ffff88000c4276c0
[  833.215629] Call Trace:
[  833.215629]  [&lt;ffffffff8116a9b5&gt;] ? d_alloc_and_lookup+0x45/0x90
[  833.215629]  [&lt;ffffffff81178075&gt;] ? d_lookup+0x35/0x60
[  833.215629]  [&lt;ffffffff8116b06e&gt;] __lookup_hash.part.14+0x9e/0xc0
[  833.215629]  [&lt;ffffffff8116b1d6&gt;] lookup_one_len+0x146/0x1e0
[  833.215629]  [&lt;ffffffff815e4f7e&gt;] ? _raw_spin_lock+0xe/0x20
[  833.215629]  [&lt;ffffffffa01eef0d&gt;] cifs_do_mount+0x26d/0x500 [cifs]
[  833.215629]  [&lt;ffffffff81163bd3&gt;] mount_fs+0x43/0x1b0
[  833.215629]  [&lt;ffffffff8117d41a&gt;] vfs_kern_mount+0x6a/0xd0
[  833.215629]  [&lt;ffffffff8117e584&gt;] do_kern_mount+0x54/0x110
[  833.215629]  [&lt;ffffffff8117fdc2&gt;] do_mount+0x262/0x840
[  833.215629]  [&lt;ffffffff81108a0e&gt;] ? __get_free_pages+0xe/0x50
[  833.215629]  [&lt;ffffffff8117f9ca&gt;] ? copy_mount_options+0x3a/0x180
[  833.215629]  [&lt;ffffffff8118075d&gt;] sys_mount+0x8d/0xe0
[  833.215629]  [&lt;ffffffff815ece82&gt;] system_call_fastpath+0x16/0x1b
[  833.215629] Code:  Bad RIP value.
[  833.215629] RIP  [&lt;          (null)&gt;]           (null)
[  833.215629]  RSP &lt;ffff8800119c9c50&gt;
[  833.215629] CR2: 0000000000000000
[  833.238525] ---[ end trace ec00758b8d44f529 ]---

When walking down the path on the server, it's possible to hit a
symlink. The path walking code assumes that the caller will handle that
situation properly, but cifs_get_root() isn't set up for it. This patch
prevents the oops by simply returning an error.

A better solution would be to try and chase the symlinks here, but that's
fairly complicated to handle.

Fixes:

    https://bugzilla.kernel.org/show_bug.cgi?id=53221

Reported-and-tested-by: Kjell Braden &lt;afflux@pentabarf.de&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;sfrench@us.ibm.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>NFS: Don't allow NFS silly-renamed files to be deleted, no signal</title>
<updated>2013-03-20T15:03:16Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2013-02-22T17:53:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b42d5faf4e168d24b85c2c3f59f8d0ee4385dfa1'/>
<id>urn:sha1:b42d5faf4e168d24b85c2c3f59f8d0ee4385dfa1</id>
<content type='text'>
commit 5a7a613a47a715711b3f2d3322a0eac21d459166 upstream.

Commit 73ca100 broke the code that prevents the client from deleting
a silly renamed dentry.  This affected "delete on last close"
semantics as after that commit, nothing prevented removal of
silly-renamed files.  As a result, a process holding a file open
could easily get an ESTALE on the file in a directory where some
other process issued 'rm -rf some_dir_containing_the_file' twice.
Before the commit, any attempt at unlinking silly renamed files would
fail inside may_delete() with -EBUSY because of the
DCACHE_NFSFS_RENAMED flag.  The following testcase demonstrates
the problem:
  tail -f /nfsmnt/dir/file &amp;
  rm -rf /nfsmnt/dir
  rm -rf /nfsmnt/dir
  # second removal does not fail, 'tail' process receives ESTALE

The problem with the above commit is that it unhashes the old and
new dentries from the lookup path, even in the normal case when
a signal is not encountered and it would have been safe to call
d_move.  Unfortunately the old dentry has the special
DCACHE_NFSFS_RENAMED flag set on it.  Unhashing has the
side-effect that future lookups call d_alloc(), allocating a new
dentry without the special flag for any silly-renamed files.  As a
result, subsequent calls to unlink silly renamed files do not fail
but allow the removal to go through.  This will result in ESTALE
errors for any other process doing operations on the file.

To fix this, go back to using d_move on success.
For the signal case, it's unclear what we may safely do beyond d_drop.

Reported-by: Dave Wysochanski &lt;dwysocha@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Acked-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>btrfs: Init io_lock after cloning btrfs device struct</title>
<updated>2013-03-20T15:03:15Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-02-20T19:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=554995ab65f98584d95e06e4d44f0c4d3293cee7'/>
<id>urn:sha1:554995ab65f98584d95e06e4d44f0c4d3293cee7</id>
<content type='text'>
commit 1cba0cdf5e4dbcd9e5fa5b54d7a028e55e2ca057 upstream.

__btrfs_close_devices() clones btrfs device structs with
memcpy(). Some of the fields in the clone are reinitialized, but it's
missing to init io_lock. In mainline this goes unnoticed, but on RT it
leaves the plist pointing to the original about to be freed lock
struct.

Initialize io_lock after cloning, so no references to the original
struct are left.

Reported-and-tested-by: Mike Galbraith &lt;efault@gmx.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ext4: fix kernel BUG on large-scale rm -rf commands</title>
<updated>2013-03-06T03:24:30Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-08-17T12:54:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=933ef2d5e70eba0cdd652a43157004e8619f66e9'/>
<id>urn:sha1:933ef2d5e70eba0cdd652a43157004e8619f66e9</id>
<content type='text'>
commit 89a4e48f8479f8145eca9698f39fe188c982212f upstream.

Commit 968dee7722: "ext4: fix hole punch failure when depth is greater
than 0" introduced a regression in v3.5.1/v3.6-rc1 which caused kernel
crashes when users ran run "rm -rf" on large directory hierarchy on
ext4 filesystems on RAID devices:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000028

    Process rm (pid: 18229, threadinfo ffff8801276bc000, task ffff880123631710)
    Call Trace:
     [&lt;ffffffff81236483&gt;] ? __ext4_handle_dirty_metadata+0x83/0x110
     [&lt;ffffffff812353d3&gt;] ext4_ext_truncate+0x193/0x1d0
     [&lt;ffffffff8120a8cf&gt;] ? ext4_mark_inode_dirty+0x7f/0x1f0
     [&lt;ffffffff81207e05&gt;] ext4_truncate+0xf5/0x100
     [&lt;ffffffff8120cd51&gt;] ext4_evict_inode+0x461/0x490
     [&lt;ffffffff811a1312&gt;] evict+0xa2/0x1a0
     [&lt;ffffffff811a1513&gt;] iput+0x103/0x1f0
     [&lt;ffffffff81196d84&gt;] do_unlinkat+0x154/0x1c0
     [&lt;ffffffff8118cc3a&gt;] ? sys_newfstatat+0x2a/0x40
     [&lt;ffffffff81197b0b&gt;] sys_unlinkat+0x1b/0x50
     [&lt;ffffffff816135e9&gt;] system_call_fastpath+0x16/0x1b
    Code: 8b 4d 20 0f b7 41 02 48 8d 04 40 48 8d 04 81 49 89 45 18 0f b7 49 02 48 83 c1 01 49 89 4d 00 e9 ae f8 ff ff 0f 1f 00 49 8b 45 28 &lt;48&gt; 8b 40 28 49 89 45 20 e9 85 f8 ff ff 0f 1f 80 00 00 00

    RIP  [&lt;ffffffff81233164&gt;] ext4_ext_remove_space+0xa34/0xdf0

This could be reproduced as follows:

The problem in commit 968dee7722 was that caused the variable 'i' to
be left uninitialized if the truncate required more space than was
available in the journal.  This resulted in the function
ext4_ext_truncate_extend_restart() returning -EAGAIN, which caused
ext4_ext_remove_space() to restart the truncate operation after
starting a new jbd2 handle.

Reported-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Reported-by: Marti Raudsepp &lt;marti@juffo.org&gt;
Tested-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
