Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1626643lqg; Sun, 3 Mar 2024 20:43:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVjEJkDV9AM1brljBhkoL8x4hN133eNvS9bLKjzXhkRIKwhw7A+GH2v/Xr5XJvgByIG36xONd0iyzZCQOjBkShrN1YA0dAc7JDzF7BC/Q== X-Google-Smtp-Source: AGHT+IEFDGlp03phMRpCX3hgGi9TYdbatc1RYPBC1H9x57bWtZcZ1J+XL6G81ahWvJKZMCPROSD+ X-Received: by 2002:a05:6358:888:b0:17c:1bd9:9be8 with SMTP id m8-20020a056358088800b0017c1bd99be8mr888515rwj.9.1709527400494; Sun, 03 Mar 2024 20:43:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709527400; cv=pass; d=google.com; s=arc-20160816; b=ubYJotJbZshH2LhMaVWoIxzdf0dSrS+vIvp3msSlNPm5477XVSsUfeJNU0QzIViYmy 1IwNX/r1o9h16FVIFuovzvGWaKfSjcwEMydovli4hKZ1u3nFzKLbzS1EB+TXWVSrNvfL 6enkYeccJ1Lg0eunN7F5idMvFNVTVLq+9ghLI/wYh3V5C3qRAe716oCbH8usFq/WEhzp IRYjz+NCnTq0BeHTZA0sOB0spG1KVeNGGYHVeIx4E4J3lQKdi40RvA901kakBsh8rTd1 dDzlbkDXCKUWN2mnexyvU82pNEaeO4VutsafX7iI+WUnLH8Ni8zQv3k+ytnkDvKCIVuJ NhCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=DDHbUZRDFgtYefhvGBrM7gomjbPYKx2uf4imiRFKtEY=; fh=oGCWKUgN5rqvEqhxhGaFnCKhx0upqxg87fHnuYmJPFg=; b=FZsHepXUjyy521aR3Dqy7xR3j3wRylcKtWBSMR+7cDjenm4u/xeuL4FoGhuWM4dayl JqHyzzdl1e9FrEXLrWhHNnnHTtwacXg3ND7Y9/syKP1zbzRTXw3vSpDf/jQyWxw36WbS CCkSLa284ljxdPDNv0XrbenEVeH71uOSu1n8+5vP4g7cjNKaSic3m1QogxSjuxIUFzgW 4FpTCuUVr/eWxgPgiXF8CZk+Ds5Ep5u45oqyx0rYt7rQLUu0EQRO3InV8CaUnsZeUfWk jZNX+lUk/EoYXndSSy/NiG3UjChB4K30xkohvCkSTNx3/fWv5DGKVHhWXLYazYaCF49L zPzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AkZaAHZA; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AkZaAHZA; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-2151-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p18-20020a63f452000000b005d760c23e09si7831354pgk.146.2024.03.03.20.43.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 20:43:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2151-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=@suse.de header.s=susede2_rsa header.b=AkZaAHZA; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AkZaAHZA; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-2151-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 EF9472810B6 for ; Mon, 4 Mar 2024 04:43:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6923B17F3; Mon, 4 Mar 2024 04:43:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="AkZaAHZA"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="zG1zJ9yS"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="AkZaAHZA"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="zG1zJ9yS" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAD4C17C8 for ; Mon, 4 Mar 2024 04:43:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709527398; cv=none; b=HJ0PQdEeWDUM3BUanCFPeR5GWO7kySIfF7eHocT2wnbxg2zxpLjx+C0+LHrD1l8A2zdBX1beq4P39Dp+2BG/v5V/hV+F5ha41UnngYdzMW+foMexNgq12uAPwhMC9+8xM50/w6nxt942OINjpoU0d/OnxQs7bjt9PQmcqJYB6dw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709527398; c=relaxed/simple; bh=mPdWC9bbuw83jcdll88gCoSK23g0WaSqD3d8An1DR6k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DKzH2C1yOeKnQTPF3BD74FyPSnbTriIWCBKgSYcWvltorIUKGuifl1R74yEl7bdRXiVKs6jXK/X2trmKUXI3XN5T9qHz3H6Wqlcalcr+DRDx+D2o6Bk/pr3TYNlFI2S567JKDbQor8UI4spEVR2baR+m8DYZDIAWPLHkOgmAjec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=AkZaAHZA; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=zG1zJ9yS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=AkZaAHZA; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=zG1zJ9yS; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 99712680B9; Mon, 4 Mar 2024 04:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709527394; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DDHbUZRDFgtYefhvGBrM7gomjbPYKx2uf4imiRFKtEY=; b=AkZaAHZA+2XdmAPjepvEgT7w9+K+d8Yxkki1XyyOeP0eStdT3drJpDYSAeokz57zYkzrqf HLEe+K6bSt4Z2sF6SBY4FmmwPDpl7XacXoowL9h7x7FUY8tR3KyyKNWCqgFVfUmoCOMKtx HjaakfYCAT1zpEz0y/8Km4tT0+tSvds= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709527394; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DDHbUZRDFgtYefhvGBrM7gomjbPYKx2uf4imiRFKtEY=; b=zG1zJ9ySSHz2uoJsZZHq6dXEbM23VjUVIJKFfNKcNaplL/ijkeFDrdj3SnUne7pEbBRSQQ G3M8ipaP8v5GZ2Ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709527394; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DDHbUZRDFgtYefhvGBrM7gomjbPYKx2uf4imiRFKtEY=; b=AkZaAHZA+2XdmAPjepvEgT7w9+K+d8Yxkki1XyyOeP0eStdT3drJpDYSAeokz57zYkzrqf HLEe+K6bSt4Z2sF6SBY4FmmwPDpl7XacXoowL9h7x7FUY8tR3KyyKNWCqgFVfUmoCOMKtx HjaakfYCAT1zpEz0y/8Km4tT0+tSvds= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709527394; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DDHbUZRDFgtYefhvGBrM7gomjbPYKx2uf4imiRFKtEY=; b=zG1zJ9ySSHz2uoJsZZHq6dXEbM23VjUVIJKFfNKcNaplL/ijkeFDrdj3SnUne7pEbBRSQQ G3M8ipaP8v5GZ2Ag== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id F131813A9F; Mon, 4 Mar 2024 04:43:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id xseuJF9R5WVPNwAAD6G6ig (envelope-from ); Mon, 04 Mar 2024 04:43:11 +0000 From: NeilBrown To: Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org, Olga Kornievskaia , Dai Ngo , Tom Talpey Subject: [PATCH 0/4 v2] nfsd: fix dadlock in move_to_close_lru() Date: Mon, 4 Mar 2024 15:40:18 +1100 Message-ID: <20240304044304.3657-1-neilb@suse.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=AkZaAHZA; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=zG1zJ9yS X-Spamd-Result: default: False [2.44 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.25)[96.44%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 2.44 X-Rspamd-Queue-Id: 99712680B9 X-Spam-Level: ** X-Spam-Flag: NO X-Spamd-Bar: ++ This series replaces nfsd: drop st_mutex and rp_mutex before calling move_to_close_lru() which was recently dropped as a problem was found. The first two patches rearrange code without important functional change. The last two address the two relaced problems of two different mutexes which are held while waiting and can each trigger a deadlock. Thanks, NeilBrown [PATCH 1/4] nfsd: move nfsd4_cstate_assign_replay() earlier in open [PATCH 2/4] nfsd: perform all find_openstateowner_str calls in the [PATCH 3/4] nfsd: replace rp_mutex to avoid deadlock in [PATCH 4/4] nfsd: drop st_mutex_mutex before calling