<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/fs/afs/rxrpc.c, branch dev</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2015-05-11T14:50:17+00:00</updated>
<entry>
<title>net: Add a struct net parameter to sock_create_kern</title>
<updated>2015-05-11T14:50:17+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-05-09T02:08:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=eeb1bd5c40edb0e2fd925c8535e2fdebdbc5cef2'/>
<id>urn:sha1:eeb1bd5c40edb0e2fd925c8535e2fdebdbc5cef2</id>
<content type='text'>
This is long overdue, and is part of cleaning up how we allocate kernel
sockets that don't reference count struct net.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>AFS: afs_send_empty_reply() doesn't require an iovec array</title>
<updated>2015-04-01T15:03:46+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2015-04-01T15:03:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=bfd4e9562c8769feadba9b5262200448656b8048'/>
<id>urn:sha1:bfd4e9562c8769feadba9b5262200448656b8048</id>
<content type='text'>
afs_send_empty_reply() doesn't require an iovec array with which to initialise
the msghdr, but can pass NULL instead.

Suggested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rxrpc: make the users of rxrpc_kernel_send_data() set kvec-backed msg_iter properly</title>
<updated>2015-02-04T06:34:14+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-11-28T02:50:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=2e90b1c45e34240eeeacab0b37d5f8f739462bdc'/>
<id>urn:sha1:2e90b1c45e34240eeeacab0b37d5f8f739462bdc</id>
<content type='text'>
Use iov_iter_kvec() there, get rid of set_fs() games - now that
rxrpc_send_data() uses iov_iter primitives, it'll handle ITER_KVEC just
fine.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>put iov_iter into msghdr</title>
<updated>2014-12-09T21:29:03+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-11-24T15:42:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c0371da6047abd261bc483c744dbc7d81a116172'/>
<id>urn:sha1:c0371da6047abd261bc483c744dbc7d81a116172</id>
<content type='text'>
Note that the code _using_ -&gt;msg_iter at that point will be very
unhappy with anything other than unshifted iovec-backed iov_iter.
We still need to convert users to proper primitives.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>AFS: Pass an afs_call* to call-&gt;async_workfn() instead of a work_struct*</title>
<updated>2014-05-23T12:05:22+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2014-05-21T14:55:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=656f88ddf1ec3abf2cd20b8b4028c44e8e95f56d'/>
<id>urn:sha1:656f88ddf1ec3abf2cd20b8b4028c44e8e95f56d</id>
<content type='text'>
call-&gt;async_workfn() can take an afs_call* arg rather than a work_struct* as
the functions assigned there are now called from afs_async_workfn() which has
to call container_of() anyway.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Nathaniel Wesley Filardo &lt;nwf@cs.jhu.edu&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>AFS: Fix kafs module unloading</title>
<updated>2014-05-23T12:05:22+00:00</updated>
<author>
<name>Nathaniel Wesley Filardo</name>
<email>nwf@cs.jhu.edu</email>
</author>
<published>2014-05-21T13:58:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=150a6b478982475c60fa25b7060ab990ece5483d'/>
<id>urn:sha1:150a6b478982475c60fa25b7060ab990ece5483d</id>
<content type='text'>
At present, it is not possible to successfully unload the kafs module if there
are outstanding async outgoing calls (those made with afs_make_call()).  This
appears to be due to the changes introduced by:

	commit 059499453a9abd1857d442b44da8b4c126dc72a8
	Author: Tejun Heo &lt;tj@kernel.org&gt;
	Date:   Fri Mar 7 10:24:50 2014 -0500
	Subject: afs: don't use PREPARE_WORK

which didn't go far enough.  The problem is due to:

 (1) The aforementioned commit introduced a separate handler function pointer
     in the call, call-&gt;async_workfn, in addition to the original workqueue
     item, call-&gt;async_work, for asynchronous operations because workqueues
     subsystem cannot handle the workqueue item pointer being changed whilst
     the item is queued or being processed.

 (2) afs_async_workfn() was introduced in that commit to be the callback for
     call-&gt;async_work.  Its sole purpose is to run whatever call-&gt;async_workfn
     points to.

 (3) call-&gt;async_workfn is only used from afs_async_workfn(), which is only
     set on async_work by afs_collect_incoming_call() - ie. for incoming
     calls.

 (4) call-&gt;async_workfn is *not* set by afs_make_call() when outgoing calls are
     made, and call-&gt;async_work is set afs_process_async_call() - and not
     afs_async_workfn().

 (5) afs_process_async_call() now changes call-&gt;async_workfn rather than
     call-&gt;async_work to point to afs_delete_async_call() to clean up, but this
     is only effective for incoming calls because call-&gt;async_work does not
     point to afs_async_workfn() for outgoing calls.

 (6) Because, for incoming calls, call-&gt;async_work remains pointing to
     afs_process_async_call() this results in an infinite loop.

