<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/afs/cmservice.c, 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:44Z</updated>
<entry>
<title>afs: Fix the handling of CB.InitCallBackState3 to find the server by UUID</title>
<updated>2018-06-20T19:01:44Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2018-05-11T22:21:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=97d8137763df271fb65c01b3b9e4db0202129ac7'/>
<id>urn:sha1:97d8137763df271fb65c01b3b9e4db0202129ac7</id>
<content type='text'>
[ Upstream commit 001ab5a67ee5d191c64aebf4b4ef8c7a0dcfd2bc ]

Fix the handling of the CB.InitCallBackState3 service call to find the
record of a server that we're using by looking it up by the UUID passed as
the parameter rather than by its address (of which it might have many, and
which may change).

Fixes: c35eccb1f614 ("[AFS]: Implement the CB.InitCallBackState3 operation.")
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: 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: Overhaul the callback handling</title>
<updated>2017-11-13T15:38:18Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c435ee34551e1f5a02a253ca8e235287efd2727c'/>
<id>urn:sha1:c435ee34551e1f5a02a253ca8e235287efd2727c</id>
<content type='text'>
Overhaul the AFS callback handling by the following means:

 (1) Don't give up callback promises on vnodes that we are no longer using,
     rather let them just expire on the server or let the server break
     them.  This is actually more efficient for the server as the callback
     lookup is expensive if there are lots of extant callbacks.

 (2) Only give up the callback promises we have from a server when the
     server record is destroyed.  Then we can just give up *all* the
     callback promises on it in one go.

 (3) Servers can end up being shared between cells if cells are aliased, so
     don't add all the vnodes being backed by a particular server into a
     big FID-indexed tree on that server as there may be duplicates.

     Instead have each volume instance (~= superblock) register an interest
     in a server as it starts to make use of it and use this to allow the
     processor for callbacks from the server to find the superblock and
     thence the inode corresponding to the FID being broken by means of
     ilookup_nowait().

 (4) Rather than iterating over the entire callback list when a mass-break
     comes in from the server, maintain a counter of mass-breaks in
     afs_server (cb_seq) and make afs_validate() check it against the copy
     in afs_vnode.

     It would be nice not to have to take a read_lock whilst doing this,
     but that's tricky without using RCU.

 (5) Save a ref on the fileserver we're using for a call in the afs_call
     struct so that we can access its cb_s_break during call decoding.

 (6) Write-lock around callback and status storage in a vnode and read-lock
     around getattr so that we don't see the status mid-update.

This has the following consequences:

 (1) Data invalidation isn't seen until someone calls afs_validate() on a
     vnode.  Unfortunately, we need to use a key to query the server, but
     getting one from a background thread is tricky without caching loads
     of keys all over the place.

 (2) Mass invalidation isn't seen until someone calls afs_validate().

 (3) Callback breaking is going to hit the inode_hash_lock quite a bit.
     Could this be replaced with rcu_read_lock() since inodes are destroyed
     under RCU conditions.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Rename struct afs_call server member to cm_server</title>
<updated>2017-11-13T15:38:18Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0676a16781d0972969dff8b3f3f819599cc4b07'/>
<id>urn:sha1:d0676a16781d0972969dff8b3f3f819599cc4b07</id>
<content type='text'>
Rename the server member of struct afs_call to cm_server as we're only
going to be using it for incoming calls for the Cache Manager service.
This makes it easier to differentiate from the pointer to the target server
for the client, which will point to a different structure to allow for
callback handling.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Connect up the CB.ProbeUuid</title>
<updated>2017-11-13T15:38:18Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f4b3526d83c40dd8bf5948b9d7a1b2c340f0dcc8'/>
<id>urn:sha1:f4b3526d83c40dd8bf5948b9d7a1b2c340f0dcc8</id>
<content type='text'>
The handler for the CB.ProbeUuid operation in the cache manager is
implemented, but isn't listed in the switch-statement of operation
selection, so won't be used.  Fix this by adding it.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Consolidate abort_to_error translators</title>
<updated>2017-11-13T15:38:17Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f780c8ea0e73c0d371ffbebff91bb7555697219f'/>
<id>urn:sha1:f780c8ea0e73c0d371ffbebff91bb7555697219f</id>
<content type='text'>
The AFS abort code space is shared across all services, so there's no need
for separate abort_to_error translators for each service.

