<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/afs/internal.h, branch linux-4.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-06-20T19:01:43Z</updated>
<entry>
<title>afs: Fix refcounting in callback registration</title>
<updated>2018-06-20T19:01:43Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2018-05-10T07:43:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=350c1869e9adc3b2881b9c1575937bbc0f31f353'/>
<id>urn:sha1:350c1869e9adc3b2881b9c1575937bbc0f31f353</id>
<content type='text'>
[ Upstream commit d4a96bec7a7362834ef5c31d7b2cc9bf36eb0570 ]

The refcounting on afs_cb_interest struct objects in
afs_register_server_cb_interest() is wrong as it uses the server list
entry's call back interest pointer without regard for the fact that it
might be replaced at any time and the object thrown away.

Fix this by:

 (1) Put a lock on the afs_server_list struct that can be used to
     mediate access to the callback interest pointers in the servers array.

 (2) Keep a ref on the callback interest that we get from the entry.

 (3) Dropping the old reference held by vnode-&gt;cb_interest if we replace
     the pointer.

Fixes: c435ee34551e ("afs: Overhaul the callback handling")
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>afs: Support the AFS dynamic root</title>
<updated>2018-02-06T14:43:37Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2018-02-06T06:26:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d673da14533b32fe8d3125b5b7be4fea14e39a8'/>
<id>urn:sha1:4d673da14533b32fe8d3125b5b7be4fea14e39a8</id>
<content type='text'>
Support the AFS dynamic root which is a pseudo-volume that doesn't connect
to any server resource, but rather is just a root directory that
dynamically creates mountpoint directories where the name of such a
directory is the name of the cell.

Such a mount can be created thus:

	mount -t afs none /afs -o dyn

Dynamic root superblocks aren't shared except by bind mounts and
propagation.  Cell root volumes can then be mounted by referring to them by
name, e.g.:

	ls /afs/grand.central.org/
	ls /afs/.grand.central.org/

The kernel will upcall to consult the DNS if the address wasn't supplied
directly.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Properly reset afs_vnode (inode) fields</title>
<updated>2017-12-01T11:51:24Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-12-01T11:40:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8de483e7440b0d23ce6372b3ef8358841c8827b'/>
<id>urn:sha1:f8de483e7440b0d23ce6372b3ef8358841c8827b</id>
<content type='text'>
When an AFS inode is allocated by afs_alloc_inode(), the allocated
afs_vnode struct isn't necessarily reset from the last time it was used as
an inode because the slab constructor is only invoked once when the memory
is obtained from the page allocator.

This means that information can leak from one inode to the next because
we're not calling kmem_cache_zalloc().  Some of the information isn't
reset, in particular the permit cache pointer.

