diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-05-31 07:07:24 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:57:49 -0500 |
commit | d942ae44537669418a7cbfd916531d30513dbca8 (patch) | |
tree | b5828318e7ffe375b3d709c634c3430292d9f376 | |
parent | 4dbdae3ec9c75f570e2f128fd25b49ff1fa2a4de (diff) |
drbd: Fixes from the 8.3 development branch
* commit 'ae57a0a':
drbd: Only print sanitize state's warnings, if the state change happens
drbd: we should write meta data updates with FLUSH FUA
drbd: fix limit define, we support 1 PiByte now
drbd: fix log message argument order
drbd: Typo in user-visible message.
drbd: Make "(rcv|snd)buf-size" and "ping-timeout" available for the proxy, too.
drbd: Allow keywords to be used in multiple config sections.
drbd: fix typos in comments.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 10 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_state.c | 56 | ||||
-rw-r--r-- | include/linux/drbd_limits.h | 2 |
3 files changed, 47 insertions, 21 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index de42c7cf7caf..1d71b3a3586a 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -372,11 +372,11 @@ struct p_connection_features { | |||
372 | u32 protocol_max; | 372 | u32 protocol_max; |
373 | 373 | ||
374 | /* should be more than enough for future enhancements | 374 | /* should be more than enough for future enhancements |
375 | * for now, feature_flags and the reserverd array shall be zero. | 375 | * for now, feature_flags and the reserved array shall be zero. |
376 | */ | 376 | */ |
377 | 377 | ||
378 | u32 _pad; | 378 | u32 _pad; |
379 | u64 reserverd[7]; | 379 | u64 reserved[7]; |
380 | } __packed; | 380 | } __packed; |
381 | 381 | ||
382 | struct p_barrier { | 382 | struct p_barrier { |
@@ -914,7 +914,7 @@ struct drbd_conf { | |||
914 | atomic_t ap_bio_cnt; /* Requests we need to complete */ | 914 | atomic_t ap_bio_cnt; /* Requests we need to complete */ |
915 | atomic_t ap_pending_cnt; /* AP data packets on the wire, ack expected */ | 915 | atomic_t ap_pending_cnt; /* AP data packets on the wire, ack expected */ |
916 | atomic_t rs_pending_cnt; /* RS request/data packets on the wire */ | 916 | atomic_t rs_pending_cnt; /* RS request/data packets on the wire */ |
917 | atomic_t unacked_cnt; /* Need to send replys for */ | 917 | atomic_t unacked_cnt; /* Need to send replies for */ |
918 | atomic_t local_cnt; /* Waiting for local completion */ | 918 | atomic_t local_cnt; /* Waiting for local completion */ |
919 | 919 | ||
920 | /* Interval tree of pending local requests */ | 920 | /* Interval tree of pending local requests */ |
@@ -2153,7 +2153,7 @@ static inline int drbd_state_is_stable(struct drbd_conf *mdev) | |||
2153 | /* disk state is stable as well. */ | 2153 | /* disk state is stable as well. */ |
2154 | break; | 2154 | break; |
2155 | 2155 | ||
2156 | /* no new io accepted during tansitional states */ | 2156 | /* no new io accepted during transitional states */ |
2157 | case D_ATTACHING: | 2157 | case D_ATTACHING: |
2158 | case D_FAILED: | 2158 | case D_FAILED: |
2159 | case D_NEGOTIATING: | 2159 | case D_NEGOTIATING: |
@@ -2217,7 +2217,7 @@ static inline void inc_ap_bio(struct drbd_conf *mdev) | |||
2217 | /* we wait here | 2217 | /* we wait here |
2218 | * as long as the device is suspended | 2218 | * as long as the device is suspended |
2219 | * until the bitmap is no longer on the fly during connection | 2219 | * until the bitmap is no longer on the fly during connection |
2220 | * handshake as long as we would exeed the max_buffer limit. | 2220 | * handshake as long as we would exceed the max_buffer limit. |
2221 | * | 2221 | * |
2222 | * to avoid races with the reconnect code, | 2222 | * to avoid races with the reconnect code, |
2223 | * we need to atomic_inc within the spinlock. */ | 2223 | * we need to atomic_inc within the spinlock. */ |
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 8c9d0348736d..2cf69b25f1e7 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c | |||
@@ -37,6 +37,15 @@ struct after_state_chg_work { | |||
37 | struct completion *done; | 37 | struct completion *done; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | enum sanitize_state_warnings { | ||
41 | NO_WARNING, | ||
42 | ABORTED_ONLINE_VERIFY, | ||
43 | ABORTED_RESYNC, | ||
44 | CONNECTION_LOST_NEGOTIATING, | ||
45 | IMPLICITLY_UPGRADED_DISK, | ||
46 | IMPLICITLY_UPGRADED_PDSK, | ||
47 | }; | ||
48 | |||
40 | static int w_after_state_ch(struct drbd_work *w, int unused); | 49 | static int w_after_state_ch(struct drbd_work *w, int unused); |
41 | static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, | 50 | static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, |
42 | union drbd_state ns, enum chg_state_flags flags); | 51 | union drbd_state ns, enum chg_state_flags flags); |
@@ -44,7 +53,7 @@ static enum drbd_state_rv is_valid_state(struct drbd_conf *, union drbd_state); | |||
44 | static enum drbd_state_rv is_valid_soft_transition(union drbd_state, union drbd_state); | 53 | static enum drbd_state_rv is_valid_soft_transition(union drbd_state, union drbd_state); |
45 | static enum drbd_state_rv is_valid_transition(union drbd_state os, union drbd_state ns); | 54 | static enum drbd_state_rv is_valid_transition(union drbd_state os, union drbd_state ns); |
46 | static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns, | 55 | static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns, |
47 | const char **warn_sync_abort); | 56 | enum sanitize_state_warnings *warn); |
48 | 57 | ||
49 | static inline bool is_susp(union drbd_state s) | 58 | static inline bool is_susp(union drbd_state s) |
50 | { | 59 | { |
@@ -656,6 +665,21 @@ is_valid_transition(union drbd_state os, union drbd_state ns) | |||
656 | return rv; | 665 | return rv; |
657 | } | 666 | } |
658 | 667 | ||
668 | static void print_sanitize_warnings(struct drbd_conf *mdev, enum sanitize_state_warnings warn) | ||
669 | { | ||
670 | static const char *msg_table[] = { | ||
671 | [NO_WARNING] = "", | ||
672 | [ABORTED_ONLINE_VERIFY] = "Online-verify aborted.", | ||
673 | [ABORTED_RESYNC] = "Resync aborted.", | ||
674 | [CONNECTION_LOST_NEGOTIATING] = "Connection lost while negotiating, no data!", | ||
675 | [IMPLICITLY_UPGRADED_DISK] = "Implicitly upgraded disk", | ||
676 | [IMPLICITLY_UPGRADED_PDSK] = "Implicitly upgraded pdsk", | ||
677 | }; | ||
678 | |||
679 | if (warn != NO_WARNING) | ||
680 | dev_warn(DEV, "%s\n", msg_table[warn]); | ||
681 | } | ||
682 | |||
659 | /** | 683 | /** |
660 | * sanitize_state() - Resolves implicitly necessary additional changes to a state transition | 684 | * sanitize_state() - Resolves implicitly necessary additional changes to a state transition |
661 | * @mdev: DRBD device. | 685 | * @mdev: DRBD device. |
@@ -667,11 +691,14 @@ is_valid_transition(union drbd_state os, union drbd_state ns) | |||
667 | * to D_UNKNOWN. This rule and many more along those lines are in this function. | 691 | * to D_UNKNOWN. This rule and many more along those lines are in this function. |
668 | */ | 692 | */ |
669 | static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns, | 693 | static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns, |
670 | const char **warn_sync_abort) | 694 | enum sanitize_state_warnings *warn) |
671 | { | 695 | { |
672 | enum drbd_fencing_p fp; | 696 | enum drbd_fencing_p fp; |
673 | enum drbd_disk_state disk_min, disk_max, pdsk_min, pdsk_max; | 697 | enum drbd_disk_state disk_min, disk_max, pdsk_min, pdsk_max; |
674 | 698 | ||
699 | if (warn) | ||
700 | *warn = NO_WARNING; | ||
701 | |||
675 | fp = FP_DONT_CARE; | 702 | fp = FP_DONT_CARE; |
676 | if (get_ldev(mdev)) { | 703 | if (get_ldev(mdev)) { |
677 | rcu_read_lock(); | 704 | rcu_read_lock(); |
@@ -695,10 +722,9 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state | |||
695 | /* An implication of the disk states onto the connection state */ | 722 | /* An implication of the disk states onto the connection state */ |
696 | /* Abort resync if a disk fails/detaches */ | 723 | /* Abort resync if a disk fails/detaches */ |
697 | if (ns.conn > C_CONNECTED && (ns.disk <= D_FAILED || ns.pdsk <= D_FAILED)) { | 724 | if (ns.conn > C_CONNECTED && (ns.disk <= D_FAILED || ns.pdsk <= D_FAILED)) { |
698 | if (warn_sync_abort) | 725 | if (warn) |
699 | *warn_sync_abort = | 726 | *warn = ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T ? |
700 | ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T ? | 727 | ABORTED_ONLINE_VERIFY : ABORTED_RESYNC; |
701 | "Online-verify" : "Resync"; | ||
702 | ns.conn = C_CONNECTED; | 728 | ns.conn = C_CONNECTED; |
703 | } | 729 | } |
704 | 730 | ||
@@ -709,7 +735,8 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state | |||
709 | ns.disk = mdev->new_state_tmp.disk; | 735 | ns.disk = mdev->new_state_tmp.disk; |
710 | ns.pdsk = mdev->new_state_tmp.pdsk; | 736 | ns.pdsk = mdev->new_state_tmp.pdsk; |
711 | } else { | 737 | } else { |
712 | dev_alert(DEV, "Connection lost while negotiating, no data!\n"); | 738 | if (warn) |
739 | *warn = CONNECTION_LOST_NEGOTIATING; | ||
713 | ns.disk = D_DISKLESS; | 740 | ns.disk = D_DISKLESS; |
714 | ns.pdsk = D_UNKNOWN; | 741 | ns.pdsk = D_UNKNOWN; |
715 | } | 742 | } |
@@ -791,16 +818,16 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state | |||
791 | ns.disk = disk_max; | 818 | ns.disk = disk_max; |
792 | 819 | ||
793 | if (ns.disk < disk_min) { | 820 | if (ns.disk < disk_min) { |
794 | dev_warn(DEV, "Implicitly set disk from %s to %s\n", | 821 | if (warn) |
795 | drbd_disk_str(ns.disk), drbd_disk_str(disk_min)); | 822 | *warn = IMPLICITLY_UPGRADED_DISK; |
796 | ns.disk = disk_min; | 823 | ns.disk = disk_min; |
797 | } | 824 | } |
798 | if (ns.pdsk > pdsk_max) | 825 | if (ns.pdsk > pdsk_max) |
799 | ns.pdsk = pdsk_max; | 826 | ns.pdsk = pdsk_max; |
800 | 827 | ||
801 | if (ns.pdsk < pdsk_min) { | 828 | if (ns.pdsk < pdsk_min) { |
802 | dev_warn(DEV, "Implicitly set pdsk from %s to %s\n", | 829 | if (warn) |
803 | drbd_disk_str(ns.pdsk), drbd_disk_str(pdsk_min)); | 830 | *warn = IMPLICITLY_UPGRADED_PDSK; |
804 | ns.pdsk = pdsk_min; | 831 | ns.pdsk = pdsk_min; |
805 | } | 832 | } |
806 | 833 | ||
@@ -875,12 +902,12 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, | |||
875 | { | 902 | { |
876 | union drbd_state os; | 903 | union drbd_state os; |
877 | enum drbd_state_rv rv = SS_SUCCESS; | 904 | enum drbd_state_rv rv = SS_SUCCESS; |
878 | const char *warn_sync_abort = NULL; | 905 | enum sanitize_state_warnings ssw; |
879 | struct after_state_chg_work *ascw; | 906 | struct after_state_chg_work *ascw; |
880 | 907 | ||
881 | os = drbd_read_state(mdev); | 908 | os = drbd_read_state(mdev); |
882 | 909 | ||
883 | ns = sanitize_state(mdev, ns, &warn_sync_abort); | 910 | ns = sanitize_state(mdev, ns, &ssw); |
884 | if (ns.i == os.i) | 911 | if (ns.i == os.i) |
885 | return SS_NOTHING_TO_DO; | 912 | return SS_NOTHING_TO_DO; |
886 | 913 | ||
@@ -909,8 +936,7 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, | |||
909 | return rv; | 936 | return rv; |
910 | } | 937 | } |
911 | 938 | ||
912 | if (warn_sync_abort) | 939 | print_sanitize_warnings(mdev, ssw); |
913 | dev_warn(DEV, "%s aborted.\n", warn_sync_abort); | ||
914 | 940 | ||
915 | drbd_pr_state_change(mdev, os, ns, flags); | 941 | drbd_pr_state_change(mdev, os, ns, flags); |
916 | 942 | ||
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index 82db83410f08..f1046b13d9f6 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h | |||
@@ -126,7 +126,7 @@ | |||
126 | * is 1 PiB, currently. */ | 126 | * is 1 PiB, currently. */ |
127 | /* DRBD_MAX_SECTORS */ | 127 | /* DRBD_MAX_SECTORS */ |
128 | #define DRBD_DISK_SIZE_MIN 0 | 128 | #define DRBD_DISK_SIZE_MIN 0 |
129 | #define DRBD_DISK_SIZE_MAX (16 * (2LLU << 30)) | 129 | #define DRBD_DISK_SIZE_MAX (1 * (2LLU << 40)) |
130 | #define DRBD_DISK_SIZE_DEF 0 /* = disabled = no user size... */ | 130 | #define DRBD_DISK_SIZE_DEF 0 /* = disabled = no user size... */ |
131 | #define DRBD_DISK_SIZE_SCALE 's' /* sectors */ | 131 | #define DRBD_DISK_SIZE_SCALE 's' /* sectors */ |
132 | 132 | ||