From patchwork Fri Dec 9 14:53:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_B=C3=B6hmwalder?= X-Patchwork-Id: 13069674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D237FC4708D for ; Fri, 9 Dec 2022 14:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbiLIOxi (ORCPT ); Fri, 9 Dec 2022 09:53:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229865AbiLIOxg (ORCPT ); Fri, 9 Dec 2022 09:53:36 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B3985F6FE for ; Fri, 9 Dec 2022 06:53:34 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id m19so3386864edj.8 for ; Fri, 09 Dec 2022 06:53:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sQNKuz5965naByKUS4y1VIo8yUx5dsUc2Lu+3dW2kE8=; b=DULViScp0ZVXctPxlfv4qNn3cbilafSOKGMk8dRJw6i79Vudl6DOMfT79rpjRXPf0h Cby/vdu1mbCSR5Pn1rz+wJ/UCZYjXWxxXHWINZiipWv4QJoPQadESG07ukq3PX2z1e2y QaX76pV4y0QLJ8BAT8gHsy28rsADUqeOHOembmFs70/VOMQVVf6Ubt31LYagnvEc0GJa p8KQ4d9Iw3OGQI2KTwoVqlFWfGfaJcfFe/egS5Kmqj2CN19y216WgrcyU94kOCDH7OOt P+yF159+WVZEXSM6ECXkVUZ4IbilDRTHiXQ2/MLbb3HqoB3wSY2oZTo8gVb4MzO7CMJC G1hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sQNKuz5965naByKUS4y1VIo8yUx5dsUc2Lu+3dW2kE8=; b=N4txrRoJCaQV5V9BXnto7Ob7kD4xhRhFEWA8gLuuSYUPS7orC4nkMN8CZFLaK2nwxE lEsDp8whR2+V5U1KkhajxjRNfgkvVMVy/EAHvGfoMeM86hPv0sPtDt3UdASdPy12bVpK 2dNBJ50cwoTPpe/j7RemIB/pc8VQkhNWTlO2bcNoB0b1MSy7esPU5iR63ReUMHyJjWDW m39Yqje3791aprafiaHfS5CkIDQRWBilrwrj4yBxg3X65nahPPuakoeS5oMl9eVtiA7a AP5WxPXZHf9kLCdD65VgLIgHpB6bgNi9Qh456liF0+oHgMZCaobCfPO01urx2KtfV6iz gSwg== X-Gm-Message-State: ANoB5pkNDUOP9+UC9ssC1JQgcMdburD9m+kFE2+6y/xWPnDQaW8VQUCa jVpP5Uax54xTANJOJPqJo9t32Q== X-Google-Smtp-Source: AA0mqf5/exKOQ2UtDww2W1sqkCHfaWxm6TJeIW8pBJLUQGIbDQbARma3JEOCV+NUeA1Xc09JANibUw== X-Received: by 2002:a05:6402:25c7:b0:461:c5b4:a7d0 with SMTP id x7-20020a05640225c700b00461c5b4a7d0mr5638007edb.24.1670597612854; Fri, 09 Dec 2022 06:53:32 -0800 (PST) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id bd21-20020a056402207500b0046bb7503d9asm728424edb.24.2022.12.09.06.53.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 06:53:32 -0800 (PST) From: =?utf-8?q?Christoph_B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, =?utf-8?q?Christoph_B=C3=B6hmwalder?= , Joel Colledge Subject: [PATCH 1/8] drbd: adjust drbd_limits license header Date: Fri, 9 Dec 2022 15:53:20 +0100 Message-Id: <20221209145327.2272271-2-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> References: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org See also commit 93c68cc46a07 ("drbd: use consistent license"). We only want to license drbd under GPL-2.0, so use the corresponding SPDX header consistently. Signed-off-by: Christoph Böhmwalder Reviewed-by: Joel Colledge --- include/linux/drbd_limits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index 9e33f7038bea..d64271ccece4 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* drbd_limits.h This file is part of DRBD by Philipp Reisner and Lars Ellenberg. From patchwork Fri Dec 9 14:53:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_B=C3=B6hmwalder?= X-Patchwork-Id: 13069673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FC6CC04FDE for ; Fri, 9 Dec 2022 14:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbiLIOxh (ORCPT ); Fri, 9 Dec 2022 09:53:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbiLIOxg (ORCPT ); Fri, 9 Dec 2022 09:53:36 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E68D65FBB0 for ; Fri, 9 Dec 2022 06:53:34 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id l11so3404650edb.4 for ; Fri, 09 Dec 2022 06:53:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HcVlem0HZR7YKz5CwTwpHOGM7j8McIJNietyZfce8tM=; b=77ztn6yxYoQdI/YjNQ64stUrZKMYVjJNZx3RqQPwE5Wzgy2iNARTjl57kwyY9Zcf5v AoRy0cMdwuO3oXgyaDlqa4AO0FQSK0M/l5ILUynxqoovllneXCqvEsb3dQq/sF1bqG+0 JDKKUch4nKy4Ckc+IkGNltsHt/14NWOSaDiKrHLI80U0yPjRxtNg1MJo/h8NYBZTKE8C 0Y3c4Y3/0C7eLUMc15WErXKWHsHUP4MOMLoanzaXBXv991Quu3cx5lLBxhP6nHeJgAsu +zjMJS6eDVORei+1mDjWhF2h6MknRksnGeFhC7GR70deNL08vL680eWJaG7nF6IhyTlq PYPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HcVlem0HZR7YKz5CwTwpHOGM7j8McIJNietyZfce8tM=; b=RQpEXZOI6Sl3JKCKEohE2Nxr8OvDD39pXfB9RVSmGzniacEM9YIV0UU5maLIxxXB9+ rfgJLHKAHAkxBE3r0kdmnK+H0+SbOZJLmTqazNmnmQjy02m8N4r/sfvCq5BANosAj4Bg wSiqoarXgplKgMY5v37qkOacBmLxetfhVms8oYPo10xXI3K/oA0b3Y8IOluIJ+9sHHGM p+WGEcG5Aw+9BumKFpn197wDmUwLrSP9YmEzxd05aPrK4Cxj9ykV34xZILxrkgQqqKpN GbzIVuFDXSNuKcipcSqNIGoI7m/G46VnEVZKKqkot74A7AdR6gzJCA9KAMXLeYMGd2r7 Waeg== X-Gm-Message-State: ANoB5pm8AvZeR8BlsanLdgK6LQGPnCtVn0hqq2dVqXQvLZ5EniXP+S5d fPYtz3QB64yoe8diN6zs0yAzIg== X-Google-Smtp-Source: AA0mqf4QBPxAoxCzOvfQ8ZV6Q8UrQRb+58nSkaX+fyojG9uAWnXpr9Q7MI6KTomuZ8maaIi8/DhqUw== X-Received: by 2002:a05:6402:4501:b0:461:de81:d194 with SMTP id ez1-20020a056402450100b00461de81d194mr5113173edb.31.1670597613561; Fri, 09 Dec 2022 06:53:33 -0800 (PST) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id bd21-20020a056402207500b0046bb7503d9asm728424edb.24.2022.12.09.06.53.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 06:53:33 -0800 (PST) From: =?utf-8?q?Christoph_B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, Robert Altnoeder , =?utf-8?q?Christoph_B=C3=B6?= =?utf-8?q?hmwalder?= , Joel Colledge Subject: [PATCH 2/8] drbd: fix DRBD_VOLUME_MAX 65535 -> 65534 Date: Fri, 9 Dec 2022 15:53:21 +0100 Message-Id: <20221209145327.2272271-3-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> References: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Robert Altnoeder The protocol uses -1 as a reserved value for 'no specific volume', and since the protocol field is a 16 bit unsigned value, -1 is converted to 65535. Therefore, limit the range of valid volume numbers to [0, 65534]. Signed-off-by: Robert Altnoeder Signed-off-by: Christoph Böhmwalder Reviewed-by: Joel Colledge --- include/linux/drbd_limits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index d64271ccece4..058f7600f79c 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h @@ -21,7 +21,7 @@ #define DRBD_MINOR_COUNT_DEF 32 #define DRBD_MINOR_COUNT_SCALE '1' -#define DRBD_VOLUME_MAX 65535 +#define DRBD_VOLUME_MAX 65534 #define DRBD_DIALOG_REFRESH_MIN 0 #define DRBD_DIALOG_REFRESH_MAX 600 From patchwork Fri Dec 9 14:53:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_B=C3=B6hmwalder?= X-Patchwork-Id: 13069676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CABB5C10F1E for ; Fri, 9 Dec 2022 14:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbiLIOxj (ORCPT ); Fri, 9 Dec 2022 09:53:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbiLIOxh (ORCPT ); Fri, 9 Dec 2022 09:53:37 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C08E360B61 for ; Fri, 9 Dec 2022 06:53:35 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id m18so12047781eji.5 for ; Fri, 09 Dec 2022 06:53:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q42egUmEzuPqHWtFCe0+w1qRK0bznL4xm46gw6YdelU=; b=ZihNvqjYu0GuxrTo2DqhWHwecGG4eOjgW2QaGOoIU17tvfk/sRzouRbmUjpIlGt+K2 3pzGIw8yE+4HKGI5rqBtqgu3YnvEe6tJMwCRs9cVnpUVJQXyh9pPHbAXFt4VlT/qP3l1 sS9gXiZob1Gplz96t/i5eAGYZEMu0i+zlrGrKVTGRD0x1ZRWEJnjnCchGoUIvGbPmFBR 4gc2PIsS+q5xrSuBpatLqVLaqzH3kgCZ9re27Sfzd3qBmL6zFJHqNzkKYTNFG2fe8P5D UXKbaB5CZhCXcy9/SfdWDBSUHGwOx5Xn+oMNYzmpXoaDo/kWYdDh+hwaA96F0Vup+Il7 bRVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q42egUmEzuPqHWtFCe0+w1qRK0bznL4xm46gw6YdelU=; b=QzJwf7/FWD9Ry+8OXd2VmV5X2w2jKpXa49DvMdR/ogxGs8E44uscB7p6H6JsN+WT4G tSb8r9wK3qDYnimt9sCj+cD/TBRFCtsIL/hK4NqKNEBuJ503a0n6CuVYSOPY1GEDTTA3 x0orL2Kt0QU2+F9dCrtybX/1qZo7ezVqf3vuMUFs9l1R7/cm+9682UnAp4EXWIg+VNUe /rgz8OAdwclJiTi/yyYy8cZNnWSW78uf1024IRcDvlPWrsSE89p1skWVna8lh3/gpoXo Vv30laPQN2VwFBtGBk4bwUDneehVTbrdHC2lp9v3NrOe3LImS4A5eLOTveIoULAhx3Jo csCw== X-Gm-Message-State: ANoB5pmOwmfFzVUype+jCB68nYcGD9ttcKfxo9bV9qnY0GSzBYf4T929 EcBXjKiWToxqRE6g0IcvKzlI0Q== X-Google-Smtp-Source: AA0mqf7qedg5RTsrsHr42V62lMk4rQTtcCgfg/f+ZHTQZqh6Y7h3Ye+XJC/UzWeOMItI/GCNqAe18A== X-Received: by 2002:a17:906:17c9:b0:7c0:bc68:bfc4 with SMTP id u9-20020a17090617c900b007c0bc68bfc4mr5472396eje.16.1670597614304; Fri, 09 Dec 2022 06:53:34 -0800 (PST) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id bd21-20020a056402207500b0046bb7503d9asm728424edb.24.2022.12.09.06.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 06:53:33 -0800 (PST) From: =?utf-8?q?Christoph_B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, =?utf-8?q?Christoph_B=C3=B6hmwalder?= , Joel Colledge Subject: [PATCH 3/8] drbd: make limits unsigned Date: Fri, 9 Dec 2022 15:53:22 +0100 Message-Id: <20221209145327.2272271-4-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> References: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org These are almost always used as unsigned integers, so mark them as such. Signed-off-by: Christoph Böhmwalder Reviewed-by: Joel Colledge --- include/linux/drbd_limits.h | 202 ++++++++++++++++++------------------ 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index 058f7600f79c..5b042fb427e9 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h @@ -16,123 +16,123 @@ #define DEBUG_RANGE_CHECK 0 -#define DRBD_MINOR_COUNT_MIN 1 -#define DRBD_MINOR_COUNT_MAX 255 -#define DRBD_MINOR_COUNT_DEF 32 +#define DRBD_MINOR_COUNT_MIN 1U +#define DRBD_MINOR_COUNT_MAX 255U +#define DRBD_MINOR_COUNT_DEF 32U #define DRBD_MINOR_COUNT_SCALE '1' -#define DRBD_VOLUME_MAX 65534 +#define DRBD_VOLUME_MAX 65534U -#define DRBD_DIALOG_REFRESH_MIN 0 -#define DRBD_DIALOG_REFRESH_MAX 600 +#define DRBD_DIALOG_REFRESH_MIN 0U +#define DRBD_DIALOG_REFRESH_MAX 600U #define DRBD_DIALOG_REFRESH_SCALE '1' /* valid port number */ -#define DRBD_PORT_MIN 1 -#define DRBD_PORT_MAX 0xffff +#define DRBD_PORT_MIN 1U +#define DRBD_PORT_MAX 0xffffU #define DRBD_PORT_SCALE '1' /* startup { */ /* if you want more than 3.4 days, disable */ -#define DRBD_WFC_TIMEOUT_MIN 0 -#define DRBD_WFC_TIMEOUT_MAX 300000 -#define DRBD_WFC_TIMEOUT_DEF 0 +#define DRBD_WFC_TIMEOUT_MIN 0U +#define DRBD_WFC_TIMEOUT_MAX 300000U +#define DRBD_WFC_TIMEOUT_DEF 0U #define DRBD_WFC_TIMEOUT_SCALE '1' -#define DRBD_DEGR_WFC_TIMEOUT_MIN 0 -#define DRBD_DEGR_WFC_TIMEOUT_MAX 300000 -#define DRBD_DEGR_WFC_TIMEOUT_DEF 0 +#define DRBD_DEGR_WFC_TIMEOUT_MIN 0U +#define DRBD_DEGR_WFC_TIMEOUT_MAX 300000U +#define DRBD_DEGR_WFC_TIMEOUT_DEF 0U #define DRBD_DEGR_WFC_TIMEOUT_SCALE '1' -#define DRBD_OUTDATED_WFC_TIMEOUT_MIN 0 -#define DRBD_OUTDATED_WFC_TIMEOUT_MAX 300000 -#define DRBD_OUTDATED_WFC_TIMEOUT_DEF 0 +#define DRBD_OUTDATED_WFC_TIMEOUT_MIN 0U +#define DRBD_OUTDATED_WFC_TIMEOUT_MAX 300000U +#define DRBD_OUTDATED_WFC_TIMEOUT_DEF 0U #define DRBD_OUTDATED_WFC_TIMEOUT_SCALE '1' /* }*/ /* net { */ /* timeout, unit centi seconds * more than one minute timeout is not useful */ -#define DRBD_TIMEOUT_MIN 1 -#define DRBD_TIMEOUT_MAX 600 -#define DRBD_TIMEOUT_DEF 60 /* 6 seconds */ +#define DRBD_TIMEOUT_MIN 1U +#define DRBD_TIMEOUT_MAX 600U +#define DRBD_TIMEOUT_DEF 60U /* 6 seconds */ #define DRBD_TIMEOUT_SCALE '1' /* If backing disk takes longer than disk_timeout, mark the disk as failed */ -#define DRBD_DISK_TIMEOUT_MIN 0 /* 0 = disabled */ -#define DRBD_DISK_TIMEOUT_MAX 6000 /* 10 Minutes */ -#define DRBD_DISK_TIMEOUT_DEF 0 /* disabled */ +#define DRBD_DISK_TIMEOUT_MIN 0U /* 0 = disabled */ +#define DRBD_DISK_TIMEOUT_MAX 6000U /* 10 Minutes */ +#define DRBD_DISK_TIMEOUT_DEF 0U /* disabled */ #define DRBD_DISK_TIMEOUT_SCALE '1' /* active connection retries when C_WF_CONNECTION */ -#define DRBD_CONNECT_INT_MIN 1 -#define DRBD_CONNECT_INT_MAX 120 -#define DRBD_CONNECT_INT_DEF 10 /* seconds */ +#define DRBD_CONNECT_INT_MIN 1U +#define DRBD_CONNECT_INT_MAX 120U +#define DRBD_CONNECT_INT_DEF 10U /* seconds */ #define DRBD_CONNECT_INT_SCALE '1' /* keep-alive probes when idle */ -#define DRBD_PING_INT_MIN 1 -#define DRBD_PING_INT_MAX 120 -#define DRBD_PING_INT_DEF 10 +#define DRBD_PING_INT_MIN 1U +#define DRBD_PING_INT_MAX 120U +#define DRBD_PING_INT_DEF 10U #define DRBD_PING_INT_SCALE '1' /* timeout for the ping packets.*/ -#define DRBD_PING_TIMEO_MIN 1 -#define DRBD_PING_TIMEO_MAX 300 -#define DRBD_PING_TIMEO_DEF 5 +#define DRBD_PING_TIMEO_MIN 1U +#define DRBD_PING_TIMEO_MAX 300U +#define DRBD_PING_TIMEO_DEF 5U #define DRBD_PING_TIMEO_SCALE '1' /* max number of write requests between write barriers */ -#define DRBD_MAX_EPOCH_SIZE_MIN 1 -#define DRBD_MAX_EPOCH_SIZE_MAX 20000 -#define DRBD_MAX_EPOCH_SIZE_DEF 2048 +#define DRBD_MAX_EPOCH_SIZE_MIN 1U +#define DRBD_MAX_EPOCH_SIZE_MAX 20000U +#define DRBD_MAX_EPOCH_SIZE_DEF 2048U #define DRBD_MAX_EPOCH_SIZE_SCALE '1' /* I don't think that a tcp send buffer of more than 10M is useful */ -#define DRBD_SNDBUF_SIZE_MIN 0 -#define DRBD_SNDBUF_SIZE_MAX (10<<20) -#define DRBD_SNDBUF_SIZE_DEF 0 +#define DRBD_SNDBUF_SIZE_MIN 0U +#define DRBD_SNDBUF_SIZE_MAX (10U<<20) +#define DRBD_SNDBUF_SIZE_DEF 0U #define DRBD_SNDBUF_SIZE_SCALE '1' -#define DRBD_RCVBUF_SIZE_MIN 0 -#define DRBD_RCVBUF_SIZE_MAX (10<<20) -#define DRBD_RCVBUF_SIZE_DEF 0 +#define DRBD_RCVBUF_SIZE_MIN 0U +#define DRBD_RCVBUF_SIZE_MAX (10U<<20) +#define DRBD_RCVBUF_SIZE_DEF 0U #define DRBD_RCVBUF_SIZE_SCALE '1' /* @4k PageSize -> 128kB - 512MB */ -#define DRBD_MAX_BUFFERS_MIN 32 -#define DRBD_MAX_BUFFERS_MAX 131072 -#define DRBD_MAX_BUFFERS_DEF 2048 +#define DRBD_MAX_BUFFERS_MIN 32U +#define DRBD_MAX_BUFFERS_MAX 131072U +#define DRBD_MAX_BUFFERS_DEF 2048U #define DRBD_MAX_BUFFERS_SCALE '1' /* @4k PageSize -> 4kB - 512MB */ -#define DRBD_UNPLUG_WATERMARK_MIN 1 -#define DRBD_UNPLUG_WATERMARK_MAX 131072 +#define DRBD_UNPLUG_WATERMARK_MIN 1U +#define DRBD_UNPLUG_WATERMARK_MAX 131072U #define DRBD_UNPLUG_WATERMARK_DEF (DRBD_MAX_BUFFERS_DEF/16) #define DRBD_UNPLUG_WATERMARK_SCALE '1' /* 0 is disabled. * 200 should be more than enough even for very short timeouts */ -#define DRBD_KO_COUNT_MIN 0 -#define DRBD_KO_COUNT_MAX 200 -#define DRBD_KO_COUNT_DEF 7 +#define DRBD_KO_COUNT_MIN 0U +#define DRBD_KO_COUNT_MAX 200U +#define DRBD_KO_COUNT_DEF 7U #define DRBD_KO_COUNT_SCALE '1' /* } */ /* syncer { */ /* FIXME allow rate to be zero? */ -#define DRBD_RESYNC_RATE_MIN 1 +#define DRBD_RESYNC_RATE_MIN 1U /* channel bonding 10 GbE, or other hardware */ #define DRBD_RESYNC_RATE_MAX (4 << 20) -#define DRBD_RESYNC_RATE_DEF 250 +#define DRBD_RESYNC_RATE_DEF 250U #define DRBD_RESYNC_RATE_SCALE 'k' /* kilobytes */ -#define DRBD_AL_EXTENTS_MIN 67 +#define DRBD_AL_EXTENTS_MIN 67U /* we use u16 as "slot number", (u16)~0 is "FREE". * If you use >= 292 kB on-disk ring buffer, * this is the maximum you can use: */ -#define DRBD_AL_EXTENTS_MAX 0xfffe -#define DRBD_AL_EXTENTS_DEF 1237 +#define DRBD_AL_EXTENTS_MAX 0xfffeU +#define DRBD_AL_EXTENTS_DEF 1237U #define DRBD_AL_EXTENTS_SCALE '1' #define DRBD_MINOR_NUMBER_MIN -1 @@ -147,9 +147,9 @@ * the upper limit with 64bit kernel, enough ram and flexible meta data * is 1 PiB, currently. */ /* DRBD_MAX_SECTORS */ -#define DRBD_DISK_SIZE_MIN 0 -#define DRBD_DISK_SIZE_MAX (1 * (2LLU << 40)) -#define DRBD_DISK_SIZE_DEF 0 /* = disabled = no user size... */ +#define DRBD_DISK_SIZE_MIN 0LLU +#define DRBD_DISK_SIZE_MAX (1LLU * (2LLU << 40)) +#define DRBD_DISK_SIZE_DEF 0LLU /* = disabled = no user size... */ #define DRBD_DISK_SIZE_SCALE 's' /* sectors */ #define DRBD_ON_IO_ERROR_DEF EP_DETACH @@ -162,39 +162,39 @@ #define DRBD_ON_CONGESTION_DEF OC_BLOCK #define DRBD_READ_BALANCING_DEF RB_PREFER_LOCAL -#define DRBD_MAX_BIO_BVECS_MIN 0 -#define DRBD_MAX_BIO_BVECS_MAX 128 -#define DRBD_MAX_BIO_BVECS_DEF 0 +#define DRBD_MAX_BIO_BVECS_MIN 0U +#define DRBD_MAX_BIO_BVECS_MAX 128U +#define DRBD_MAX_BIO_BVECS_DEF 0U #define DRBD_MAX_BIO_BVECS_SCALE '1' -#define DRBD_C_PLAN_AHEAD_MIN 0 -#define DRBD_C_PLAN_AHEAD_MAX 300 -#define DRBD_C_PLAN_AHEAD_DEF 20 +#define DRBD_C_PLAN_AHEAD_MIN 0U +#define DRBD_C_PLAN_AHEAD_MAX 300U +#define DRBD_C_PLAN_AHEAD_DEF 20U #define DRBD_C_PLAN_AHEAD_SCALE '1' -#define DRBD_C_DELAY_TARGET_MIN 1 -#define DRBD_C_DELAY_TARGET_MAX 100 -#define DRBD_C_DELAY_TARGET_DEF 10 +#define DRBD_C_DELAY_TARGET_MIN 1U +#define DRBD_C_DELAY_TARGET_MAX 100U +#define DRBD_C_DELAY_TARGET_DEF 10U #define DRBD_C_DELAY_TARGET_SCALE '1' -#define DRBD_C_FILL_TARGET_MIN 0 -#define DRBD_C_FILL_TARGET_MAX (1<<20) /* 500MByte in sec */ -#define DRBD_C_FILL_TARGET_DEF 100 /* Try to place 50KiB in socket send buffer during resync */ +#define DRBD_C_FILL_TARGET_MIN 0U +#define DRBD_C_FILL_TARGET_MAX (1U<<20) /* 500MByte in sec */ +#define DRBD_C_FILL_TARGET_DEF 100U /* Try to place 50KiB in socket send buffer during resync */ #define DRBD_C_FILL_TARGET_SCALE 's' /* sectors */ -#define DRBD_C_MAX_RATE_MIN 250 -#define DRBD_C_MAX_RATE_MAX (4 << 20) -#define DRBD_C_MAX_RATE_DEF 102400 +#define DRBD_C_MAX_RATE_MIN 250U +#define DRBD_C_MAX_RATE_MAX (4U << 20) +#define DRBD_C_MAX_RATE_DEF 102400U #define DRBD_C_MAX_RATE_SCALE 'k' /* kilobytes */ -#define DRBD_C_MIN_RATE_MIN 0 -#define DRBD_C_MIN_RATE_MAX (4 << 20) -#define DRBD_C_MIN_RATE_DEF 250 +#define DRBD_C_MIN_RATE_MIN 0U +#define DRBD_C_MIN_RATE_MAX (4U << 20) +#define DRBD_C_MIN_RATE_DEF 250U #define DRBD_C_MIN_RATE_SCALE 'k' /* kilobytes */ -#define DRBD_CONG_FILL_MIN 0 -#define DRBD_CONG_FILL_MAX (10<<21) /* 10GByte in sectors */ -#define DRBD_CONG_FILL_DEF 0 +#define DRBD_CONG_FILL_MIN 0U +#define DRBD_CONG_FILL_MAX (10U<<21) /* 10GByte in sectors */ +#define DRBD_CONG_FILL_DEF 0U #define DRBD_CONG_FILL_SCALE 's' /* sectors */ #define DRBD_CONG_EXTENTS_MIN DRBD_AL_EXTENTS_MIN @@ -204,48 +204,48 @@ #define DRBD_PROTOCOL_DEF DRBD_PROT_C -#define DRBD_DISK_BARRIER_DEF 0 -#define DRBD_DISK_FLUSHES_DEF 1 -#define DRBD_DISK_DRAIN_DEF 1 -#define DRBD_MD_FLUSHES_DEF 1 -#define DRBD_TCP_CORK_DEF 1 -#define DRBD_AL_UPDATES_DEF 1 +#define DRBD_DISK_BARRIER_DEF 0U +#define DRBD_DISK_FLUSHES_DEF 1U +#define DRBD_DISK_DRAIN_DEF 1U +#define DRBD_MD_FLUSHES_DEF 1U +#define DRBD_TCP_CORK_DEF 1U +#define DRBD_AL_UPDATES_DEF 1U /* We used to ignore the discard_zeroes_data setting. * To not change established (and expected) behaviour, * by default assume that, for discard_zeroes_data=0, * we can make that an effective discard_zeroes_data=1, * if we only explicitly zero-out unaligned partial chunks. */ -#define DRBD_DISCARD_ZEROES_IF_ALIGNED_DEF 1 +#define DRBD_DISCARD_ZEROES_IF_ALIGNED_DEF 1U /* Some backends pretend to support WRITE SAME, * but fail such requests when they are actually submitted. * This is to tell DRBD to not even try. */ -#define DRBD_DISABLE_WRITE_SAME_DEF 0 +#define DRBD_DISABLE_WRITE_SAME_DEF 0U -#define DRBD_ALLOW_TWO_PRIMARIES_DEF 0 -#define DRBD_ALWAYS_ASBP_DEF 0 -#define DRBD_USE_RLE_DEF 1 -#define DRBD_CSUMS_AFTER_CRASH_ONLY_DEF 0 +#define DRBD_ALLOW_TWO_PRIMARIES_DEF 0U +#define DRBD_ALWAYS_ASBP_DEF 0U +#define DRBD_USE_RLE_DEF 1U +#define DRBD_CSUMS_AFTER_CRASH_ONLY_DEF 0U -#define DRBD_AL_STRIPES_MIN 1 -#define DRBD_AL_STRIPES_MAX 1024 -#define DRBD_AL_STRIPES_DEF 1 +#define DRBD_AL_STRIPES_MIN 1U +#define DRBD_AL_STRIPES_MAX 1024U +#define DRBD_AL_STRIPES_DEF 1U #define DRBD_AL_STRIPES_SCALE '1' -#define DRBD_AL_STRIPE_SIZE_MIN 4 -#define DRBD_AL_STRIPE_SIZE_MAX 16777216 -#define DRBD_AL_STRIPE_SIZE_DEF 32 +#define DRBD_AL_STRIPE_SIZE_MIN 4U +#define DRBD_AL_STRIPE_SIZE_MAX 16777216U +#define DRBD_AL_STRIPE_SIZE_DEF 32U #define DRBD_AL_STRIPE_SIZE_SCALE 'k' /* kilobytes */ -#define DRBD_SOCKET_CHECK_TIMEO_MIN 0 +#define DRBD_SOCKET_CHECK_TIMEO_MIN 0U #define DRBD_SOCKET_CHECK_TIMEO_MAX DRBD_PING_TIMEO_MAX -#define DRBD_SOCKET_CHECK_TIMEO_DEF 0 +#define DRBD_SOCKET_CHECK_TIMEO_DEF 0U #define DRBD_SOCKET_CHECK_TIMEO_SCALE '1' -#define DRBD_RS_DISCARD_GRANULARITY_MIN 0 -#define DRBD_RS_DISCARD_GRANULARITY_MAX (1<<20) /* 1MiByte */ -#define DRBD_RS_DISCARD_GRANULARITY_DEF 0 /* disabled by default */ +#define DRBD_RS_DISCARD_GRANULARITY_MIN 0U +#define DRBD_RS_DISCARD_GRANULARITY_MAX (1U<<20) /* 1MiByte */ +#define DRBD_RS_DISCARD_GRANULARITY_DEF 0U /* disabled by default */ #define DRBD_RS_DISCARD_GRANULARITY_SCALE '1' /* bytes */ #endif From patchwork Fri Dec 9 14:53:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_B=C3=B6hmwalder?= X-Patchwork-Id: 13069675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28621C4332F for ; Fri, 9 Dec 2022 14:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbiLIOxk (ORCPT ); Fri, 9 Dec 2022 09:53:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbiLIOxh (ORCPT ); Fri, 9 Dec 2022 09:53:37 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DA9B60B66 for ; Fri, 9 Dec 2022 06:53:36 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id i15so3410895edf.2 for ; Fri, 09 Dec 2022 06:53:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8SGWONfVHjklNBkXRu6sFYgnXokffLko1IC/BWEcSP8=; b=CFMhSCPpgXLUtR6ZiK2YFnEjmqjxsmtam0ueM6OrVLZCwoq1Oilpg6M5PZJ5VDSeRY 2nE9gDgF744dYJmapJAukrxcvxghsFbizFHO8pW5DKE2bzJ3FsilMaxka5dKBEWkrFR4 bxIYOOHLxBKLfut+dvsdXvJml72ts9e+HPqwQ4iEBjXFew8vsZmblks6fGeIbkP2nGs8 tyYw5HkvY8I//dTSV7SXupiPcIQdsZUp8TVf4DuVTEdPoxPhV+9siPeVNOT9GGlyGMBc mIchahEZyIMQQwH165aDUoaTh7N0GnYCdaLRx0RV38O0s9CtpE6NIeVbckZg5bXk6bN6 gveg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8SGWONfVHjklNBkXRu6sFYgnXokffLko1IC/BWEcSP8=; b=Bx/9LkTJSCXHnN/az19ReNOW70AJukzaTYuI3LocehAMsdnyURMZBXRkOc5GnCc1JL Q6IHfcmsIk/SXCD22R22qsMdsXk2m30Y8Ijg2HhWVOtOwBoZ4N33MNpHDTRoiP9sYSq8 VGWh0+cptB+FkmEOZNSHKTl5pJNYEVDqnCkbFNXz/6ioFaXY8/ZSJ9GkF/AVknjjgO9M 3n9K8Xtx45aUpfXuR+OVoT0UCGr0Wgtfs9iolEPapbAiLpwEkwPg37eAS8PU8Qwu4Phk YEDxHDBLruxKFL1t+OOdu1/jwvy5Ak8ybZaWhn0lQt/oKpGqoyIQgb6IarClekhuIk87 1XTg== X-Gm-Message-State: ANoB5plwNjTbog9S2Qnn73z6GZxofYHJChAxybEm3Ig/BTYfJdkDoYZb 9dI2TyHLPSmfbwMzxu4VEMZC9A== X-Google-Smtp-Source: AA0mqf5B8665LOfSRiKHkdYlF7U7pudYJLGfAmYc2LJBFOdrl94ZlNt0ilq4X+thHNKv4jvSoQf7Ew== X-Received: by 2002:a05:6402:1f06:b0:461:7da0:f85a with SMTP id b6-20020a0564021f0600b004617da0f85amr5871865edb.5.1670597615018; Fri, 09 Dec 2022 06:53:35 -0800 (PST) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id bd21-20020a056402207500b0046bb7503d9asm728424edb.24.2022.12.09.06.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 06:53:34 -0800 (PST) From: =?utf-8?q?Christoph_B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, =?utf-8?q?Christoph_B=C3=B6hmwalder?= , Joel Colledge Subject: [PATCH 4/8] drbd: remove unnecessary assignment in vli_encode_bits Date: Fri, 9 Dec 2022 15:53:23 +0100 Message-Id: <20221209145327.2272271-5-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> References: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Christoph Böhmwalder Reviewed-by: Joel Colledge --- drivers/block/drbd/drbd_vli.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_vli.h b/drivers/block/drbd/drbd_vli.h index 1ee81e3c2152..941c511cc4da 100644 --- a/drivers/block/drbd/drbd_vli.h +++ b/drivers/block/drbd/drbd_vli.h @@ -327,7 +327,7 @@ static inline int bitstream_get_bits(struct bitstream *bs, u64 *out, int bits) */ static inline int vli_encode_bits(struct bitstream *bs, u64 in) { - u64 code = code; + u64 code; int bits = __vli_encode_bits(&code, in); if (bits <= 0) From patchwork Fri Dec 9 14:53:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_B=C3=B6hmwalder?= X-Patchwork-Id: 13069677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22C7FC04FDE for ; Fri, 9 Dec 2022 14:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229997AbiLIOxp (ORCPT ); Fri, 9 Dec 2022 09:53:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbiLIOxh (ORCPT ); Fri, 9 Dec 2022 09:53:37 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 197705C0E3 for ; Fri, 9 Dec 2022 06:53:37 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id n21so12035035ejb.9 for ; Fri, 09 Dec 2022 06:53:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ROtOQl0iT4Ua6doSdkwJJ3Gv1mhqQe8GXYrZrg3slxM=; b=ApPRBy01ChJFifDOnwbdnwBSBF0lcYWMqjlMTXz2jhF6/5ANYo14gJvPrTt/ll13S4 K3w8+TcexOTVeUactHN1bzHljJf8MB3pj+7s2l9W2X2B/rqVw7CJc40bdYAb3MWRWG0C rHtrkO46Y6Pi3pN+lpiC3pLYeKw3zGiL8SXaOISfar5nXi0rY5xvNycjwkcZdn40uzix IWIZ3TI8SQjhDOrLC2SXzRmEbOO9d2OljNpN/2gfa7/RfgkeBfgclr9buadIgB1EH0TY RXQT5ehbonldUCPsY7sbejkfcY2jU8HE86oKqZI8WC68NKs999tNSNRAWzzFHs0YHQPn Tv6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ROtOQl0iT4Ua6doSdkwJJ3Gv1mhqQe8GXYrZrg3slxM=; b=B/kii8PcnpREDY9RWK2dSy5VETjgL1nv0ZBGZib93uhG7u5oRn60QN6WtD5hC56Nc0 4BuxqGOnklmt9oVVcnbk4F70EvSFXXQ+AnMA8pGQWWbgHNSMTXg+nb0SgW7qH/PGzX9m /cgY1En4s83ukEHnpC3BdPLahbA3pu5907sSxDT2i0C2nW6dEiIjEssfmjZV2zYpOF8m yuqtICQRHvvVmpZysDWBsR3+d9aeZgSz/LdcbM/5mdbToJT4bNxcdLsSQnAZq0K97ecK /I5XJm3co5SpCfca5b105d5kKVV5xoOPLUFH5K54uw7svW9YNCJ0F6sk8CkGJaK5xMVI CE5w== X-Gm-Message-State: ANoB5pm94HYEqenw9PCneOilMsqVzRspeKu/P8XFUwM1QDHQ9WnWiOLW 1JpssuXc35W/80RuRyqsVkuUiA== X-Google-Smtp-Source: AA0mqf4FR3/rLj1r8DduSRH9Ahrzdkej5gCrltixWaV5Ldqq3If0NcyorWhWwageABZaLWMi1ZsSug== X-Received: by 2002:a17:906:1115:b0:7c1:1fcf:266c with SMTP id h21-20020a170906111500b007c11fcf266cmr5039561eja.14.1670597615707; Fri, 09 Dec 2022 06:53:35 -0800 (PST) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id bd21-20020a056402207500b0046bb7503d9asm728424edb.24.2022.12.09.06.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 06:53:35 -0800 (PST) From: =?utf-8?q?Christoph_B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, =?utf-8?q?Christoph_B=C3=B6hmwalder?= , Joel Colledge Subject: [PATCH 5/8] drbd: remove macros using require_context Date: Fri, 9 Dec 2022 15:53:24 +0100 Message-Id: <20221209145327.2272271-6-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> References: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This require_context attribute originated in a proposed sparse patch by Philipp Reisner back in 2008. Johannes Berg had a different solution to a similar problem, and that patch "won" in the end; so the require_context thing never got merged. The whole history can be read at [0]. DRBD kept using these annotations anyway for a while. Nowadays, on a modern unmodified sparse, they obviously do nothing, and they are hardly used anymore anyway. So, just remove the definitions of these macros. [0] https://www.spinics.net/lists/linux-sparse/msg01150.html Signed-off-by: Christoph Böhmwalder Reviewed-by: Joel Colledge --- drivers/block/drbd/drbd_int.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index ae713338aa46..edce1f7ac2da 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -39,16 +39,6 @@ #include "drbd_protocol.h" #include "drbd_polymorph_printk.h" -#ifdef __CHECKER__ -# define __protected_by(x) __attribute__((require_context(x,1,999,"rdwr"))) -# define __protected_read_by(x) __attribute__((require_context(x,1,999,"read"))) -# define __protected_write_by(x) __attribute__((require_context(x,1,999,"write"))) -#else -# define __protected_by(x) -# define __protected_read_by(x) -# define __protected_write_by(x) -#endif - /* shared module parameters, defined in drbd_main.c */ #ifdef CONFIG_DRBD_FAULT_INJECTION extern int drbd_enable_faults; @@ -774,7 +764,7 @@ struct drbd_device { unsigned long flags; /* configured by drbdsetup */ - struct drbd_backing_dev *ldev __protected_by(local); + struct drbd_backing_dev *ldev; sector_t p_size; /* partner's disk size */ struct request_queue *rq_queue; From patchwork Fri Dec 9 14:53:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_B=C3=B6hmwalder?= X-Patchwork-Id: 13069678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28C3EC4332F for ; Fri, 9 Dec 2022 14:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbiLIOxq (ORCPT ); Fri, 9 Dec 2022 09:53:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbiLIOxh (ORCPT ); Fri, 9 Dec 2022 09:53:37 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB1C511E7 for ; Fri, 9 Dec 2022 06:53:36 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id a16so3385046edb.9 for ; Fri, 09 Dec 2022 06:53:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N1ZPBPraqcCSXLcbBqEiTH4593Z8hkjnTNKrVJO6nsc=; b=cA94dZQenZJSd/HPwubzdsAVWL9KdO9O1Qo/Eakd4+PcL0EYhUnFp6LZ4Z5Yiq44Ts kIk20jFQg1VRnEblzwpnQ/d32eC6W3vdeer4rSpJfq4M8GRXwKq4ssx4ghVd8jx1YD+p C2x0fausQ5gxBdut+a+0XS5oiYYSgwNQilm+V2mMDhAxtTVEpGII1j3yeVyZWE2S/hfd 9d1sYMc0pkCNaXhyjxT3SUsMh3h6dSyi/LLn0XlkNvj+AimVyhLXmFud1jJf1IiPG5Iz JjBCanRTRC+nb7XDkV4V07MrkTMCVY8OCJHJ9Iwhaaw4/MGx4OQwAE8eci9EwJC9SN9D 7raA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N1ZPBPraqcCSXLcbBqEiTH4593Z8hkjnTNKrVJO6nsc=; b=RTYuOKPlp3geMtFONecT//47Cr5WMULFo+SChfReFfAeLn4riYMDxsN9AGhGc6rZLX Z55bdmSPkl+FtUaiWFfvHoKKMxb3OCm+RBxtRoIOnIw7VaR56Bv5fJ4qsPIKuRPxvbZr HtoS1RvJzkFAESZR3Hs6dSFg6Fh5wpwJTVstHm2nrDpX2i35QOs4qYUNKElPqiDWDD4Y 84h2r42qZ9ZRX4IAefdVI25aSf4kQJYA16eLK/R4VbhSZq2cKfHQ/0Jg5bHUqbtwBk+M Gzrj8wWPjWD0LyedbXTbD/Aqu8lWqfK2ak60Jzbsv1zfOI1QXtZR/Td7gbmRXQWy5FKK SyGg== X-Gm-Message-State: ANoB5plnTHwncP67eSVbvnVA+Ljg6Ak5siZnWiG5ET2Ljp30DNzZ1XHH HJAu2lTxo0hWB4AQHi0PJGeEvQ== X-Google-Smtp-Source: AA0mqf4grDFciVpw7S/dEZoa128AlSgEFPzlvhzLMA1gxp2edL4O/WpNrnUJ3+plM+y7TPO8OeT56g== X-Received: by 2002:aa7:c9d0:0:b0:467:559e:5301 with SMTP id i16-20020aa7c9d0000000b00467559e5301mr5158338edt.7.1670597616464; Fri, 09 Dec 2022 06:53:36 -0800 (PST) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id bd21-20020a056402207500b0046bb7503d9asm728424edb.24.2022.12.09.06.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 06:53:36 -0800 (PST) From: =?utf-8?q?Christoph_B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, =?utf-8?q?Christoph_B=C3=B6hmwalder?= , Joel Colledge Subject: [PATCH 6/8] MAINTAINERS: add drbd headers Date: Fri, 9 Dec 2022 15:53:25 +0100 Message-Id: <20221209145327.2272271-7-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> References: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Christoph Böhmwalder Reviewed-by: Joel Colledge --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 595d59eec7ea..83b6f3a97cf6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6349,6 +6349,7 @@ T: git git://git.linbit.com/linux-drbd.git T: git git://git.linbit.com/drbd-8.4.git F: Documentation/admin-guide/blockdev/ F: drivers/block/drbd/ +F: include/linux/drbd* F: lib/lru_cache.c DRIVER COMPONENT FRAMEWORK From patchwork Fri Dec 9 14:53:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_B=C3=B6hmwalder?= X-Patchwork-Id: 13069679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE7D9C4167B for ; Fri, 9 Dec 2022 14:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbiLIOxs (ORCPT ); Fri, 9 Dec 2022 09:53:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiLIOxj (ORCPT ); Fri, 9 Dec 2022 09:53:39 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4A4060371 for ; Fri, 9 Dec 2022 06:53:38 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id gh17so12067215ejb.6 for ; Fri, 09 Dec 2022 06:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T5KT6Auu94HJGq65sn5VmhXW8yJRnWzEtldTHa29AT0=; b=qH3VWd11DupxgvhV7pRjAnxBZRPHRVTf98egvIoxinGVQRaCd3ZF6czmLJrKGMYXsB RPHSkdAu9kOeJaTYhohXQXSGeMniGLXhcla20EEwDNTC1pwXdIdgGpwsv7c5MUKiVfJ4 R1VvZPx8vqt/LI+/3wwHRHtRFyTNoI0svx/XUBUrBuvjF/bzvA/Y6OWRrm0xZtMvR/F+ GYGXyzCyfra0P4oZkNg1YSYhQYcyfjze8MWS1K+ayD2T8KOWYRpy/oTWm5ghL2KGPbFm OyE/IwQEY7caV74dSK229wiG3ZJJvY53vrA2EAt4e0G0x3uKy7Z06SVhwwjmN7Rh4MdS DY/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T5KT6Auu94HJGq65sn5VmhXW8yJRnWzEtldTHa29AT0=; b=HIK+fqMbVGEOtxqhymqLcHSJUEaz1hxib42ZvNbwSYknHyAt+YEZeuh7cUiF5VNpli RQLPCC8gqYFdUlS1jJpsohXqdAEtcruv6wUPI8Ih9cil9GvXlNx4BuRWWDMtraHUfeen cMXwxxPABL4gefO2n8451r3y4b4biKaUcaOE0X1oET3aas9DAoBVFvtxzdnZxBvAvLh+ H/AGGT9fFUIPaAr03d5qA5yM/ZUWgW2S4Lpe/M59mcfMkctBE+ZwNH+mAOfoY0ZTWNaZ 4ja2sDV+1Ej02lRnwKdInPYqHbX0YiAgksNM2dTvP2GgWOogRmAorzP2kz1E9ToVxzfU BKGQ== X-Gm-Message-State: ANoB5pmVOppf4BaekYE/zaF87uvE8llTtfR61LGlBS+QK/fzSE0Gc6O6 0BoesitDVeBky2HSpSDUTA6JFQ== X-Google-Smtp-Source: AA0mqf7RrKWHYaxtFEHbgrJNq8V3fsNHj2nP6OKdVzjocdU4FuZSfkiFMUFoeWmVa3n6s4SCj1sykw== X-Received: by 2002:a17:906:3a96:b0:78d:f454:ba4a with SMTP id y22-20020a1709063a9600b0078df454ba4amr6226366ejd.73.1670597617418; Fri, 09 Dec 2022 06:53:37 -0800 (PST) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id bd21-20020a056402207500b0046bb7503d9asm728424edb.24.2022.12.09.06.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 06:53:36 -0800 (PST) From: =?utf-8?q?Christoph_B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, =?utf-8?q?Christoph_B=C3=B6hmwalder?= Subject: [PATCH 7/8] drbd: interval tree: make removing an "empty" interval a no-op Date: Fri, 9 Dec 2022 15:53:26 +0100 Message-Id: <20221209145327.2272271-8-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> References: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Lars Ellenberg Trying to remove an "empty" (just initialized, or "cleared") interval from the tree, this results in an endless loop. As we typically protect the tree with a spinlock_irq, the result is a hung system. Be nice to error cleanup code paths, ignore removal of empty intervals. Signed-off-by: Lars Ellenberg Signed-off-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_interval.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/block/drbd/drbd_interval.c b/drivers/block/drbd/drbd_interval.c index 5024ffd6143d..b6aaf0d4d85b 100644 --- a/drivers/block/drbd/drbd_interval.c +++ b/drivers/block/drbd/drbd_interval.c @@ -95,6 +95,10 @@ drbd_contains_interval(struct rb_root *root, sector_t sector, void drbd_remove_interval(struct rb_root *root, struct drbd_interval *this) { + /* avoid endless loop */ + if (drbd_interval_empty(this)) + return; + rb_erase_augmented(&this->rb, root, &augment_callbacks); } From patchwork Fri Dec 9 14:53:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_B=C3=B6hmwalder?= X-Patchwork-Id: 13069680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 255C8C4167B for ; Fri, 9 Dec 2022 14:54:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbiLIOyD (ORCPT ); Fri, 9 Dec 2022 09:54:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbiLIOxp (ORCPT ); Fri, 9 Dec 2022 09:53:45 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B673461741 for ; Fri, 9 Dec 2022 06:53:39 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id e13so3394728edj.7 for ; Fri, 09 Dec 2022 06:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w8l6YI6ll5WTtemsFOxZHnG0tRV3sgRpFSwrNSjhQUI=; b=QFl7VoOtaGk5JJJiTD/4KIC5FLgDPhNuBOMrb3WnSAoODL2ltc52rELA5f6yl7Bn7j mYbNUsXfDCJ75uQrG1lZrpy8vrWDSlLuNc+DwsQQohwm/k745BMOpiYBdnk8YyDlL9Fq 7eDn+Dtw+CSLH6wmrmqvtN68OZ461bwi3ogQi4pmiDXFrr15Amw9K+7sAjoYiCPtv/mc PMf+aDonj+6iew+Dh+5hsyQ1LSgQ6rvpmF51QrTg0U24d6fmLo6yxPrsR37jHc1CbRMJ tBqK9JcG0+r3Xk6QRttN7gv2gLonVRU/cK8VMDIfHh+fZ3qa8enXQbuW2vEfMals9jM0 IO5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w8l6YI6ll5WTtemsFOxZHnG0tRV3sgRpFSwrNSjhQUI=; b=B5WX7oprWnmdxG9JHgRpYv8RuT1U85IaFHOU1iaBW33MX6WBMsO82i5SqJ118z0e8p wbV/IC0BtGLAAyyzbdVRc6KnudH0H7tcbbFd11N4gl6Tj7SKND2zWNdtWMnK8vBRpLvU 3ZtiGhCyboUCt2QdPY3mGlT4u8r/m2pPIQxJ5KgDPMSJNeoQAGK0mYxrvdEpIzI+g07S 8YhEx0XLcWb8q+neolWPlO2yHLYMCJT6NeFJzFvtjycs7xHVtT5Emm+PBGkVR1oAC5Cl iODwc0XyncFSy9u9y10fbehFMDUVxlSRSttfltB0X9EoK9VWBTSsPkjTHSLnMvzMdBSI 7r8Q== X-Gm-Message-State: ANoB5pkVxzqEamCnNK26TPVl5XZNMvOZxhEQiTwggZzFIXDErO18oCqL Vg0C+vkJDfdh0jtGXQMheJ7sUg== X-Google-Smtp-Source: AA0mqf7iTbuKTrRATtfWNUUyFaIEQ2x3dRPnmp/q01kefuttCVcLa6LUxjn6tqOZ2JV/H/DHj4tTxw== X-Received: by 2002:aa7:cd46:0:b0:46d:e3f8:4ed4 with SMTP id v6-20020aa7cd46000000b0046de3f84ed4mr2215720edw.21.1670597618194; Fri, 09 Dec 2022 06:53:38 -0800 (PST) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id bd21-20020a056402207500b0046bb7503d9asm728424edb.24.2022.12.09.06.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 06:53:37 -0800 (PST) From: =?utf-8?q?Christoph_B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, Andreas Gruenbacher , =?utf-8?q?Christoph_B=C3=B6hmwalde?= =?utf-8?q?r?= Subject: [PATCH 8/8] drbd: drbd_insert_interval(): Clarify comment Date: Fri, 9 Dec 2022 15:53:27 +0100 Message-Id: <20221209145327.2272271-9-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> References: <20221209145327.2272271-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_interval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_interval.c b/drivers/block/drbd/drbd_interval.c index b6aaf0d4d85b..873beda6de24 100644 --- a/drivers/block/drbd/drbd_interval.c +++ b/drivers/block/drbd/drbd_interval.c @@ -58,7 +58,7 @@ drbd_insert_interval(struct rb_root *root, struct drbd_interval *this) * drbd_contains_interval - check if a tree contains a given interval * @root: red black tree root * @sector: start sector of @interval - * @interval: may not be a valid pointer + * @interval: may be an invalid pointer * * Returns if the tree contains the node @interval with start sector @start. * Does not dereference @interval until @interval is known to be a valid object