Instead, make the workqueue uniformly vector through call-&gt;async_workfn, via
afs_async_workfn() and simply initialise call-&gt;async_workfn to point to
afs_process_async_call() in afs_make_call().

Signed-off-by: Nathaniel Wesley Filardo &lt;nwf@cs.jhu.edu&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>AFS: Part of afs_end_call() is identical to code elsewhere, so split it</title>
<updated>2014-05-23T12:05:15+00:00</updated>
<author>
<name>Nathaniel Wesley Filardo</name>
<email>nwf@cs.jhu.edu</email>
</author>
<published>2014-05-21T15:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=6cf12869f5c1a837f18af5f8b2308fa243772735'/>
<id>urn:sha1:6cf12869f5c1a837f18af5f8b2308fa243772735</id>
<content type='text'>
Split afs_end_call() into two pieces, one of which is identical to code in
afs_process_async_call().  Replace the latter with a call to the first part of
afs_end_call().

Signed-off-by: Nathaniel Wesley Filardo &lt;nwf@cs.jhu.edu&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>AFS: Fix cache manager service handlers</title>
<updated>2014-05-21T13:48:05+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2014-05-21T13:48:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=6c67c7c38cf32c2a9cbccb6b21aadf61a85fbfb4'/>
<id>urn:sha1:6c67c7c38cf32c2a9cbccb6b21aadf61a85fbfb4</id>
<content type='text'>
Fix the cache manager RPC service handlers.  The afs_send_empty_reply() and
afs_send_simple_reply() functions:

 (a) Kill the call and free up the buffers associated with it if they fail.

 (b) Return with call intact if it they succeed.

However, none of the callers actually check the result or clean up if
successful - and may use the now non-existent data if it fails.

This was detected by Dan Carpenter using a static checker:

	The patch 08e0e7c82eea: "[AF_RXRPC]: Make the in-kernel AFS
	filesystem use AF_RXRPC." from Apr 26, 2007, leads to the following
	static checker warning:
	"fs/afs/cmservice.c:155 SRXAFSCB_CallBack()
		 warn: 'call' was already freed."

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: don't use PREPARE_WORK</title>
<updated>2014-03-07T15:24:50+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-03-07T15:24:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=059499453a9abd1857d442b44da8b4c126dc72a8'/>
<id>urn:sha1:059499453a9abd1857d442b44da8b4c126dc72a8</id>
<content type='text'>
PREPARE_[DELAYED_]WORK() are being phased out.  They have few users
and a nasty surprise in terms of reentrancy guarantee as workqueue
considers work items to be different if they don't have the same work
function.

afs_call-&gt;async_work is multiplexed with multiple work functions.
Introduce afs_async_workfn() which invokes afs_call-&gt;async_workfn and
always use it as the work function and update the users to set the
-&gt;async_workfn field instead of overriding the work function using
PREPARE_WORK().

It would probably be best to route this with other related updates
through the workqueue tree.

Compile tested.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: linux-afs@lists.infradead.org
</content>
</entry>
<entry>
<title>afs: Remote abort can cause BUG in rxrpc code</title>
<updated>2012-03-17T00:01:41+00:00</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2012-03-16T10:28:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c0173863528a8c9212c53e080d63a1aaae5ef4f4'/>
<id>urn:sha1:c0173863528a8c9212c53e080d63a1aaae5ef4f4</id>
<content type='text'>
When writing files to afs I sometimes hit a BUG:

kernel BUG at fs/afs/rxrpc.c:179!

With a backtrace of:

	afs_free_call
	afs_make_call
	afs_fs_store_data
	afs_vnode_store_data
	afs_write_back_from_locked_page
	afs_writepages_region
	afs_writepages

The cause is:

	ASSERT(skb_queue_empty(&amp;call-&gt;rx_queue));

Looking at a tcpdump of the session the abort happens because we
are exceeding our disk quota:

	rx abort fs reply store-data error diskquota exceeded (32)

So the abort error is valid. We hit the BUG because we haven't
freed all the resources for the call.

By freeing any skbs in call-&gt;rx_queue before calling afs_free_call
we avoid hitting leaking memory and avoid hitting the BUG.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
