From patchwork Wed Nov 27 07:22:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180264 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp5735924ilf; Tue, 26 Nov 2019 23:22:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzY/7j3iy82CKQNjBMcBod0j/pyMtOsh229Cmgy8ig4L71ghbXoDw1wAazWcDkeONAbIA6M X-Received: by 2002:a17:906:b25a:: with SMTP id ce26mr46989405ejb.13.1574839350481; Tue, 26 Nov 2019 23:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574839350; cv=none; d=google.com; s=arc-20160816; b=VLp1BzHWDlBnrVsTdhP0XpA18suy1iBZaZH3vG5Art5y3i//9dg6cn74h8LvPK3qxk vnl5+HF7zcbnf27BMhK55MIBACBLB4pVIGHsUlNTDTmpcXrqhbjZ6giuzy0PU6PDNfrG SNQCeW8boZwTOSjcCfm4S8u8Kq4nFPAlhbYhj5dXuXxDmp11BYCdQJtOyhBMAzwavmOh UwXhRr0reCGJI5RovmMtdX9ixaC6lV9VFo+QNZN4ll020sfrdU5sQepExG5vbQ0p6aQF uX7424aSP+h8a3lo2vdGGrImeqt6SGijG/wcalPM7Jdhkhoe3RwiIgv503waFNODa8II lhpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=HKmKV2QnHf6L1Be1GDSF8wA+iVwfLA2DutY1g50TZSQ=; b=Z3rL0xrNc73Z+Frz7Z/SdnPoaNa25l7ZZtZzLa2W1LI+7JMs7U6voAoCnLAFVaUaKW UQoRXq9C2Z5ShDD5h30xob6ZjKGX6k2d1R4K2EeuqDzpKJ/JCVNaKxAT6uZfuNbDp2x6 PB5VNm18hJVob5godsHS5tNVukHiqdJk3Ssq8gqS1n6KJAlGMC54KIB5nG46XStdP0A2 sHvzrwUjSnbrD6ynbw13NcA06KV1j4MBJhGeCaD1YLFG25xLgpHtdQBJyvoiV7W3drDw o1pCuJEsbCpSW03i+A7ClDFmcNUR8+rxobOdYEoouuQqLzWDhvfVnSqORQNkmKDKIHi4 krsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NBlVlsL9; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si69058ejc.66.2019.11.26.23.22.30; Tue, 26 Nov 2019 23:22:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NBlVlsL9; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbfK0HW3 (ORCPT + 15 others); Wed, 27 Nov 2019 02:22:29 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54386 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726470AbfK0HW3 (ORCPT ); Wed, 27 Nov 2019 02:22:29 -0500 Received: by mail-wm1-f68.google.com with SMTP id b11so5858694wmj.4 for ; Tue, 26 Nov 2019 23:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=HKmKV2QnHf6L1Be1GDSF8wA+iVwfLA2DutY1g50TZSQ=; b=NBlVlsL97KGwwCAPQ7DAncBZNY0kxh+nt1m9SZ3ouwiA9cTnV4WQZvIEqNi4S6G12G U3OoSyyO0eXoLoaNz5ZdeCxjRsA8TWTZS22tg455uHWbXVKvfYIvunULQLVbPdbXWElO 8XG20hKxle6bKhWPozxzo5PUgMy+QwJfYwL8QDWzm9J/1OaCh3xp8Z47cbYv0BfXrqOc QlN0IbMg4cskZDgVzli54sU7eMexwYRrqowUkine3lZCl8ErPc/pDmFtoJ2G/BLYnbDQ 12rl+XRq1hukXfrJFtFdpPuAFsGRFNU1XepjK2/t/zNNlJ0dV3wXndkA6mE6r4sPp7fZ fPYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=HKmKV2QnHf6L1Be1GDSF8wA+iVwfLA2DutY1g50TZSQ=; b=r6HbwbX84hzlbpFjYRwvu/toi9MJNELVXgH0wi0wwA2mxrVYLwfGk4DkT0z5O3k0B+ OsnRe9/SHkmOBpg+epmGwiUkme0nxO/hkL0/yJQ++2wfgcSRrkhtWkzclEMmOQG45ZH9 1XQXjjpAmFhV2hyq3itfWNbdiF0zSyvtDydD+rh5D01cSgg5h/fOoeQ+dYrr9S7asBOg upA121JK8ZSARC1K6hUf2Ts3AZ59qciGE6N7zOMkMToDlvLK+awurxM90hUxh7q5WLOr 78rz3qOCnmX/6DGLwsCP64o+dpf92flFxQNG7QJ+tKuN9QJL99WkngW2BetgLrk3vEZA tG7w== X-Gm-Message-State: APjAAAV/w7fufguzTbpe3SiAmTJZ4ilN4RBwhmuLNuCjYZONtv30AxED UEXLYLFaPKFjaNz7743hOMW4dvbldlw= X-Received: by 2002:a1c:7f94:: with SMTP id a142mr2644622wmd.33.1574839346273; Tue, 26 Nov 2019 23:22:26 -0800 (PST) Received: from localhost.localdomain ([95.149.164.101]) by smtp.gmail.com with ESMTPSA id c193sm5986641wma.8.2019.11.26.23.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 23:22:25 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 1/3] ARM: 8904/1: skip nomap memblocks while finding the lowmem/highmem boundary Date: Wed, 27 Nov 2019 07:22:08 +0000 Message-Id: <20191127072210.30715-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chester Lin [ Upstream commit 1d31999cf04c21709f72ceb17e65b54a401330da ] adjust_lowmem_bounds() checks every memblocks in order to find the boundary between lowmem and highmem. However some memblocks could be marked as NOMAP so they are not used by kernel, which should be skipped while calculating the boundary. Signed-off-by: Chester Lin Reviewed-by: Mike Rapoport Signed-off-by: Russell King Signed-off-by: Lee Jones --- arch/arm/mm/mmu.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.24.0 diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 70e560cf8ca0..d8cbe772f690 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1195,6 +1195,9 @@ void __init adjust_lowmem_bounds(void) phys_addr_t block_start = reg->base; phys_addr_t block_end = reg->base + reg->size; + if (memblock_is_nomap(reg)) + continue; + if (reg->base < vmalloc_limit) { if (block_end > lowmem_limit) /* From patchwork Wed Nov 27 07:22:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180266 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp5735954ilf; Tue, 26 Nov 2019 23:22:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwSvZ5/R8GjJWQ4Zi7kUY+yC9nEZFZoT9ngCq/eaTWAtQWbkRg3m+6yUW7gZb5z3gE7GtQh X-Received: by 2002:aa7:d9cf:: with SMTP id v15mr4257605eds.182.1574839352360; Tue, 26 Nov 2019 23:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574839352; cv=none; d=google.com; s=arc-20160816; b=lnlRe3qiyjqQPiWNiWIsQ23jsM/G5n84er+4Za+uRbcNtBI/+aQy5PdMWFNK3XsS9V JAOObi1QREOQ/qANx3Tc/zy5KoBH1189PsU7p2g0IAY3YpEz46RSOAJpBOpDaAEN6d69 MyfoLva+dmFOhhFUtxPaHwUub8IUp6Y1nxW8Om+jWD66LvaTOOl+8xW13aw7CMkyVPnO /8fJWhHQdMKelcvnbnhdtx/ZGgILV1jLwmIgFK3FnkDxulri+C3ugDJhvUOaJmW+N+n8 W5W4M4D0HSZOywlkl2zfIWSsT0SphXotjKStMPpOFbTwbOVqbNPUqleCpSL+I6KKre43 og7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=R5s1kUXvUZFaJy5wLnwelF0UUYDE5IPYznburQcZxDg=; b=S+qOfdmm1X//54WLolzcx0qAgH/OKjXWNO7sJPi6/4w6P7GyKxwARBYYXc/zoaeF/G 8VATn9MQajXO35CCoHfnC+neBSF8uRgqKAmM5aOsF64/TSjL0guwCzMYlG3+sHY2ZQJf TNRkP3LH7t7k142K2HweHX4rCbsiJ5WFuWy5aNSpZllaB8vTOnUs6a9ROVwWyL4e1Mso ROYy+ZKeofCY42Uuzdjtb4LQ9Tqgi/wrh1HuaO6AsGhHm099WGPhkrEgSazjTb8LLGn/ jW6BJ+cJPJgIpp1n0vcRwqpUFDSIP1E4ZR3RduXCzXpusoua/5MCEs2lhCOWsRd+iFpy w+OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nGUOSLki; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si69058ejc.66.2019.11.26.23.22.31; Tue, 26 Nov 2019 23:22:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nGUOSLki; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbfK0HWb (ORCPT + 15 others); Wed, 27 Nov 2019 02:22:31 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36741 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfK0HWb (ORCPT ); Wed, 27 Nov 2019 02:22:31 -0500 Received: by mail-wm1-f66.google.com with SMTP id p17so270184wma.1 for ; Tue, 26 Nov 2019 23:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=R5s1kUXvUZFaJy5wLnwelF0UUYDE5IPYznburQcZxDg=; b=nGUOSLki7E1LNbEgBb23RLE4DYeXcHGmwS1UV4LdSReQvQSWoCYGJa6mZA+Zq/GWIH zy1Qx6SrFAYsp0dq1b0XECEEDVDV0WlBh27Y+7iJS3WW4Vaz/UlR6MPkSAFu7QgyCAlR nlOjLmghgT60iMT2hT/BTBf9FI9Qd4SvI24qANCY1lNuMwTnanKW3IZASdRQO4RfKsMF EPxmaXyTQtfWJPmxcFKgCvv07kFlkB5HYeG50T5w3omsfxV1EZW76ID0cnMgQNh9wgiH 0+rjsflQnbD2sOtzS1z3c5nAEJD7xx56qHBI5yp0eVq3141pXICvq4Bd8746r87udaSH 9NNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R5s1kUXvUZFaJy5wLnwelF0UUYDE5IPYznburQcZxDg=; b=eZbceOq+t1q6NpIsGoH7Wo6vtWLmvY686EzUCYzEfkfq16uQkkG5E0SNZrZYvKxXc4 PYT/XVdM1YlsnosFGy8IIVxAyTZbOJ+jt0x0aQ1CUSK/+P/GKI8xFe4R1skZ/wI3Hk/n ftHdoHlMJKcUXPUZfK+XrMq5p8CZY6vBdjPb3Dhydvyfw2xmVZRjmrSLOimkn55GyTr/ sETLOKP38CnVDxf8G4EFg38xyJp4Q9p/A6s9GTRhVrg8JY5F0JM9LQjonDJdpmi9YLcs E53mbrkTYcaiWIW3FTnbzVoi7yLYzfJwh9Q8u3j2JpCkAaJjVZnPhQFBqQSvZ8ZhX1Mj sfVA== X-Gm-Message-State: APjAAAWUEIREj2MAGYX4jBKe50mA/g+mNgN2DaMPytB/G9B1yYNLtwhE 0GMCHd2bdsxBUnVPTdkou15117WnV8k= X-Received: by 2002:a7b:c308:: with SMTP id k8mr2693385wmj.32.1574839347122; Tue, 26 Nov 2019 23:22:27 -0800 (PST) Received: from localhost.localdomain ([95.149.164.101]) by smtp.gmail.com with ESMTPSA id c193sm5986641wma.8.2019.11.26.23.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 23:22:26 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 2/3] media: siano: Use kmemdup instead of duplicating its function Date: Wed, 27 Nov 2019 07:22:09 +0000 Message-Id: <20191127072210.30715-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127072210.30715-1-lee.jones@linaro.org> References: <20191127072210.30715-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wen Yang [ Upstream commit 0f4bb10857e22a657e6c8cca5d1d54b641e94628 ] kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Tomoki Sekiyama CC: linux-kernel@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Lee Jones --- drivers/media/usb/siano/smsusb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.24.0 diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index 3071d9bc77f4..38ea773eac97 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -225,10 +225,9 @@ static int smsusb_sendrequest(void *context, void *buffer, size_t size) return -ENOENT; } - phdr = kmalloc(size, GFP_KERNEL); + phdr = kmemdup(buffer, size, GFP_KERNEL); if (!phdr) return -ENOMEM; - memcpy(phdr, buffer, size); pr_debug("sending %s(%d) size: %d\n", smscore_translate_msg(phdr->msg_type), phdr->msg_type, From patchwork Wed Nov 27 07:22:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180265 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp5735942ilf; Tue, 26 Nov 2019 23:22:31 -0800 (PST) X-Google-Smtp-Source: APXvYqymlghA6eBDRgOrPuhWPfby4xZ0pnnvs0t+lTVQFjfgSY9Xui8xcHP2rQxzR0pX39kKI1KZ X-Received: by 2002:a50:8c02:: with SMTP id p2mr30072965edp.30.1574839351711; Tue, 26 Nov 2019 23:22:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574839351; cv=none; d=google.com; s=arc-20160816; b=IIbXNAxcQUuo9GkDWpA5aYV8gAaAs9akIg2HS+6j8WbMRyDA3Xns0fzwmlTRoowl8i Bz8l3ao5m6peurmt+V+u6y/5jwF9RkhfqFnFKBBOOGAzdROou/RyQpGdO6qmd/i0AYRN r6FZqTVJZTCC7K9EYiMLuGkoKnfGejgyxvky7kKdFMr1E5HgfqzHEXW38amypgaGFdmU JRh1ZX0ol2Tgq3gwu7IVj4qr1fG8EBt31r78jWXSSVfxipK5YW7DRnxzVVCvypRcts2t 0XH2EH4vqAY1pcDJyyLIFq91XTOH4DYoCXBDb0KA+wW5g7PQYlR7FcKFt24mF/n5ngoV GQiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=pGX23hmz91I1hVCX2PBQK2x2zyM7e2qWXG1Dd3x0TEU=; b=J60gNS40sxRuIARzwwYpM5LaZdgLg1PaZJQQ5lci20yEz+KjaXXXRv/KYT+jPNWTyY vpSYUpu2uNnLfcw115Q/6spr/2OnNVkiRkDcvLwNEVvWWqoaZkQOdBLgp8h7PHOF8MfX sSgdn9OA5l/SYJsTHB+xepLKq70g5tRNeFcfK6SpG5FyDs6xfCZra3XMZG7aZFdIrjuk VeReXfQDrGceMhQrSW9igNovKbcLi8OxpH4ZVfKrd6vJyVNztqYEGxaJjxpI+xA07doP XQnkrs8h+eELENTQw0pOHfqe0DlvZiP7ztwjplUPWd7mO7fQZVkABV0sCuVl76tCJ9c2 7k5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JU+OA2Tx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si69058ejc.66.2019.11.26.23.22.31; Tue, 26 Nov 2019 23:22:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JU+OA2Tx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbfK0HWa (ORCPT + 15 others); Wed, 27 Nov 2019 02:22:30 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38040 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbfK0HWa (ORCPT ); Wed, 27 Nov 2019 02:22:30 -0500 Received: by mail-wr1-f67.google.com with SMTP id i12so25435271wro.5 for ; Tue, 26 Nov 2019 23:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pGX23hmz91I1hVCX2PBQK2x2zyM7e2qWXG1Dd3x0TEU=; b=JU+OA2Tx+sCieIUBKnseglWk56a9B55Y1OVcW+ZqUXHsPbUli6Ef+BRjNwDBfWZBsz LIZDcNjfMs8thyvVpGo8vdc0M1+kiN4pi/aaE45U6nBoIJrfHLVvBhOPsc22yrMt9RNp OI49Nw0RrL0RjJ/jZXneNujFjlJrOKiGOpd7OaLKmzNbHxipp5XrfyNO9SWHNoP0LF+N TNxBqUu1ci+pfMfyOjez/bMdUYsHdt/RgSI4DNQ18H+Wqq2ua5bZsfligzZwNMlyzuND 1DUsJCE0dbrGgsHN7nipdi5Kr4GvKqL4rgEp2Hks9/XykP7oQ+V1ryqE08pfzBHfud4l 9A0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pGX23hmz91I1hVCX2PBQK2x2zyM7e2qWXG1Dd3x0TEU=; b=AVgxY9PEezSrgNtTnGzwdfHViq8z//TR5DZM0bGlL28v3WD2mMvpc63lZFnlaNmWhh iYH0BiG4qZVFp/qpn5KYS7mv5r5eVxsVH2v46WHuvqrvgHUADKKwp2nI7C5BALxc4NNR MA658UdnCCY4JfFEPjtoufQFzxGTlGTUzuQAItsE5PzhhW9IodD6MvR7U5t/yDYF1jch FtNBMQS49sYO/tXfM+zcRnkVAY+dzdFJ8BMxyuQQ208kYEyPNBCF9m8Hdbip485pf9hs Xm/6txKJLE5oeEmmKFBq7y3OO6BbVTAv1EtaVE5O8r1qefh80MeTQMept+6zq8jSqjTY CY8A== X-Gm-Message-State: APjAAAWwZW21n1JDF1S6Xq9lWDWWaUtBYMtI6Rap9kAcoiDVw+d6/2sj xbJAg7CpbHZwUP2eUE42pgayo/LC4sg= X-Received: by 2002:adf:f606:: with SMTP id t6mr24454036wrp.85.1574839347996; Tue, 26 Nov 2019 23:22:27 -0800 (PST) Received: from localhost.localdomain ([95.149.164.101]) by smtp.gmail.com with ESMTPSA id c193sm5986641wma.8.2019.11.26.23.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 23:22:27 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 3/3] ocfs2: remove ocfs2_is_o2cb_active() Date: Wed, 27 Nov 2019 07:22:10 +0000 Message-Id: <20191127072210.30715-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127072210.30715-1-lee.jones@linaro.org> References: <20191127072210.30715-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Gang He [ Upstream commit a634644751c46238df58bbfe992e30c1668388db ] Remove ocfs2_is_o2cb_active(). We have similar functions to identify which cluster stack is being used via osb->osb_cluster_stack. Secondly, the current implementation of ocfs2_is_o2cb_active() is not totally safe. Based on the design of stackglue, we need to get ocfs2_stack_lock before using ocfs2_stack related data structures, and that active_stack pointer can be NULL in the case of mount failure. Link: http://lkml.kernel.org/r/1495441079-11708-1-git-send-email-ghe@suse.com Signed-off-by: Gang He Reviewed-by: Joseph Qi Reviewed-by: Eric Ren Acked-by: Changwei Ge Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Lee Jones --- fs/ocfs2/dlmglue.c | 2 +- fs/ocfs2/stackglue.c | 6 ------ fs/ocfs2/stackglue.h | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) -- 2.24.0 diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 933aac5da193..178cb9e6772a 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3603,7 +3603,7 @@ static int ocfs2_downconvert_lock(struct ocfs2_super *osb, * we can recover correctly from node failure. Otherwise, we may get * invalid LVB in LKB, but without DLM_SBF_VALNOTVALID being set. */ - if (!ocfs2_is_o2cb_active() && + if (ocfs2_userspace_stack(osb) && lockres->l_ops->flags & LOCK_TYPE_USES_LVB) lvb = 1; diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index d6c350ba25b9..c4b029c43464 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c @@ -48,12 +48,6 @@ static char ocfs2_hb_ctl_path[OCFS2_MAX_HB_CTL_PATH] = "/sbin/ocfs2_hb_ctl"; */ static struct ocfs2_stack_plugin *active_stack; -inline int ocfs2_is_o2cb_active(void) -{ - return !strcmp(active_stack->sp_name, OCFS2_STACK_PLUGIN_O2CB); -} -EXPORT_SYMBOL_GPL(ocfs2_is_o2cb_active); - static struct ocfs2_stack_plugin *ocfs2_stack_lookup(const char *name) { struct ocfs2_stack_plugin *p; diff --git a/fs/ocfs2/stackglue.h b/fs/ocfs2/stackglue.h index e3036e1790e8..f2dce10fae54 100644 --- a/fs/ocfs2/stackglue.h +++ b/fs/ocfs2/stackglue.h @@ -298,9 +298,6 @@ void ocfs2_stack_glue_set_max_proto_version(struct ocfs2_protocol_version *max_p int ocfs2_stack_glue_register(struct ocfs2_stack_plugin *plugin); void ocfs2_stack_glue_unregister(struct ocfs2_stack_plugin *plugin); -/* In ocfs2_downconvert_lock(), we need to know which stack we are using */ -int ocfs2_is_o2cb_active(void); - extern struct kset *ocfs2_kset; #endif /* STACKGLUE_H */