From patchwork Tue Nov 26 13:47:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180197 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp4656717ilf; Tue, 26 Nov 2019 05:48:08 -0800 (PST) X-Google-Smtp-Source: APXvYqw2E8gbk305T/W+wWHZ0uvcbrm5kSgMJAj6gocU8wtbJMazGRUKCSYKLU5qatpcos5TlPN/ X-Received: by 2002:aa7:d05a:: with SMTP id n26mr25737000edo.239.1574776088481; Tue, 26 Nov 2019 05:48:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574776088; cv=none; d=google.com; s=arc-20160816; b=rtqpHDpnNfdn9cHyFh97PgrNyftN0/u2RcS5t3iL87Ywp3PDx6dR30JklERyUEWMU5 WykmtgtIXQ5ag6B0E44f6lm2/3alGVM8J2OYgVmfjpu3JMqz6gz9EjxQamDXV6wBiRhU F+NG6qujkwxZRfBR4NIEAxzzRPWXVxPf3L1feLod53f/Fqj1a5kWOCfVs9tSzkXwEtMo BYlnqrEFmjAEN6tsgHzo/BiLlcIqlwDFxAzVVWj5+yKtk1KIGbmj8H3XVVEKcTmGRcw6 1qKnzgbGg8ofSRF8mFSq1sHnDPux5N0PcYjMMsK/3w5uETCW9hgnaWWieXVU2TF7bJcw UTUQ== 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=VAZCmvkt/DJ7QzgF3Z9hhn7Kok0+5MUn19Cy2Exwb/8=; b=hl5JoYN2ml3dfe+IK3BepwJqxbhgYR/5u5elm5xNXIgF00KXMPsltfXW2w1q3D+s5I 4IWPzd4d3O6R6JBuPrrxE/bukqEk6MNbtZVa2hB/Ycc5hlhFx5sWXmYPrqZv4gS3O7eT A+yy/dWTReSkzGSRdGKVebc+6lJJlIvJh4YuD/4Mla229htXwngoW43cC29RutE6MtQB fk1uEzQ7UU4HGUEs2BojaSdHyFnyjoeQP34UH557/aw6IX/mW9kVginC2En4iPqEoyl+ o9zqqBSBmtfYB+at8TcBIZ6c+0z4th7FMirvGs+GYuINspc++Erd/YjdACB1wdeKoHWB ly2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uXZ9+msV; 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 u14si741772edy.375.2019.11.26.05.48.08; Tue, 26 Nov 2019 05:48:08 -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=uXZ9+msV; 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 S1727797AbfKZNsE (ORCPT + 15 others); Tue, 26 Nov 2019 08:48:04 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38039 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbfKZNsE (ORCPT ); Tue, 26 Nov 2019 08:48:04 -0500 Received: by mail-wr1-f66.google.com with SMTP id i12so22599057wro.5 for ; Tue, 26 Nov 2019 05:48:03 -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=VAZCmvkt/DJ7QzgF3Z9hhn7Kok0+5MUn19Cy2Exwb/8=; b=uXZ9+msVzOgoEnkCOVRAAEtSHQd82VloBFMw50OGjZTTc/g2p3KVfeDddK0Xt7BlZZ gK7mQF1El3IvvRKFzbLbdY+FDBjKwDEF10QZLOrJF7V8OSUaIF2SagOfc0NJBQbasGfj VTxJkDnTnr6A0ixdewZJJNX9FjCPIKkABikqD9QI/MzgP6L+FrmYwnkJlKfmNJaVRvfI P5TIrqPz1eeLADwth9z09bjCFDHOV/jSd92Xf6QvBKgORkUMKeERkJrsVK3YoZ/XjwGZ +ZSdb/9L8pxKqSaDU8y6+/Hf9VI0jLmzbzGGtRIFRoGnLEP6P1qB5MT7si8Dw3E68qzi KAwA== 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=VAZCmvkt/DJ7QzgF3Z9hhn7Kok0+5MUn19Cy2Exwb/8=; b=lVMNVwbBor7eDPTXJEA7IXej4T3RZju3YoRbSRzim2stjR+XoEpCS6d58zFy2mm3oZ 4Pb5l8cEcyuywQi5R/XOgI19+8BBHszQuVM/HooMkQk8wSeMzEzuN0GWNCjPhvLZ0MZS PSOXN9JEspDxPJNbOzJVGyx/zRb0mN+3F73nQSyUGKgUl79kN5uapko6L0pWnRhsUzp5 six0u7AhbxvydvTkqnDBf2aMKd6nlDZ2khODfTbTqT2uFsc/t6z3id59WD5RMmrXO5Lq 9BbwpRCiLtBViceSkj1yBGBJT5wzU5rwKgMdJxqhhGl41dhtY4Jo78s+idsegm/0KaVb skng== X-Gm-Message-State: APjAAAWJUBJUpZ3G1uk5GiwCfQ+YYPOtP+AZkS3SYuAVeZHaRZb9WAHh vrxZm4MBHF0RrijnORUsMvZafQEssxM= X-Received: by 2002:adf:8426:: with SMTP id 35mr36750725wrf.262.1574776082123; Tue, 26 Nov 2019 05:48:02 -0800 (PST) Received: from localhost.localdomain ([95.149.164.72]) by smtp.gmail.com with ESMTPSA id o1sm15085560wrs.50.2019.11.26.05.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 05:48:01 -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: Tue, 26 Nov 2019 13:47:39 +0000 Message-Id: <20191126134741.12629-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 52e0019ee21351aef28ea1dd6037254580e0c56a ] 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 Tue Nov 26 13:47:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180196 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp4656729ilf; Tue, 26 Nov 2019 05:48:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyNQWyyf67N4JSjbEyqfdBNLLcC4XBKx2aGcqRT65Ogb1xtELT1zHUAH8MnrW1d4ETuPA5r X-Received: by 2002:a05:6402:714:: with SMTP id w20mr21180375edx.93.1574776088877; Tue, 26 Nov 2019 05:48:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574776088; cv=none; d=google.com; s=arc-20160816; b=gphU8WFkHHGrJHMb8KXDGE9nK0zKleinnSOwlHn74sDPEw6WfM3F1Vio9vW5zdRLG3 c3KoSDvwj8/oU2F2f1Xbs3DOhfE/fBzfUUgG282N4hNHi9STIX89jZHm+/vVMzNhKenR q+eBbYSMSXguVLatytDS8Gp+ca5nHLH0RHw0si1uy0JOuV4T92h7fvlw36JVb2xt2twL i8Ev1wb2joSwRaZ56RzOt0pLdHB7HcrGOf5KkR6eKh+dfmRYsz7BTAkwvoQJOLb5yz1+ muCVNXp+CKE4rVZepFXViNF4ct7xdbYcRE/UW6zPtSjFE69bGvNdm4TZC4hZtRevD43h AzyQ== 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=FGcA+7vXxKRcx6WDSWBFCHWdIUoDEfsPZ4JhROdYid4=; b=0wYeljcqGipebnLItu57GTQk0UySoJNpdh2VO8DdifgAhDouQc1AvEM00zNUeXXDFS qRb0yGkc8xYWNIa0QUWdbSfDJWge1uglD7x6Rr0oc4R1p+e1B32H2t+gZUnrO80hLGKP zknhDJfwBuE9kJ+UK77MV3p8X9MVRbwtdBIUWTQvxlP50UTAeOkBXisde+EG4Y5onFzr KNdo/d7AyiFC7wG8tu+J7czLLYy2EPY08FHgcAUO61r6gdG/HjxgCtfhWlSol5Jf4F4d 1/pzA9RhzoE/r+vYXh49tcaZ63gBASFgq9unpE9q4X/Yowup3evj3Tx9/Dt7+LwHWXdG XPRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VKvHmCQa; 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 u14si741772edy.375.2019.11.26.05.48.08; Tue, 26 Nov 2019 05:48:08 -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=VKvHmCQa; 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 S1727783AbfKZNsF (ORCPT + 15 others); Tue, 26 Nov 2019 08:48:05 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40500 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727792AbfKZNsF (ORCPT ); Tue, 26 Nov 2019 08:48:05 -0500 Received: by mail-wm1-f68.google.com with SMTP id y5so3375336wmi.5 for ; Tue, 26 Nov 2019 05:48:03 -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=FGcA+7vXxKRcx6WDSWBFCHWdIUoDEfsPZ4JhROdYid4=; b=VKvHmCQaqG9cbzGD/BEhjAPf+5Yd7t9LPkjwrNVr9MEv8aXUgCTJrPZROLJK5yggWG yqXktUtg64BjgQGJzdFZHaU+sDneHVCk/C7OMvDTZHPj65jXWRG6idKl2YXxMfiT9ZID r/GEnw0ITh/T8652LMgL/e2gNQQOk2OsYc/AKMZF1c750tejsvq+uIVfLyYLJe2zTzui na2GicsuTK0J/eCnGzE/tei9pkhlOoOAzJiF9f2o0KE4TJ0U5mkT3REMp7ue1pVOueLj cOf9JY0JuBeBNM1RqbZNAJ0yrVVIWQG0CHFNzk+iXS6Y59LraYgEUapJGl2GXpBhNkOS H94g== 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=FGcA+7vXxKRcx6WDSWBFCHWdIUoDEfsPZ4JhROdYid4=; b=DBZi2pHlLwIlu+lqYJjZmg4LvcjvSe1HnmD42BqqeKNaAhaIjABs+UmuxuUCBSlxW1 1JWa2nEDz0MtpEijeEVEdrRtTc+tCKfqnIH9FYWlpOGP/KftYU0+SLTCQfpREN2LV4Zb HJ6lvVCnj68sOXK5KYyIXCOlzHkGbzzTGDFBFcpNOjTo4FFqcT77VYWQdu7EsDk7erWN bHlDJI7AThijEpgcRcoUHlxycW7z4OnnPYUB82uW3SAtvxgZ02p8cvAWaaPW7/EK5ZbQ TvxxpIeMGvz8PkdDVj1zhDO/TEaIcA/KvIAse0M0zgk1uiNvH6hGppTb9IaknscNZk+d hy8g== X-Gm-Message-State: APjAAAX+l+N44KPmrLdQt7Qc+9/l08EfYknWMxCAAAQj7+kl7MF/qZ6z gPsWkRrN43PojfJ/yggou+G0uFsaRUA= X-Received: by 2002:a05:600c:2946:: with SMTP id n6mr4337195wmd.166.1574776082771; Tue, 26 Nov 2019 05:48:02 -0800 (PST) Received: from localhost.localdomain ([95.149.164.72]) by smtp.gmail.com with ESMTPSA id o1sm15085560wrs.50.2019.11.26.05.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 05:48:02 -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: Tue, 26 Nov 2019 13:47:40 +0000 Message-Id: <20191126134741.12629-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191126134741.12629-1-lee.jones@linaro.org> References: <20191126134741.12629-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 d1732e9fbadf5cb1e36cc3ee1e8dd8a0b7acca91 ] 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 Tue Nov 26 13:47:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180198 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp4656745ilf; Tue, 26 Nov 2019 05:48:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxSrY1zjuaPRdlV7XAiMdWj26WzCF9CKAypncEiGgiztYyNbEzc7PQLImos9Vml+pjhFd5l X-Received: by 2002:aa7:d7d7:: with SMTP id e23mr24592300eds.236.1574776089280; Tue, 26 Nov 2019 05:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574776089; cv=none; d=google.com; s=arc-20160816; b=oaz6o9rTQ4cvQT+SuXhENecehSRpZlHDlP06vRZLZkQjd9EksBwD4PhOL12Vq2HuJG 6PUxM+GZjSHkvhUs8Y7oV/FzVYpSn+Z0B3Xx3QNwksf0hTi1njcR/gbFixa8QGkkP8j5 +LlgOsltMLvTEYLS0UMggw8pG2LSXLHSN9xbAXbjlaFDmK6l7Ay8HlRju+5vTWebVq55 DjIzgU2kjRzBTVELYEMiN0QU+HmVpMPUDbLWqNJyPkSw7LK+Ve2wp6bv+WoofDbUW0TS if3qBgg6PNiv5EEunD/gCRFnuDqPWXtaRFM5G9sDWdp/dsJU/bAucJ7291vNngJRXLW1 kOAQ== 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=1q2B94XyALRvNRnvNJEB1AMhPK5UAr+ZiO6EcUlJFV8=; b=iUV3nJF7ajD0rLfgMFlpfo6Ot6YjAVRAkS4N5c+M+hHyerKI0dsYa8ttBwssqfQLoR 5/aESK175tTM6YB1/QS/+91o+N2OUF4rFwe6hoom5DEvoPc3aMqSk1+yxPJMGA8ACNSx Kvkga0j2FnTWr1T2eRxxTK8bAKAWeJ0jMmKyhn7d4rx2FxT05nvGE0McSykXpSTCr8cl kbnu27yg8rGt+EMqnclKzZZjrJ5tfPfbsW4bMN0tnJWBItYS2UcXQ+4vgdycNBmeevb3 4yRfVg96VR2ZPYWRIoOGIzDmynQON4rJcR1lIrWrL2+AgQLfZwqyyAXyQiDeca6t7vM7 7c2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rj4k/JL9"; 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 u14si741772edy.375.2019.11.26.05.48.09; Tue, 26 Nov 2019 05:48:09 -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="rj4k/JL9"; 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 S1727792AbfKZNsG (ORCPT + 15 others); Tue, 26 Nov 2019 08:48:06 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51163 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbfKZNsG (ORCPT ); Tue, 26 Nov 2019 08:48:06 -0500 Received: by mail-wm1-f67.google.com with SMTP id l17so3317324wmh.0 for ; Tue, 26 Nov 2019 05:48:04 -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=1q2B94XyALRvNRnvNJEB1AMhPK5UAr+ZiO6EcUlJFV8=; b=rj4k/JL9cDFx/gdRc43YTVFF1MHQbnsWvHaonIT4/LodaIf7+sjqOuDeTdAh1hl+dx rncXgAwlyvCMtFsaTg9XoFJyrqA3VUDkAByyT3yTFRylVAlozG9bVdeAO4VFgM0kHXHM JbOhs5ZgrarEWnc7bvb9vUz+o4bRZmqcMs2vmoOS9v2axfLKcD9oByeb9cche7vIRA4K p0V3gJEK8ZN7jL+0ClCM98GijIafmLjXKOZC6HdKmGSiyG9OEm3Ldb0NkoJ4ZimDMh/W XvxvfIlbjzqF0kXjU39t6Yqu0wvTvOovdh4pXmiy4graZMbMiVxVW981zOVJwFKP2Z5h 4uJA== 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=1q2B94XyALRvNRnvNJEB1AMhPK5UAr+ZiO6EcUlJFV8=; b=Cr0Zo5TktTM0E4eOt77vrFuiSBgiAzCio7AE5/8B9vbNzo36XBHRHSVgcCZzmOiF1Q 2+HOoCLZTc7YaEvEx3TVj6WUzmp/cNbMI1H8/yri0Zuo7ixZHoyVDPpJXIN3r+408gma vWICbSkST2kgHj/0N7zP0jJ2UiEBsfHLqvDI1Jq5n6BVlw54t//+JkebhLUmEw3nbmZq BKjQw8YjT4IK55fFCpeOGmrKHWcvAZ1IbMguTUGBXt+F/q86zr9OVExsuht+IpTQnZx6 MzD3Zo8Wamqaq461H8imiQ+sEPkRgrtZjpudnvELAbKmpBsjl8o40xVYeY6e1UTW9asn gk9Q== X-Gm-Message-State: APjAAAU0b8z+kt+N7vzGKlf7Mb/71Xp9XX+f9ey4s2cAtF/F9F8Ej/B0 nHCHhlhQLVPNV92s5mqgisqiVOLGhnY= X-Received: by 2002:a1c:f612:: with SMTP id w18mr4670519wmc.28.1574776083324; Tue, 26 Nov 2019 05:48:03 -0800 (PST) Received: from localhost.localdomain ([95.149.164.72]) by smtp.gmail.com with ESMTPSA id o1sm15085560wrs.50.2019.11.26.05.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 05:48:02 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 3/3] ocfs2: remove ocfs2_is_o2cb_active() Date: Tue, 26 Nov 2019 13:47:41 +0000 Message-Id: <20191126134741.12629-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191126134741.12629-1-lee.jones@linaro.org> References: <20191126134741.12629-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 9d452c602f0558ec3b0aeab1040bdf4dfbc590eb ] 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 */