From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218AbdHIUjC (ORCPT ); Wed, 9 Aug 2017 16:39:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43314 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbdHIUiz (ORCPT ); Wed, 9 Aug 2017 16:38:55 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook Subject: [PATCH 3.18 36/92] pstore: Use dynamic spinlock initializer Date: Wed, 9 Aug 2017 13:37:04 -0700 Message-Id: <20170809202156.964301019@linuxfoundation.org> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170809202155.435709888@linuxfoundation.org> References: <20170809202155.435709888@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kees Cook commit e9a330c4289f2ba1ca4bf98c2b430ab165a8931b upstream. The per-prz spinlock should be using the dynamic initializer so that lockdep can correctly track it. Without this, under lockdep, we get a warning at boot that the lock is in non-static memory. Fixes: 109704492ef6 ("pstore: Make spinlock per zone instead of global") Fixes: 76d5692a5803 ("pstore: Correctly initialize spinlock and flags") Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- fs/pstore/ram_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -528,7 +528,7 @@ struct persistent_ram_zone *persistent_r } /* Initialize general buffer state. */ - prz->buffer_lock = __RAW_SPIN_LOCK_UNLOCKED(buffer_lock); + raw_spin_lock_init(&prz->buffer_lock); prz->flags = flags; ret = persistent_ram_buffer_map(start, size, prz, memtype);