Consolidate them into a single function and remove the function pointers
for them.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Push the net ns pointer to more places</title>
<updated>2017-11-13T15:38:17Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ed900b1160ef306bc74ad0228d7ab199234c758'/>
<id>urn:sha1:9ed900b1160ef306bc74ad0228d7ab199234c758</id>
<content type='text'>
Push the network namespace pointer to more places in AFS, including the
afs_server structure (which doesn't hold a ref on the netns).

In particular, afs_put_cell() now takes requires a net ns parameter so that
it can safely alter the netns after decrementing the cell usage count - the
cell will be deallocated by a background thread after being cached for a
period, which means that it's not safe to access it after reducing its
usage count.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Lay the groundwork for supporting network namespaces</title>
<updated>2017-11-13T15:38:16Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2017-11-02T15:27:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f044c8847bb61eff5e1e95b6f6bb950e7f4a73a4'/>
<id>urn:sha1:f044c8847bb61eff5e1e95b6f6bb950e7f4a73a4</id>
<content type='text'>
Lay the groundwork for supporting network namespaces (netns) to the AFS
filesystem by moving various global features to a network-namespace struct
(afs_net) and providing an instance of this as a temporary global variable
that everything uses via accessor functions for the moment.

The following changes have been made:

 (1) Store the netns in the superblock info.  This will be obtained from
     the mounter's nsproxy on a manual mount and inherited from the parent
     superblock on an automount.

 (2) The cell list is made per-netns.  It can be viewed through
     /proc/net/afs/cells and also be modified by writing commands to that
     file.

 (3) The local workstation cell is set per-ns in /proc/net/afs/rootcell.
     This is unset by default.

 (4) The 'rootcell' module parameter, which sets a cell and VL server list
     modifies the init net namespace, thereby allowing an AFS root fs to be
     theoretically used.

 (5) The volume location lists and the file lock manager are made
     per-netns.

 (6) The AF_RXRPC socket and associated I/O bits are made per-ns.

The various workqueues remain global for the moment.

Changes still to be made:

 (1) /proc/fs/afs/ should be moved to /proc/net/afs/ and a symlink emplaced
     from the old name.

 (2) A per-netns subsys needs to be registered for AFS into which it can
     store its per-netns data.

 (3) Rather than the AF_RXRPC socket being opened on module init, it needs
     to be opened on the creation of a superblock in that netns.

 (4) The socket needs to be closed when the last superblock using it is
     destroyed and all outstanding client calls on it have been completed.
     This prevents a reference loop on the namespace.

 (5) It is possible that several namespaces will want to use AFS, in which
     case each one will need its own UDP port.  These can either be set
     through /proc/net/afs/cm_port or the kernel can pick one at random.
     The init_ns gets 7001 by default.

Other issues that need resolving:

 (1) The DNS keyring needs net-namespacing.

 (2) Where do upcalls go (eg. DNS request-key upcall)?

 (3) Need something like open_socket_in_file_ns() syscall so that AFS
     command line tools attempting to operate on an AFS file/volume have
     their RPC calls go to the right place.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>uuid,afs: move struct uuid_v1 back into afs</title>
<updated>2017-06-05T14:56:34Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2017-05-28T05:56:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=41bb26f8db3ad33b083e57eb9fc5828796110e77'/>
<id>urn:sha1:41bb26f8db3ad33b083e57eb9fc5828796110e77</id>
<content type='text'>
This essentially is a partial revert of commit ff548773
("afs: Move UUID struct to linux/uuid.h") and moves struct uuid_v1 back into
fs/afs as struct afs_uuid.  It however keeps it as big endian structure
so that we can use the normal uuid generation helpers when casting to/from
struct afs_uuid.

The V1 uuid intrepretation in struct form isn't really useful to the
rest of the kernel, and not really compatible to it either, so move it
back to AFS instead of polluting the global uuid.h.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>afs: Deal with an empty callback array</title>
<updated>2017-03-16T16:27:44Z</updated>
<author>
<name>Marc Dionne</name>
</author>
<published>2017-03-16T16:27:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bcd89270d93b7edebb5de5e5e7dca1a77a33496e'/>
<id>urn:sha1:bcd89270d93b7edebb5de5e5e7dca1a77a33496e</id>
<content type='text'>
Servers may send a callback array that is the same size as
the FID array, or an empty array.  If the callback count is
0, the code would attempt to read (fid_count * 12) bytes of
data, which would fail and result in an unmarshalling error.
This would lead to stale data for remotely modified files
or directories.

Store the callback array size in the internal afs_call
structure and use that to determine the amount of data to
read.

Signed-off-by: Marc Dionne &lt;marc.dionne@auristor.com&gt;
</content>
</entry>
</feed>
