summaryrefslogtreecommitdiffstats
path: root/src/kernel/blk.c
Commit message (Collapse)AuthorAgeFilesLines
* [KERNEL] Cleanup thread cleanup, fix closing of device when busySimon Rettberg2020-11-201-40/+33Star
|
* [KERNEL] Fix several connect/disconnect race conditionsSimon Rettberg2020-11-191-13/+44
| | | | | | | | | | | | | | | | | | | 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->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.
* [CLIENT] display proper connected server if multiple servers specifiedManuel Bentele2020-11-101-2/+2
| | | | | | | 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.
* [KERNEL] add manual switching of dnbd3-server to specified serverManuel Bentele2020-11-101-1/+64
| | | | | | 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.
* [KERNEL] protect read-only access to server listManuel Bentele2020-11-091-6/+9
| | | | | | | | | | 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
* [KERNEL] protect access to server list if alt server is added/removedManuel Bentele2020-11-091-0/+3
| | | | | | 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.
* [KERNEL]: change probing logic to select first available serverManuel Bentele2020-11-091-15/+24
| | | | | | | 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.
* [KERNEL, CLIENT]: submit and probe multiple dnbd3-server with ioctl OPENManuel Bentele2020-11-061-13/+41
| | | | | | | | | | The ioctl OPEN call for DNBD3 devices exposed by the dnbd3 Linux kernel module, is extended with a fixed array of dnbd3 hosts. The fixed array allows the dnbd3-client to submit host information (IP address and port) of multiple dnbd3-servers. This information is used to probe all submitted dnbd3-servers and add them to the alternative dnbd3-server list. If at least one dnbd3-server is not reachable, the OPEN ioctl call will abort with an error code.
* [BUILD] rewrite CMake build system to track changes of source filesManuel Bentele2020-10-161-1/+1
| | | | | | | | | | This change restructures the source code directories, separates shared form non-shared application code and adds CMake dependencies. These dependencies allow the tracking of changes and trigger a rebuild of those build targets where changed files are involved. WARNING: Note that the support of the DNBD3_SERVER_AFL build option is not supported yet. Thus, the option should be never turned on.
* [KERNEL] convert debug messages and clean up codeManuel Bentele2020-08-281-29/+9Star
| | | | | | | | | | | | This change converts all debug messages to support the Linux kernel's dynamic debug feature. Debug messages can be enabled or disabled by the debug feature if the - kernel module is built in debug mode (EXTRA_CFLAGS=-g -DDEBUG) - Linux kernel supports dynamic debug (CONFIG_DYNAMIC_DEBUG is set) This patch removes outdated kernel compatibility macros (used for Linux kernels in version 4.x) and cleans up the kernel module's code.
* [KERNEL] convert to blk-mq and ktimeManuel Bentele2020-08-271-120/+156
| | | | | | | | | | | This converts the dnbd3 kernel module driver to use the blk-mq infrastructure, which allows the dnbd3 kernel module driver to be compatible with Linux kernels in version 5.x or later. The conversion of the implementation uses one hardware queue to preserve the existing send/receive and load-balancing logic, but can be scaled up in the future. In addition to that, time measurements in the implementation are converted to ktime based accessors to replace the use of deprecated time interfaces.
* [KERNEL] Lower queue->limits.max_sectors to 256, like nbdSimon Rettberg2019-02-131-1/+1
|
* [KERNEL] Add support for kernel 4.17.xSimon Rettberg2018-07-061-0/+11
|
* [KERNEL] Pre/post 4.11 handling of request opsJonathan Bauer2018-04-051-4/+20
|
* Follow ↵Rafael Gieschke2018-03-231-4/+4
| | | | https://github.com/torvalds/linux/commit/aebf526b53aea164508730427597d45f3e06b376
* [KERNEL] version check to support pointer to backing_dev_info in request_queueSimon Rettberg2017-10-091-0/+6
| | | | | This changed in 4.11, see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc3b17cc8bf21307c7e076e7c778d5db756f7871
* [*] Continue splitting #defines to clientconfig.h etc.Simon Rettberg2017-09-021-0/+1
|
* [KERNEL] PAGE_CACHE_SIZE -> PAGE_SIZESimon Rettberg2016-10-171-1/+1
| | | | | | | These two have been the same all along and recently, the _CACHE variant has been removed (kernel 4.6). Switch to the non-CACHE version so build doesn't break on newer kernels.
* [KERNEL/CLIENT] Several minor tweaks and changesSimon Rettberg2016-01-111-2/+2
| | | | | | | | | | - Disable panic timeout that reports errors to block layer by default - Get rid of "is_server" used by old proxy mode, introduce "honor_server_alts" that just controls whether we use alts provided by the server - Allow switching servers when we only have 3 RTT measurements - If using alts provided by server, don't ignore those that come from other servers than the initial one
* [SERVER] Minor tweaks here and thereSimon Rettberg2013-11-101-12/+1Star
|
* [KERNEL] Check for invalid ioctls to prevent kernel panics :)Simon Rettberg2013-08-191-12/+21
|
* fix deadlocksr2013-07-181-7/+18
|
* kernel module changessr2013-07-181-2/+10
|
* [SERVER] Automatically connect a dnbd3 device for a relayed imagesr2012-09-091-20/+24
| | | | | | [SERVER] Automatically disconnect dnbd3 device if local cache copy is complete [SERVER] Pre-allocate disk space for cache file [KERNEL] Refuse connection if server reports disk size < 4096 bytes
* [SERVER] Automatically assign and connect a dnbd3 device to a relayed imagesr2012-09-061-3/+11
|
* [SERVER] Check which dnbd3 devices are idle and ready to use for proxy modesr2012-09-031-9/+5Star
| | | | | | [SERVER] Skeleton of server-to-server communication [SERVER] Update access-time of images in use by actual clients [*] Add dnbd3_host_t type to handle address+port+addrtype consistently across the project
* [*] Fixed and unified formattingsr2012-09-031-160/+160
|
* [KERNEL] Tell server whether we're a client or a server in proxy modesr2012-09-011-1/+1
| | | | | [KERNEL] SysFS: Return empty string for current_server if not connected [SERVER] Code refactoring
* [KERNEL] Add IOCTLs to add and remove serverssr2012-08-281-2/+28
| | | | | [KERNEL] Detect dead idle connection earlier [KERNEL] Improved debug output
* [KERNEL] Refactor and extend sysfs (add data the server will need in proxy mode)sr2012-08-271-6/+7
| | | | | | | [SERVER] Use MSG_MORE instead of cork/uncork to save two syscalls [KERNEL] Fail-Counter for alt servers, ignore servers that fail too often [KERNEL] Add new alt servers to list, instead of replacing the old list [*] Add CMD_LATEST_RID to tell client about new revisions
* [KERNEL] Only update alt-server list if received from initial serversr2012-08-251-0/+1
| | | | [*] Add CMD_KEEPALIVE protocol message type
* [KERNEL] Make it possible to receive push messages by the serversr2012-08-251-12/+30
|
* [*] Fix bug in serializer_get_*sr2012-08-251-3/+21
| | | | | | [CLIENT/KERNEL] Change ioctl to handle volume names instead if vids [*] Make protocol endian safe [CLIENT] Display ioctl errorcode on failure
* [*] Cleanup, comments, more error checkssr2012-08-241-20/+114
| | | | | | | | [SERVER] Fix a few off-by-one bugs [SERVER] Make log available through IPC [KERNEL] Hot-Swap to faster connection on load-balance [KERNEL] Report I/O error to block layer if no server replies within a given time frame [*] Modified network protocol to handle volume names instead of ids
* [ALL] Some cleanupJohann Latocha2012-05-211-7/+9
|
* [KERNEL] Set proper exit status on connectionJohann Latocha2012-05-081-4/+2Star
|
* [KERNEL] Notify if new release available (sysfs)Johann Latocha2012-04-201-0/+1
|
* [SERVER] Cache improvedJohann Latocha2012-04-111-9/+0Star
|
* [KERNEL] Support for kernel 2.6.32Johann Latocha2012-03-161-0/+5
|
* [SERVER] Cache images on hddJohann Latocha2012-03-061-0/+4
|
* [KERNEL] Read ahead increasedJohann Latocha2012-02-231-0/+6
|
* [ALL] Bugs, bugs, bugs...Johann Latocha2012-02-221-4/+1Star
|
* [KERNEL] SysFS interface added (/sys/block/dnbd*/net/)Johann Latocha2012-02-211-6/+14
|
* [KERNEL] KP on rmmod fixedJohann Latocha2012-02-201-9/+1Star
|
* [KERNEL] Switch server on connection lostJohann Latocha2012-02-161-0/+2
|
* [SERVER] Memleak fixedJohann Latocha2012-02-151-0/+2
| | | | [KERNEL] Socket swap fixed
* [SERVER] Config reload fixedJohann Latocha2012-02-101-2/+3
|
* [ALL] RefactoringJohann Latocha2012-02-081-17/+17
| | | | | [ALL] Send and receive servers [TODO] Config file reloading is broken
* [KERNEL] Segfault at closing device fixedJohann Latocha2012-02-061-0/+2
|
* [KERNEL] Device can now be closedJohann Latocha2012-02-031-15/+23
|