Bring the clearances up to date.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marc Dionne &lt;marc.dionne@auristor.com&gt;
</content>
</entry>
<entry>
<title>afs: Fix file locking</title>
<updated>2017-11-17T10:06:13Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-13T16:59:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0fafdc9f888b42499001b7ca9d9f371c0b2932f4'/>
<id>urn:sha1:0fafdc9f888b42499001b7ca9d9f371c0b2932f4</id>
<content type='text'>
Fix the AFS file locking whereby the use of the big kernel lock (which
could be slept with) was replaced by a spinlock (which couldn't).  The
problem is that the AFS code was doing stuff inside the critical section
that might call schedule(), so this is a broken transformation.

Fix this by the following means:

 (1) Use a state machine with a proper state that can only be changed under
     the spinlock rather than using a collection of bit flags.

 (2) Cache the key used for the lock and the lock type in the afs_vnode
     struct so that the manager work function doesn't have to refer to a
     file_lock struct that's been dequeued.  This makes signal handling
     safer.

 (4) Move the unlock from afs_do_unlk() to afs_fl_release_private() which
     means that unlock is achieved in other circumstances too.

 (5) Unlock the file on the server before taking the next conflicting lock.

Also change:

 (1) Check the permits on a file before actually trying the lock.

 (2) fsync the file before effecting an explicit unlock operation.  We
     don't fsync if the lock is erased otherwise as we might not be in a
     context where we can actually do that.

Further fixes:

 (1) Fixed-fileserver address rotation is made to work.  It's only used by
     the locking functions, so couldn't be tested before.

Fixes: 72f98e72551f ("locks: turn lock_flocks into a spinlock")
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
cc: jlayton@redhat.com
</content>
</entry>
<entry>
<title>afs: Protect call-&gt;state changes against signals</title>
<updated>2017-11-13T15:38:21Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98bf40cd99fcfed0705812b6cbdbb3b441a42970'/>
<id>urn:sha1:98bf40cd99fcfed0705812b6cbdbb3b441a42970</id>
<content type='text'>
Protect call-&gt;state changes against the call being prematurely terminated
due to a signal.

What can happen is that a signal causes afs_wait_for_call_to_complete() to
abort an afs_call because it's not yet complete whilst afs_deliver_to_call()
is delivering data to that call.

If the data delivery causes the state to change, this may overwrite the state
of the afs_call, making it not-yet-complete again - but no further
notifications will be forthcoming from AF_RXRPC as the rxrpc call has been
aborted and completed, so kAFS will just hang in various places waiting for
that call or on page bits that need clearing by that call.

A tracepoint to monitor call state changes is also provided.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Implement shared-writeable mmap</title>
<updated>2017-11-13T15:38:21Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1cf7a1518aefa69ac6ba0c3f9206073e4221e3c8'/>
<id>urn:sha1:1cf7a1518aefa69ac6ba0c3f9206073e4221e3c8</id>
<content type='text'>
Implement shared-writeable mmap for AFS.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Get rid of the afs_writeback record</title>
<updated>2017-11-13T15:38:20Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4343d00872e1de9a470d951bf09bdd18bc73f555'/>
<id>urn:sha1:4343d00872e1de9a470d951bf09bdd18bc73f555</id>
<content type='text'>
Get rid of the afs_writeback record that kAFS is using to match keys with
writes made by that key.

Instead, keep a list of keys that have a file open for writing and/or
sync'ing and iterate through those.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Introduce a file-private data record</title>
<updated>2017-11-13T15:38:20Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=215804a99283c57fdd869aab350fdf6acc3460b6'/>
<id>urn:sha1:215804a99283c57fdd869aab350fdf6acc3460b6</id>
<content type='text'>
Introduce a file-private data record for kAFS and put the key into it
rather than storing the key in file-&gt;private_data.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Fix directory read/modify race</title>
<updated>2017-11-13T15:38:20Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dab17c1add5c51b68027a9a3861af3a99cb5485a'/>
<id>urn:sha1:dab17c1add5c51b68027a9a3861af3a99cb5485a</id>
<content type='text'>
Because parsing of the directory wasn't being done under any sort of lock,
the pages holding the directory content can get invalidated whilst the
parsing is ongoing.

Further, the directory page check function gets called outside of the page
lock, so if the page gets cleared or updated, this may return reports of
bad magic numbers in the directory page.

Also, the directory may change size whilst checking and parsing are
ongoing, so more care needs to be taken here.

Fix this by:

 (1) Perform the page check from the page filling function before we set
     PageUptodate and drop the page lock.

 (2) Check for the file having shrunk and the page having been abandoned
     before checking the page contents.

 (3) Lock the page whilst parsing it for the directory iterator.

Whilst we're at it, add a tracepoint to report check failure.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Trace the initiation and completion of client calls</title>
<updated>2017-11-13T15:38:19Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=025db80c9e421efef11f2b83b7f78a11476f06db'/>
<id>urn:sha1:025db80c9e421efef11f2b83b7f78a11476f06db</id>
<content type='text'>
Add tracepoints to trace the initiation and completion of client calls
within the kafs filesystem.

The afs_make_vl_call tracepoint watches calls to the volume location
database server.

The afs_make_fs_call tracepoint watches calls to the file server.

The afs_call_done tracepoint watches for call completion.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
</feed>
