<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dnbd3.git/src/kernel, branch formatting</title>
<subtitle>Distributed Network Block Device 3 --rewrite for Kernel 3.x</subtitle>
<id>https://git.openslx.org/dnbd3.git/atom/src/kernel?h=formatting</id>
<link rel='self' href='https://git.openslx.org/dnbd3.git/atom/src/kernel?h=formatting'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/'/>
<updated>2021-03-04T07:47:43+00:00</updated>
<entry>
<title>[BUILD] Add support in CMake to validate (lint) the source code</title>
<updated>2021-03-04T07:47:43+00:00</updated>
<author>
<name>Manuel Bentele</name>
</author>
<published>2021-03-04T07:47:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=2b5631eaa444023043a18ff3985f5a0e7a11436a'/>
<id>urn:sha1:2b5631eaa444023043a18ff3985f5a0e7a11436a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[KERNEL] Fix race condition for request_queuereceive in receive thread</title>
<updated>2020-11-20T13:19:21+00:00</updated>
<author>
<name>Simon Rettberg</name>
</author>
<published>2020-11-20T13:19:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=b4d8353913a2f54a9bce314e84415e868dc096cb'/>
<id>urn:sha1:b4d8353913a2f54a9bce314e84415e868dc096cb</id>
<content type='text'>
Formerly, the request that was about to be received was looked up in
the receive queue without removing it, then the request payload was
received from the socket while the lock was not being held, and finally,
the lock was required again and the request removed from the queue.
This is dangrous as another thread can concurrently take the request
from the queue while the receive thread reads the payload from the
socket, leading to a double-free by calling blk_mq_end_request twice.
</content>
</entry>
<entry>
<title>[KERNEL] Cleanup thread cleanup, fix closing of device when busy</title>
<updated>2020-11-20T12:47:16+00:00</updated>
<author>
<name>Simon Rettberg</name>
</author>
<published>2020-11-20T12:47:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=f4ad97dd38c134be53f4bbb30d9fb9cd2ef19844'/>
<id>urn:sha1:f4ad97dd38c134be53f4bbb30d9fb9cd2ef19844</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[KERNEL] Fix several connect/disconnect race conditions</title>
<updated>2020-11-19T12:48:14+00:00</updated>
<author>
<name>Simon Rettberg</name>
</author>
<published>2020-11-19T12:48:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=a1caec1f2bebe09f685716f13d7b55f84d8a8145'/>
<id>urn:sha1:a1caec1f2bebe09f685716f13d7b55f84d8a8145</id>
<content type='text'>
Previously disconnect was protected against concurrent calls, but connect
wasn't. It was easy to crash the kernel when calling connect and
disconnect IOCTLs in a tight loop concurrently.
A global lock was introduced to make sure only one caller can change the
connection state at a time. dev-&gt;connection_lock needs to be aquired
when calling dnbd3_net_connect or _disconnect.
This atomic_t based locking mechanism should be turned into a mutex in a
next step, relying on mutex_trylock for cases where we don't have the
cmpxchg-schedule() loop.

Along the way it was noticed that the send/receive timeouts don't apply
to kernel_connect, which might have been the case in older 3.x kernel
versions. A crude workaround using nonblocking connect has been
introduced to emulate this, but a clean solution for this is welcomed.

Also, devices are now properly closed on module unload.
</content>
</entry>
<entry>
<title>[KERNEL] add support for Linux kernel 4.19 on Ubuntu 18.04 (GCC 7.5)</title>
<updated>2020-11-16T08:01:54+00:00</updated>
<author>
<name>Manuel Bentele</name>
</author>
<published>2020-11-16T08:01:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=9bd0efee359d5436b3b8433dc76c69315b1126a3'/>
<id>urn:sha1:9bd0efee359d5436b3b8433dc76c69315b1126a3</id>
<content type='text'>
This patch replaces the __VA_OPT__ varadic macro for the C preprocessor
with a builtin GCC extension for optional varadic arguments. Based on
this change, the dnbd3 Linux kernel module can be also built with GCC
7.5 on a fresh Ubuntu 18.04 with Linux kernel version 4.19.x.
</content>
</entry>
<entry>
<title>[CLIENT] display proper connected server if multiple servers specified</title>
<updated>2020-11-10T07:29:18+00:00</updated>
<author>
<name>Manuel Bentele</name>
</author>
<published>2020-11-10T07:29:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=ea63e29a34037b91e9b2cc2ec37e43bf302b682d'/>
<id>urn:sha1:ea63e29a34037b91e9b2cc2ec37e43bf302b682d</id>
<content type='text'>
With this change, the dnbd3-client is able to display the selected
server (choosen by the Linux kernel module) after successful probing.
Therefore, the ioctl call OPEN returns the selected server host as
index of the specified dnbd3-server hosts after successful probing.
</content>
</entry>
<entry>
<title>[KERNEL] add manual switching of dnbd3-server to specified server</title>
<updated>2020-11-10T06:42:40+00:00</updated>
<author>
<name>Manuel Bentele</name>
</author>
<published>2020-11-10T06:42:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=5a430387ffc52d1520e3c6bbc7ef664b282c9644'/>
<id>urn:sha1:5a430387ffc52d1520e3c6bbc7ef664b282c9644</id>
<content type='text'>
This patch adds the feature to manually switch the dnbd3-server to a
specified server. The switching is implemented by the use of the ioctl
call SWITCH.
</content>
</entry>
<entry>
<title>[KERNEL] protect read-only access to server list</title>
<updated>2020-11-09T06:48:36+00:00</updated>
<author>
<name>Manuel Bentele</name>
</author>
<published>2020-11-09T06:48:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=07684ba72271a1307124eb71904f5c5aa1aebe43'/>
<id>urn:sha1:07684ba72271a1307124eb71904f5c5aa1aebe43</id>
<content type='text'>
This patch completes the changes from the last commit [1] and protects
in addition the read-only access to the alternative list of new servers.
Otherwise a race condition between ioctl ADD_SRV/REM_SRV (process
context) and dnbd3 discover thread would be possible since the
'new_servers_num' field is changed in both contexts.

[1] - DNBD3 commit db5a93a43fea2aa3c3bbaf8c48d238e60d834676
</content>
</entry>
<entry>
<title>[KERNEL] protect access to server list if alt server is added/removed</title>
<updated>2020-11-09T06:16:07+00:00</updated>
<author>
<name>Manuel Bentele</name>
</author>
<published>2020-11-09T06:16:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=db5a93a43fea2aa3c3bbaf8c48d238e60d834676'/>
<id>urn:sha1:db5a93a43fea2aa3c3bbaf8c48d238e60d834676</id>
<content type='text'>
This patch locks the protecting spinlock of the DNBD3 device's new
server list. Otherwise a race condition between ioctl ADD_SRV/REM_SRV
(process context) and dnbd3 discover thread would be possible.
</content>
</entry>
<entry>
<title>[KERNEL]: change probing logic to select first available server</title>
<updated>2020-11-09T05:54:54+00:00</updated>
<author>
<name>Manuel Bentele</name>
</author>
<published>2020-11-09T05:54:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/dnbd3.git/commit/?id=03db52349890088b8ceaec17736bbd2d0769b52a'/>
<id>urn:sha1:03db52349890088b8ceaec17736bbd2d0769b52a</id>
<content type='text'>
This patch changes the probing logic to select the first available
dnbd3-server submitted by the ioctl OPEN call. All other specified
dnbd3-servers are added to the alternative server list and do not have
to be available.
</content>
</entry>
</feed>
