From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 210702D595A for ; Tue, 2 Dec 2025 22:30:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764714659; cv=none; b=SxWmHklHxeHghbBkGQmYHL9fMWtOEkxseyhChxR/f4FIgqHctqzb1G5d8nrjyqOAAYtyH8a061cdwrgi4Gcpp/OOk5vW1RXlEj+3Zy6WtODMEwaOmiQ8gGTkrNC1Hc0SrcRbRVC6eFRdbJThSkRI52TitRCVGJEg2pmg7vsJYCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764714659; c=relaxed/simple; bh=MmUh4MKXgs1k08VeXFr5wg8d4AsDjxUObXE1+1XdpG4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bEwWEogKhYIyIdSDanA+mOlO35SbnRI3ujkbFNUQVP2aJvliWcyvOwS14fMXxEoRpGzR9r1NhrasBMa5oMhWV+Qp6Zj/GT07DJo5qXsj4RmjJtFILpSypMyLME4UOKwvh1zQ9byN0s2eQqrTSuU+NM0jDNbLufahIjTriYEvpPI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XpVo6Joc; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZDHjK4ks; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XpVo6Joc"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZDHjK4ks" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764714657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9XpYvds7AGfom+0aJqkkhOOQLSOqoY1MbT24dcNg0Fo=; b=XpVo6JocMQHyzkWoO8xJYKm7aOHD1Wc5n6+pnLqHAErJEjKKDjQ1btSBI8LSbxeJeL0Bkh m14i5pw9GbP4QAcgUy0Euw/HiQKlvLEBj0e8I2Llek4DWDKFfEnoI9H4emPfZh8uqEq4L0 Jm6NFewM21dPBKr15ZmpDm4OYCgQHBE= Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-269-tLrYe2uBNGSI6FAkzb56xQ-1; Tue, 02 Dec 2025 17:30:55 -0500 X-MC-Unique: tLrYe2uBNGSI6FAkzb56xQ-1 X-Mimecast-MFC-AGG-ID: tLrYe2uBNGSI6FAkzb56xQ_1764714655 Received: by mail-oo1-f69.google.com with SMTP id 006d021491bc7-65742f8c565so6233601eaf.1 for ; Tue, 02 Dec 2025 14:30:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764714655; x=1765319455; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9XpYvds7AGfom+0aJqkkhOOQLSOqoY1MbT24dcNg0Fo=; b=ZDHjK4ksZloI7M8wupk6J+XVjkx0vXOC4IH9UP65hMZH2LhkIFswI8qxBAwtA4BLNu JuofpZ0JxHgfoW83vz+b4DNxZBUtmmYxBZLV/RSClms3jGiW76TmNXE7pB22dygYYaJ8 4RSosrS7bqy74mdrNf/SG0Cw96GKJ33aUYxR0NOuWr0mCYfyLKj2D6CkJlf7LC2GEAk9 e5MVuI3gRYNowbTPizWyuJErmUWWzErX9b0aaUYlNpZgNg/PrVF1txYfw6Gmfv94HWun UZQ4GXw+MBnSyRE0YF82gFXNNb9NKl0PW7y5DLIpkQXpgWIaLEgP/EBRav6x35uKqHcu DzxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764714655; x=1765319455; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9XpYvds7AGfom+0aJqkkhOOQLSOqoY1MbT24dcNg0Fo=; b=mVpodFQRP5dBigDurxtk6f9wmM6ztiLVTekUeDHZysuvbVmhl3OQtgwZl90f4B5scn 0iIRCfJwC7jMqkCXWOo56nZdAlUGLp/wS5iml6EdPH15JONMyIpjGodDO1yQaLQcif3p BFOleKvqw4VM6MHfJHE9nu6I04wRUJEf3xj5LmFz0REAnWjcY6gtEpKk6OUCzKQrTds5 viKGjWdN9PLMQqJcO8bUEVyDi6nAuHxh/ngNB3b6w3M6GgR8ZhaK+q0b72+Fe8sNpH1H j/Xfbmhe2QsUqLWjNuzDchIx6KCsAbhKOg2z2D1C3EL5TAAqJArVndsjgCI75I1JeMpK XDlQ== X-Forwarded-Encrypted: i=1; AJvYcCUzkBXMQmJwy7lCl+F7INr/3mQHSw56YgKsTResJsh8AcW8BX7Hw8vRUQxT/Z9T3mJ4KdrZD3kGJlVC9Q4=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4d8lZX0QnU4fTQdwvl2m1xcq/6nbF19G5tSgsl5GCt0ctkXKg 6WdjWmnwNLR3DaMfFZRMIUMA7P7YDLO84MLIztJ7eIvcbKVOuU9k67q28U0ErzISAMb0QpBWvJU VEFmMxzXW942mA/fWaDRnHWSw6KVyW015abiJs1ELJ2Hj80wCTRMCwl/vdPUzi63r4A== X-Gm-Gg: ASbGnctopNNbqHDVXzlfiwkYGkTu/RENDc7kVVPRRjSf8QprAKlHujXmtoMyri3fHNj /fd/lp592UMPcNDF64CYO3DWiiZCJUOBSKAqWtZEX5luFZYmt5gm9LUKuFN7Fi5dF/7/NYK7+K1 az6IC6FU8b62msesEGvIFgs1hh4muNUP4SS5r3kEkzGgFxWjwkkROaEohGbpwkRHpbVBMzEDY7f sRnz0wucdy15tEzqNuja0iTRmWLlDUlAeaqHzLsNm8kxsocgE6w1Aonbi/Z1Jt3FuljVxKMfyct l9bGizYj6KSp5gg8lTYboS/KdtNOLA6jdaPwt7qFZdmbChxtfuyTc9ZyPc8H2e8Hkaqn6VYn59y eE7uzDEIp8KPw74btVLupTNzpRGZfdkpZbdwBsZSrnrgfLyThZfs= X-Received: by 2002:a05:6808:2213:b0:453:f62:de01 with SMTP id 5614622812f47-4536e43a399mr17447b6e.30.1764714655035; Tue, 02 Dec 2025 14:30:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy88N7ZuKZYlIvdZQmy4kg6Oeq+tbP5nzm2BGu6Vun9VEEZ04RppoINDoRk960fJq0ifc1/g== X-Received: by 2002:a05:6808:2213:b0:453:f62:de01 with SMTP id 5614622812f47-4536e43a399mr17434b6e.30.1764714654720; Tue, 02 Dec 2025 14:30:54 -0800 (PST) Received: from [10.0.0.82] (97-127-77-149.mpls.qwest.net. [97.127.77.149]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7c90fcedce6sm7464634a34.16.2025.12.02.14.30.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Dec 2025 14:30:54 -0800 (PST) Message-ID: <54b93378-dcf1-4b04-922d-c8b4393da299@redhat.com> Date: Tue, 2 Dec 2025 16:30:53 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH V3 5/4] 9p: fix cache option printing in v9fs_show_options To: v9fs@lists.linux.dev Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, linux_oss@crudebyte.com, eadavis@qq.com, Remi Pommarel References: <20251010214222.1347785-1-sandeen@redhat.com> <20251010214222.1347785-5-sandeen@redhat.com> Content-Language: en-US From: Eric Sandeen In-Reply-To: <20251010214222.1347785-5-sandeen@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit commit 4eb3117888a92 changed the cache= option to accept either string shortcuts or bitfield values. It also changed /proc/mounts to emit the option as the hexadecimal numeric value rather than the shortcut string. However, by printing "cache=%x" without the leading 0x, shortcuts such as "cache=loose" will emit "cache=f" and 'f' is not a string that is parseable by kstrtoint(), so remounting may fail if a remount with "cache=f" is attempted. Fix this by adding the 0x prefix to the hexadecimal value shown in /proc/mounts. Fixes: 4eb3117888a92 ("fs/9p: Rework cache modes and add new options to Documentation") Signed-off-by: Eric Sandeen --- diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 05fc2ba3c5d4..d684cb406ed6 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c @@ -148,7 +148,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) if (v9ses->nodev) seq_puts(m, ",nodevmap"); if (v9ses->cache) - seq_printf(m, ",cache=%x", v9ses->cache); + seq_printf(m, ",cache=0x%x", v9ses->cache); #ifdef CONFIG_9P_FSCACHE if (v9ses->cachetag && (v9ses->cache & CACHE_FSCACHE)) seq_printf(m, ",cachetag=%s", v9ses->cachetag);