From patchwork Mon Jan 20 01:48:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 13944674 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 82485BE4A for ; Mon, 20 Jan 2025 01:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737337735; cv=none; b=RBGQzDHd8xjZVEcPgbqQUJlofvkNu1PLNEhtmdcIDOxtSJRykL8WgaSPiLdyZPBHirp6r2qWebs20GFbDTu01oImvHry/Cow32xPKEW1RwTsA9nkmZF5jRcdmUeev2vehXLot+BISaSD3F1UcoPbQbzn/hFAEKqloueubV3uKus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737337735; c=relaxed/simple; bh=6V7JqKBHNJ5lSDdipVKGDgdYtAqUFrPVZp7ZDlRCwp8=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=u+6ijO1AHtHps9QPoOr+i9lJ1Xx4fTyh5zTENB00h74aSO35hSWwHXrp/5HiROgiVfuKpyNTEr38QIQFAqgvTJZiW9uKK3imLQyfVD7+Lk6jBqz4oGIbx2p5F5APtYJ/IkmwoqypTxzNjJGf4GhaOTsm1FNnJwth0JiCHCiFajk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l0ftW+/x; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l0ftW+/x" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5401bd6cdb7so3799598e87.2 for ; Sun, 19 Jan 2025 17:48:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737337731; x=1737942531; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Xf98GyAdie4SfKgORppb7AAbGu2pyVw7mK348IGm1GY=; b=l0ftW+/xVra/x3EhsctqWTBSti6efq8Yh++taJxJ6H74emdI1RN9xjn4AW91ODz0RR x9TkchFgZHCiA+tF6z8cEiQQjqQal54GeIUxwy1tBvx+23jldTLAZwJ0R17qv2xXpB9a LJfOOcoJgvGNJFT+1DtjNACq8Nxb1EvYJOdyhPbvOm/4RArpdwLEK/WIuvanmkXI+OAd n3LSx5uLTLHW9ulsXSxR4cNeo+wt+7scNv7aZ9ZQyu8d9e8HY2d0xEPM1kRxjU7ixPmy vT1N2IVT/rfZ2VoM8yqM5FMjWhzj7raHT+hScGfEtPdfjEFNStGClEo49fzDYJhV6Op9 C09A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737337731; x=1737942531; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Xf98GyAdie4SfKgORppb7AAbGu2pyVw7mK348IGm1GY=; b=gRkNohwYEf9oVJc8g5WBIQKZMfkB3ZSRSrf3jVTFf/cidMVrL1P9FRVX6qW01ntnZi 2vk3ErJ2nw0cFsNGJSny78i1Ew4OHxunTDrWyvQXd/iT7jM1oNHfHLvMtgp4NydDQ/Yg eyb+vS0EGGQUTxLp8jn5KpZ4us5nmCxWv2JEd85zNyBR69PNtyn4hckL8vGa+6NeEWDn n4zjeX6FO9x6LAe2oLq/MR0wYhfWvb4xVwVb698Nke0B+NKbvkZSBellPYbQlYg3E3wl 7moiFnn/y/r9Dy712q36atleLd0X66ygWbcFqTEOy14rjGomIxLL77pXPt3th4xH4p1P iqvQ== X-Gm-Message-State: AOJu0Yw3/7w7VaL+vC6Hlc0ImraefBDCbv/a7gntgLdCQL8/5+t3pDOk q2tUV6HOVN756CZwTBNcJUSJya9RgCIVtPwbAbqMFn7cAZIekDh8ijoDJA9WAldmNEDeiu6bX+h t39D5SJpGdxrJ5S2CrxJWnfNYYDAr5ojX X-Gm-Gg: ASbGncsv+tENHGfb4SqxqTbIO/uZXqj+9OBVT8yywKpDp9eoMApuxAX5C5gZhRcJHLp /7WyCAK6KNQFFCpdAD4mzuI/5+2lFEKvUFkN0qjDyllYII21iZiJXQaw4oPcHfaOdUAvB3R9wdg ioBukFCm4jZQ== X-Google-Smtp-Source: AGHT+IGhzzP4UeBXT/UJ94U+n35AkpNQwT4Noc9VZmppWWbMvGX8wcZZxe6rwLgwn7aLKUIrbQaWsMpTwCW38Oj2540= X-Received: by 2002:a05:6512:b99:b0:53e:94f9:8c86 with SMTP id 2adb3069b0e04-5439c269828mr4346250e87.35.1737337731029; Sun, 19 Jan 2025 17:48:51 -0800 (PST) Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Steve French Date: Sun, 19 Jan 2025 19:48:39 -0600 X-Gm-Features: AbW1kvalQ7S0BwkX_MDoPIG6gfucAW2tRl1os7vF-9fgMOfCVSnQda0-OfFSwd8 Message-ID: Subject: [PATCH] cifs: Fix printing Status code into dmesg To: CIFS , samba-technical Cc: =?utf-8?q?Pali_Roh=C3=A1r?= Any thoughts on the attached patch (which is tentatively in cifs-2.6.git for-next)? NT Status code is 32-bit number, so for comparing two NT Status codes is needed to check all 32 bits, and not just low 24 bits. Before this change kernel printed message: "Status code returned 0x8000002d NT_STATUS_NOT_COMMITTED" It was incorrect as because NT_STATUS_NOT_COMMITTED is defined as 0xC000002d and 0x8000002d has defined name NT_STATUS_STOPPED_ON_SYMLINK. With this change kernel prints message: "Status code returned 0x8000002d NT_STATUS_STOPPED_ON_SYMLINK" Signed-off-by: Pali Rohár From 6fa9d8a3cb21ff21dbfa57555f6a41615b829525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Thu, 26 Dec 2024 14:27:16 +0100 Subject: [PATCH 42/71] cifs: Fix printing Status code into dmesg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NT Status code is 32-bit number, so for comparing two NT Status codes is needed to check all 32 bits, and not just low 24 bits. Before this change kernel printed message: "Status code returned 0x8000002d NT_STATUS_NOT_COMMITTED" It was incorrect as because NT_STATUS_NOT_COMMITTED is defined as 0xC000002d and 0x8000002d has defined name NT_STATUS_STOPPED_ON_SYMLINK. With this change kernel prints message: "Status code returned 0x8000002d NT_STATUS_STOPPED_ON_SYMLINK" Signed-off-by: Pali Rohár --- fs/smb/client/netmisc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c index 0ff3ccc7a356..4832bc9da598 100644 --- a/fs/smb/client/netmisc.c +++ b/fs/smb/client/netmisc.c @@ -775,10 +775,10 @@ cifs_print_status(__u32 status_code) int idx = 0; while (nt_errs[idx].nt_errstr != NULL) { - if (((nt_errs[idx].nt_errcode) & 0xFFFFFF) == - (status_code & 0xFFFFFF)) { + if (nt_errs[idx].nt_errcode == status_code) { pr_notice("Status code returned 0x%08x %s\n", status_code, nt_errs[idx].nt_errstr); + return; } idx++; } -- 2.43.0