Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1158529rdb; Tue, 30 Jan 2024 09:28:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3ZQWbqzLnlkfJ0Fo2KM/rRiUdThR9iZOZUf4QgJzVFEKWdVIkXvHD3fhV5UHXv62gCHhL X-Received: by 2002:a05:6830:3d08:b0:6e1:1112:f129 with SMTP id eu8-20020a0568303d0800b006e11112f129mr10553280otb.42.1706635699413; Tue, 30 Jan 2024 09:28:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706635699; cv=pass; d=google.com; s=arc-20160816; b=YP7l2IsIG5xoRCzYRd0PlxczoN1Jc+Sc3VnJ2Ok7W7JZnb8dTskyHHiMVlTVDhda/0 IDQnSHjTD6zGAV4GDQiq31wUM/znUYfdR6l79B6l69kJ+4w2XOfjOgcbPr/sv84qJwFr KOtNO25Ohxnq/UrvqKkeXIUmPkR6cMy9xzYPbL16iALyPoa+9INYT1IaXpqQy96kHfgy 2TmYdbXPqsS5hi8tb2dzpLdouRRQ5awQS9AJOSInmza7IPcGeOXFX4Bov0ayO2xxCZJl YG9cC437n9D9x6y+6tdc/p9aWijkIsGUuKiS3cHRBt7K5HCA41Hdo+K7c4mZJ5/VpKGx vPtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=yPkAsTd3lfCXj087ycF1yP9whdjvxN9s5038z9y69lg=; fh=pYKInfd1MHT4QXiZnP7XbeDiJlD1Jk3ZT2qfGZFamD0=; b=aE9H+sGk7/ZvyQB8VYRgHJ5EMkhr4lZrklIQugOgfcJCr+IRmSHbvWPvLPekhtzkP3 8065X0R06pKgk354NgjEDiYXdXDnSoVfoW7XetpEVrOGqain3wRBc8EF0pFE8+idK8k/ w42Aid4qLmK/Tjyz6Eh4UxSUn/aoPiYKxb54JBHjgvN9eSVR58QEXwCMSkeDnQkj/TkN Fv9AaoHUBvRmV//Abn+YFnFit+Kb881iDgmTYrOmb8C/ZNBosODM0GPY95qzbCUf4WtD 0ZCyF3kpGbdutBtfU0fjjnnXQyX+x23D46YxBP1SuKfz5dss47xKkU/Loq5G4cTLzgFJ 4Yig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O6GYPm23; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-45039-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45039-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a24-20020a637f18000000b005d8b52d0876si6172730pgd.109.2024.01.30.09.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 09:28:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45039-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O6GYPm23; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-45039-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45039-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 22E332872FB for ; Tue, 30 Jan 2024 17:27:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C993112A147; Tue, 30 Jan 2024 17:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O6GYPm23" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDC9D1292CD; Tue, 30 Jan 2024 17:27:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706635668; cv=none; b=dnZEEHf7l0rd77lSvfBDrqkgIUONK9DUNBIo0yihaKieVktExAdBrYLuPPlRcH1563BCWvf8Iz6aj9KotBa/nLvtRfHK3krWnHciHCl2YG5ULJAl0nnND26BGdGlrg0ONd4pdd+eo6Or7382x7sM9F80117yi/fQfxeOilNAlAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706635668; c=relaxed/simple; bh=ExHtMHFhc8+GQs5GVCQvMdASt/COJfq1w+DGLLm9XZ4=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=BDrQA4EWoODL2j+lGrgrXcfpTPp1VbMrnTbLQbLGlA7z9hXZB35eMB8DtGfA6+gyDp+2akkP26ddtZXxnq8EOH9RP/ZwKuUD3Pub6VOCyNJkl/oUfQjjN6s6YvoqJ+aWUZhDNxzan4kyetNSPu4YvEV2klzjOhjIVYhGZfXUH28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O6GYPm23; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BE39C433C7; Tue, 30 Jan 2024 17:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706635667; bh=ExHtMHFhc8+GQs5GVCQvMdASt/COJfq1w+DGLLm9XZ4=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=O6GYPm23K0wHcpG9+FscQZSa3zkVBqEKNKkUgCVD0J/eW2tS4hAj3N8LzFf06jlYj 54ALyOQKZIRTk34+IUTE0FNqYdzwaGqy2RnCLb10oNijhs5CP+iKUzlqQHM/73RkU+ Mo5ALXyFCSWnRraFJxUDICDfKhJvGUiiktoPoG7Xtfpu4+c+Nh8lCQJXxE8/WTu9Pt ajbeBE6ZG7PL8TVT+lPxjsU0p2gCoQ1lAmG2hrhDW4AjvuZ16bovvuA0DN1wBMX1Sw Bv38Il+WtB8A5xYTAHqufan1SiMLWS+6yd1ff8Ezf3PHL0sgG81oFsCciUeLcjj53r 2AUt/nHbYoKsA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 30 Jan 2024 19:27:44 +0200 Message-Id: Cc: , Subject: Re: [PATCH v3] keys: update key quotas in key_put() From: "Jarkko Sakkinen" To: "Luis Henriques" , "David Howells" , "Eric Biggers" X-Mailer: aerc 0.15.2 References: <20240130101344.28936-1-lhenriques@suse.de> In-Reply-To: <20240130101344.28936-1-lhenriques@suse.de> On Tue Jan 30, 2024 at 12:13 PM EET, Luis Henriques wrote: > Delaying key quotas update when key's refcount reaches 0 in key_put() has > been causing some issues in fscrypt testing, specifically in fstest > generic/581. This commit fixes this test flakiness by dealing with the > quotas immediately, and leaving all the other clean-ups to the key garbag= e > collector. > > This is done by moving the updates to the qnkeys and qnbytes fields in > struct key_user from key_gc_unused_keys() into key_put(). Unfortunately, > this also means that we need to switch to the irq-version of the spinlock > that protects these fields and use spin_lock_{irqsave,irqrestore} in all = the > code that touches these fields. > > Signed-off-by: Luis Henriques OK this is great. I mean in this commit it is pretty essentiual to document that there is an ownership change. Such changes have by far the biggest impact to kernel semantics, and thus very useful to mark such commits for e.g. bisection. Reviewed-by: Jarkko Sakkinen BR, Jarkko