aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-03-10drbd: receive_bitmap: Avoid casting enum drbd_state_rv to intAndreas Gruenbacher1-2/+4
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: receive_bitmap: Fix the wrong return valueAndreas Gruenbacher1-1/+1
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: drbd_nl_disk_conf: Avoid a compiler warningAndreas Gruenbacher1-3/+4
Warning: comparison between ‘enum drbd_ret_code’ and ‘enum drbd_state_rv’ Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Use the standard bool, true, and false keywordsAndreas Gruenbacher8-101/+94
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: This code is dead nowAndreas Gruenbacher1-8/+2
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Another small enum drbd_state_rv cleanupAndreas Gruenbacher1-5/+9
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Be more explicit about functions that return an enum drbd_state_rvAndreas Gruenbacher4-55/+67
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Rename enum drbd_state_ret_codes to enum drbd_state_rvAndreas Gruenbacher3-5/+6
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Rename enum drbd_ret_codes to enum drbd_ret_codeAndreas Gruenbacher3-4/+4
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Get rid of unnecessary macros (2)Andreas Gruenbacher6-15/+14
The FAULT_ACTIVE macro just wraps the drbd_insert_fault macro for no apparent reason. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Get rid of unnecessary macros (1)Andreas Gruenbacher1-31/+40
This macro doesn't save much code, but makes things a lot harder to read. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Rename drbd_make_request_26 to drbd_make_requestAndreas Gruenbacher3-5/+5
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Remove left-over prototypeAndreas Gruenbacher1-2/+0
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Make sure that drbd_send() has sent the right number of bytesAndreas Gruenbacher1-2/+2
Reviewed-by: Lars Ellenberg <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2011-03-10drbd: fix incomplete error messageLars Ellenberg1-1/+1
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Removed an unnecessary #undefAndreas Gruenbacher1-1/+0
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: fix regression, we need to close drbd epochs during normal operationLars Ellenberg1-3/+8
commit e2041475e6ddb081734d161f6421977323f5a9b9 drbd: Starting with protocol 96 we can allow app-IO while receiving the bitmap Contained a bad chunk that tried to optimize away drbd barriers during bitmap exchange, but accidentally dropped them for normal mode as well. Impact: depending on activity log size and access pattern, activity log extents may not be recycled in time, causeing IO to block indefinetely. Fix: skip drbd barriers only if there is no connection to send them on, or the request being completed has not been on the network at all. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Implemented the before-resync-source handlerPhilipp Reisner1-0/+14
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: --force option for disconnectPhilipp Reisner2-1/+18
As the network connection can be lost at any time, a --force option for disconnect is just a matter of completeness. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: add packet_type 27 (return_code_only) to netlink apiLars Ellenberg3-3/+10
In case we ever should add an other packet type, we must not reuse 27, as that currently used for "empty" return code only replies. Document it as such. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: use kzalloc and memset(,0,) to start with clean buffers in drbd_nlLars Ellenberg1-2/+3
Make sure we start with clean buffers to not accidentally send garbage back to userspace. Note: has not been observed; but just in case. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: remove /proc/drbd before unregistering from netlinkLars Ellenberg1-2/+11
There still exists a (theoretical) race on module unload, where /proc/drbd may still exist, but the netlink callback has been unregistered already, allowing drbdsetup to shout without listeners, and get no reply. Reorder remove_proc_entry and unregister of netlink callback. drbdsetup first checks for existence of the proc entry, and if that is missing, won't even try to contact the module. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: increase module count on /proc/drbd accessLars Ellenberg1-2/+11
If someone holds /proc/drbd open, previously rmmod would "succeed" in starting the unload, but then block on remove_proc_entry, leading to a situation where the lsmod does not show drbd anymore, but /proc/drbd being still there (but no longer accessible). I'd rather have rmmod fail up front in this case. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Removed 20 seconds upper bound for side-steppingPhilipp Reisner1-3/+4
Given low-enough network bandwidth combined with a IO pattern that hammers onto a single RS-extent, side-stepping might be necessary for much longer times. Changed the code to print a single informal message after 20 seconds, but it keeps on stepping aside forever. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Becoming sync target may not happen out of < C_WF_REPORT_PARAMSPhilipp Reisner1-0/+4
This patch is acutally a necessary addendum to the patch "fix for spurious full sync (becoming sync target looked like invalidate)" Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Starting with protocol 96 we can allow app-IO while receiving the bitmapPhilipp Reisner4-31/+39
* C_STARTING_SYNC_S, C_STARTING_SYNC_T In these states the bitmap gets written to disk. Locking out of app-IO is done by using the drbd_queue_bitmap_io() and drbd_bitmap_io() functions these days. It is no longer necessary to lock out app-IO based on the connection state. App-IO that may come in after the BITMAP_IO flag got cleared before the state transition to C_SYNC_(SOURCE|TARGET) does not get mirrored, sets a bit in the local bitmap, that is already set, therefore changes nothing. * C_WF_BITMAP_S In this state we send updates (P_OUT_OF_SYNC packets). With that we make sure they have the same number of bits when going into the C_SYNC_(SOURCE|TARGET) connection state. * C_UNCONNECTED: The receiver starts, no need to lock out IO. * C_DISCONNECTING: in drbd_disconnect() we had a wait_event() to wait until ap_bio_cnt reaches 0. Removed that. * C_TIMEOUT, C_BROKEN_PIPE, C_NETWORK_FAILURE C_PROTOCOL_ERROR, C_TEAR_DOWN: Same as C_DISCONNECTING * C_WF_REPORT_PARAMS: IO still possible since that is still like C_WF_CONNECTION. And we do not need to send barriers in C_WF_BITMAP_S connection state. Allow concurrent accesses to the bitmap when receiving the bitmap. Everything gets ORed anyways. A drbd_free_tl_hash() is in after_state_chg_work(). At that point all the work items of the last connections must have been processed. Introduced a call to drbd_free_tl_hash() into drbd_free_mdev() for paranoia reasons. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Improvements in sanitize_state()Philipp Reisner1-55/+89
The relevant change is that the state change to C_FW_BITMAP_S should implicitly change pdsk to C_CONSISTENT. (Think of it as C_OUTDATED, only without the guarantee that the peer has the outdated written to its meta data) At that opportunity I restructured the switch statement so that it gets evaluated every time. (Has declarative character) Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Fixed race condition in drbd_queue_bitmap_ioPhilipp Reisner1-0/+2
May only test for ap_bio_cnt == 0 under req_lock. It can increase only under req_lock. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Fixed inc_ap_bio()Philipp Reisner1-17/+14
The condition must be checked after perpare_to_wait(). The old implementaion could loose wakeup events. Never observed in real life. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: use test_and_set_bit() to decide if bm_io_work should be queuedPhilipp Reisner1-4/+2
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Begin to account BIO processing time before inc_ap_bio()Philipp Reisner2-5/+8
Since inc_ap_bio() might sleep already Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Implemented side-stepping in drbd_res_begin_io()Philipp Reisner1-5/+19
Before: drbd_rs_begin_io() locked app-IO out of an RS extent, and waited then until all previous app-IO in that area finished. (But not only until the disk-IO was finished but until the barrier/epoch ack came in for that == round trip time latency ++) After: As soon as a new app-IO waits wants to start new IO on that RS extent, drbd_rs_begin_io() steps aside (clearing the BME_NO_WRITES flag again). It retries after 100ms. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Make some functions staticPhilipp Reisner2-5/+6
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Implemented priority inheritance for resync requestsPhilipp Reisner4-20/+27
We only issue resync requests if there is no significant application IO going on. = Application IO has higher priority than resnyc IO. If application IO can not be started because the resync process locked an resync_lru entry, start the IO operations necessary to release the lock ASAP. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Do not cleanup resync LRU for the Ahead/Behind SyncSource/SyncTarget ↵Philipp Reisner1-2/+7
transitions This one should be replaced with moving this cleanup to the 'right' position. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: When proxy's buffer drained off go into regular resync modePhilipp Reisner4-2/+22
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: New packet for Ahead/Behind mode: P_OUT_OF_SYNCPhilipp Reisner8-19/+91
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Implemented two new connection states Ahead/BehindPhilipp Reisner6-3/+45
In this connection mode, the ahead node no longer replicates application IO. The behind's disk becomes out dated. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: New configuration parameters for dealing with network congestionPhilipp Reisner4-0/+26
net { on_congestion {block|pull-ahead|disconnect}; congestion-fill {sectors}; congestion-extents {al-extents}; } Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Track the numbers of sectors in flightPhilipp Reisner4-6/+21
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: Renamed write_flags_to_bio() to wire_flags_to_bio()Lars Ellenberg1-14/+14
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: restore compatibility with 32bit kernelsLars Ellenberg1-4/+4
With commit drbd: further converge progress display of resync and online-verify accidentally an u64/u64 div was introduced, causing an unresolvable symbol __udivdi3 to be reference. Actually for that division, 32bit are still suficient for now, so we can revert to unsigned long instead. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: properly use max_hw_sectors to limit the our bio sizeLars Ellenberg7-42/+41
To ease tracking of bios in some hash tables, we want it to not cross certain boundaries (128k, used to be 32k). We limit the maximum bio size using queue parameters. Historically some defines and variables we use there have been named max_segment_size, which was misguided. Rename them to max_bio_size, and use [blk_]queue_max_hw_sectors where appropriate. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: debug: limit nelink-broadcast of request on digest mismatch to 32kLars Ellenberg1-2/+5
We used to be limited to 32k requests, but have increased that limit to 128k now. This part of the code can only deal with 32k, it would scramble arbitrary pages for larger requests. As it is used for debugging only anyways, it is ok to simply truncate the dumped data here. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: detect modification of in-flight buffersLars Ellenberg2-2/+29
With data-integrity digest enabled, double-check on the sending side for modifications by upper layers of buffers under write back, so we can tell it appart from corruption on the "wire". Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: further converge progress display of resync and online-verifyLars Ellenberg2-19/+31
Show progressbar and ETA always, with proc_details >= 1 also show the current sector position for both resync and online-verify on both nodes. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: fix potential wrap of 32bit oos:%lu display in /proc/drbdLars Ellenberg1-2/+3
When converting bits (4k resolution, still) to kB, we shift left. If it was a large number of bits on a 32bit box (>= 4 TiB storage), we may wrap the 32bit unsigned long base type, resulting in incorrect display. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: use the resync controller for online-verify requests as wellLars Ellenberg4-9/+14
Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: factor out drbd_rs_number_requestsLars Ellenberg1-32/+29
Preparation patch to be able to use the auto-throttling resync controller for online-verify requests as well. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>
2011-03-10drbd: factor out drbd_rs_controller_resetLars Ellenberg2-7/+13
Preparation patch to be able to use the auto-throttling resync controller for online-verify requests as well. Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Lars Ellenberg <[email protected]>