From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 E24FF3DB325 for ; Fri, 10 Jul 2026 09:17:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783675038; cv=none; b=YN8UNzgRaGnZcu6/ElMNwscq4KYJAJ02yM4eZ3YSbwE/IPcufuGnhe8dhqSIw1c+bPE6o3FsyXJfOsodBHnrvYUnZOD8blSwTXyqFMyIKEGDp4WR7i1tEP/09OgD5Py7yFB+SCcldRVuHst2hC7e159/KgNHIBRTAxctF+HrXMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783675038; c=relaxed/simple; bh=UQIGrXouwWozqzkt/AuNHb54t7bTnKCBJEO8/AvtXiE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fWUks7iojaMEyWOHykYT72LIQxVy7+XyCedxGFa0f9S8iWiQKMWQtY3Lvl5gIRHvv4nr0LLNN7KO61SOiZsEP26Mj9jFMlYn/ocOTTiwDKTl8/SHSpodVEKEfSHo/cnfNB0cXpurZwCBRIzOiZff52Cywj5d4O2jyPGfSOl7h+E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com 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-out1.suse.de (Postfix) with ESMTPS id AB70376706; Fri, 10 Jul 2026 09:17:03 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none 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 167F0779BD; Fri, 10 Jul 2026 09:17:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id WFuQAo+4UGqnEQAAD6G6ig (envelope-from ); Fri, 10 Jul 2026 09:17:03 +0000 From: Samuel Cabrero To: linux-cifs@vger.kernel.org Cc: smfrench@gmail.com, pc@manguebit.com, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, henrique.carvalho@suse.com, ematsumiya@suse.de, Samuel Cabrero Subject: [PATCH 09/18] smb:client: Use the correct return code Date: Fri, 10 Jul 2026 11:16:28 +0200 Message-ID: <20260710091637.58873-10-scabrero@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260710091637.58873-1-scabrero@suse.com> References: <20260710091637.58873-1-scabrero@suse.com> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Queue-Id: AB70376706 X-Rspamd-Action: no action Return ENOENT instead of EEXIST when a registration does not exist. Signed-off-by: Samuel Cabrero --- fs/smb/client/cifs_swn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/smb/client/cifs_swn.c b/fs/smb/client/cifs_swn.c index b823a496cba7..0d7e99203281 100644 --- a/fs/smb/client/cifs_swn.c +++ b/fs/smb/client/cifs_swn.c @@ -382,7 +382,7 @@ static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon) return swnreg; } - return ERR_PTR(-EEXIST); + return ERR_PTR(-ENOENT); } /* @@ -401,7 +401,7 @@ static struct cifs_swn_reg *cifs_get_swn_reg(struct cifs_tcon *tcon) if (!IS_ERR(swnreg)) { kref_get(&swnreg->ref_count); goto unlock; - } else if (PTR_ERR(swnreg) != -EEXIST) { + } else if (PTR_ERR(swnreg) != -ENOENT) { goto unlock; } -- 2.54.0