From patchwork Tue Nov 1 06:17:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16792 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 2FC4C82413; Tue, 1 Nov 2016 07:17:57 +0100 (CET) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=CUP0V/Y6; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 749FC80367 for ; Tue, 1 Nov 2016 07:17:54 +0100 (CET) Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from sven-desktop.home.narfation.org (p200300C593C4E5F975BC0BECF433F47B.dip0.t-ipconnect.de [IPv6:2003:c5:93c4:e5f9:75bc:bec:f433:f47b]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id E687A1100A9; Tue, 1 Nov 2016 07:17:53 +0100 (CET) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1477981074; bh=BaIro/IoCBzmTTd2mvyCv8fFWg+iJ/0IzRS2b3uWovs=; h=From:To:Cc:Subject:Date:From; b=CUP0V/Y6iI8wqkhHsqNC21+L2rVKhzsyaCWO16mrcyObX2XF1ICFI6wCTMBdFL0m4 nqyVFGA8sY4lbrISfSnu5imq/PGwiEihBSjPRhwkC1Audid8KcHaE3wrU6tG/FwamB L0cfkr7BWQ7sOICgBoKuUVefKikaWDsTe1uOuSPE= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 1 Nov 2016 07:17:50 +0100 Message-Id: <20161101061750.15995-1-sven@narfation.org> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Deactivate __ro_after_init for kernels < 4.10 X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The pre-4.10 kernels must write to batadv_netlink_family after the family was registered. Thus disabling __ro_after_init for now is required on these kernels. Fixes: c776b4a071d8 ("batman-adv: genetlink: mark families as __ro_after_init") Reported-by: Linus Lüssing Signed-off-by: Sven Eckelmann Tested-by: Linus Lüssing --- compat-include/linux/cache.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compat-include/linux/cache.h b/compat-include/linux/cache.h index 93dff58..7b7069a 100644 --- a/compat-include/linux/cache.h +++ b/compat-include/linux/cache.h @@ -24,11 +24,13 @@ #include #include_next -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) -#ifndef __ro_after_init -#define __ro_after_init +/* hack for netlink.c which marked the family ops as ro */ +#ifdef __ro_after_init +#undef __ro_after_init #endif +#define __ro_after_init #endif /* < KERNEL_VERSION(4, 6, 0) */