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 5D5B9279DB7 for ; Mon, 1 Dec 2025 22:37:04 +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=1764628626; cv=none; b=OIfZlSa6iJ+h7eMhFQef0Wjl7nDtel0SJhRmScH3FhKBmcptqhpZ9LUOUSSl5slGcEwxplcyhyn8jrV2Qsyr9jLTzLKLbfEUpPYvlDmPZ+5NPa8qzvPGZli7G2qvzd9zYpA6A9yZciTLZAQhPTaUpWSk1tRIw+7NS1gAjmoI6Ow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764628626; c=relaxed/simple; bh=1YTmjXiDfWT06ovBh9wfUTGqRkMz4rOaoeTg+gBuuh4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LJd3W2mEC0BR8Hz4lQuT5CoWU771QYpx+eUQVWep4ml1XC6yTH4l5AoKUVDGqp76bIY/tfm6J+P9gn2tY8nCM6cWC1AHa1+9UdEUP1WKquCjk7ArNUTCpi+/OPjbmOpGH0SBwSbIH6WLvkmYm20M8espOyO3dfDeKMb/2wEWWLY= 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=VXopGXC1; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=IeLUb4Yc; 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="VXopGXC1"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="IeLUb4Yc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764628623; 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=B9W8GtlmMztPOKGmNDt/1BWnxRfhcYHphKSMv+Jfars=; b=VXopGXC1GLKeBlOoehIgeVKi/K/wqYdPuNCeb2TsHWMpKrY2pSDxPNsPASsDqoKEozaSnV oy6CXzkbO+lf9prQ0ynI+E6UOHtjp+6WgUDivyxMEGMI8HI8+DX9dAg5hxMErWRuPzeEWA lh5OWg1N3Eox7qsf8Qga/DLoFYGkHvw= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-321-JrTyn-m_PFKIElpfqp-flg-1; Mon, 01 Dec 2025 17:37:02 -0500 X-MC-Unique: JrTyn-m_PFKIElpfqp-flg-1 X-Mimecast-MFC-AGG-ID: JrTyn-m_PFKIElpfqp-flg_1764628621 Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-7c75290862cso9139301a34.2 for ; Mon, 01 Dec 2025 14:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764628621; x=1765233421; 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=B9W8GtlmMztPOKGmNDt/1BWnxRfhcYHphKSMv+Jfars=; b=IeLUb4YcxTY2YjE9h3OyUizqPtFI1cZL5WUefYLqAG7oxYHpMaYMpgmweN9BLn4KUY 160csxwD8AXj6NwY8RC73hhz/mOYfHfe/m7JeS6MlgJFOF7rWNGa6RR+avP7B5eEMOX2 xz3/IkK6vFE5kUTEbKE6TYr7rH0RB4O4PepOb63WNO+ol3IRY55VWzGU+D0IrKnZKOSG iuwqrStfZ+yAbU/92h4ssoFq4FmhDqLkbWO/c8/pob/zXjc0PAgtjchwyr8zXSV2DGD6 eKuO2AW77xCh8zopt3Dc4aY2mjl1333X3fE3evO7pL7oK442WrtI6frxoCV7rSqLpvJM nRBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764628621; x=1765233421; 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=B9W8GtlmMztPOKGmNDt/1BWnxRfhcYHphKSMv+Jfars=; b=qZUCgPpeh960+zpvbu8ORQd59RFpMaMP/hrBhyw5w2E0K8uvrIdOuHE/KHJ+K1ez4m gvfphOGFL3t49V+BCl5XZbEQscRlxx3N5CNyQMOXmgDzoJsmvocY+F+a5sVw/Bs/Hqfy 3YC1vj2cmpjuywIAmqu+z5NTX00ME/ikWdNv1DbzOHOl52sYmJMAePvA83PLyDbmU4tQ IKwUw636D2pJrzvvFcHA2XC8odozh4yHySamoaqNA6tmqQgJ2ZC2U4LwHc7G6105HwpZ v8cf27+3vDsJTZgll0EpGhg4/e+IhXYHGURquHkxeOoLRQEvUa1ZEz5jHtH8iNzwo3er Cy3A== X-Forwarded-Encrypted: i=1; AJvYcCVI/8LivXyQHxt2ci9wZ+Cuo1RQElvlzhfL088+DxlihcH1z/UVWV3gR42RJhhh5rh5rojfTmpgN1xNZ0I=@vger.kernel.org X-Gm-Message-State: AOJu0YxRxbr5fCbOwlPhreXoVU9+xmXzCiOylEtUlqnRm41NxN1DnhvV oJc1dD+aWBpEdTYh1XBAexAWgOPOLsFImnk3KZ74PncIE2+Z6Nmn6/bjJuAA4S56Kd0dbVtFY+C YigC5L1bm4wU48b93esA3pndPHglqxwYT2N7VCt1+YzZtLgJJuooNpifJex4kTAzqTA== X-Gm-Gg: ASbGnctPCq/fZsVXAxYWpspZmw9BZ7DLZe5typF+AhkRNfy0JU6PeE3IkCYt64QQlED fE7SolRk0629XDeeLUgPoA/DDMC1QkYt9TVCVbsiWBcD3qj2XuX413p8M/gZlM9xmq2I/2FQXPU CeMPIil9o/d1qHqHJF1FKQNiG3z6rCf0PoLcwlJ9dUexeAP2dX5vpx4yq6wIjpjCq5hBIenguN2 NVG+qAgQcVPL2JJuDLIx08+/XLhUyf6hqE/WuKiilEXpX/jKTefLFo/ZUfEOuSZpob0yFuZaAL9 ugInl5dtDQUZYrnfKyj8LAOnNK8aocoa10RK3G+XxU9AV5A/FpdLzeShveuYbFsmBu8OXcX/Iog nE+X1qIRnm8bLbRflAq7jdglRScvKalqPjkY17ZILL4ngzRjGI9A= X-Received: by 2002:a05:6830:4424:b0:78a:8b0d:cd54 with SMTP id 46e09a7af769-7c7c445d9dcmr15820498a34.34.1764628621154; Mon, 01 Dec 2025 14:37:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnZLeXtAHqL1HJaAkrrfYrqLSObw8oU2jukj6wTDOBEtDA/eVqZfK5ZNe81bHUoAj3Cj83nQ== X-Received: by 2002:a05:6830:4424:b0:78a:8b0d:cd54 with SMTP id 46e09a7af769-7c7c445d9dcmr15820472a34.34.1764628620708; Mon, 01 Dec 2025 14:37:00 -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-7c90fe0be23sm5341133a34.21.2025.12.01.14.36.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Dec 2025 14:37:00 -0800 (PST) Message-ID: Date: Mon, 1 Dec 2025 16:36:58 -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: Re: [PATCH V3 4/4] 9p: convert to the new mount API To: Dominique Martinet , Remi Pommarel Cc: v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ericvh@kernel.org, lucho@ionkov.net, linux_oss@crudebyte.com, eadavis@qq.com References: <20251010214222.1347785-1-sandeen@redhat.com> <20251010214222.1347785-5-sandeen@redhat.com> Content-Language: en-US From: Eric Sandeen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/26/25 4:43 PM, Dominique Martinet wrote: > Hi Remi, > > Remi Pommarel wrote on Wed, Nov 26, 2025 at 09:16:14PM +0100: >> While testing this series to mount a QEMU's 9p directory with >> trans=virtio, I encountered a few issues. The same fix as above was >> necessary, but further regressions were also observed. > > Thanks for testing! > (FWIW that patch has been rolled into my 9p-next branch, so you shouldn't > have needed to fiddle with it if using linux-next) > >> Previously, using msize=2048k would silently fail to parse the option, >> but the mount would still proceed. With this series, the parsing error >> now prevents the mount entirely. While I prefer the new behavior, I know >> there is a strict rule to not break userspace, so are we not breaking >> userspace here? > > That's a good question, we had the same discussion about unknown options > which were causing errors in the previous version of this patch. > > My personal opinion is that given it's easy enough to notice/fix and it > points at something that's obviously wrong, I think such breakage is a > necessary evil and are occasionally ok -- but it should be intentional, > so let's add some fallback for this version and we can make this break > at the same time as we make unknown options break > >> Another more important issue is that I was not able to successfully >> mount a 9p as rootfs with the command line below: >> 'root=/dev/root rw rootfstype=9p rootflags=trans=virtio,cache=loose' >> >> The issue arises because init systems typically remount root as >> read-only (mount -oremount,ro /). This process retrieves the current >> mount options via v9fs_show_options(), then attempts to remount with >> those options plus ro. However, v9fs_show_options() formats the cache >> option as an integer but v9fs_parse_param() expect cache option to be >> a string (fsparam_enum) causing remount to fail. Sorry, I was out for the US holiday and just getting to this. So previously, for cache mode we expected a string for the mount option, converted that string to the numeric value via get_cache_mode(), and v9fs_show_options displayed that cache mode value as hexadecimal, right? if (v9ses->cache) seq_printf(m, ",cache=%x", v9ses->cache); Oh, I see - the last "if" in get_cache_mode() accepted the bare numeric value. >> The patch below fix the >> issue for the cache option, but pretty sure all fsparam_enum options >> should be fixed. > > Oww. That's a bit more annoying, yes... > >> However same question as above arise with this patch. Previously cat >> /proc/mounts would format cache as an hexadecimal value while now it is >> the enum value name string. Would this be considered userspace >> breakage? > > Now these are most likely ok, it already changed when Eric (VH) made it > display caches as hex a while ago, I wouldn't fuss too much about it. > > OTOH if the old code worked I assume it parsed the hex values too, so > that might be what we ought to do? Or was it just ignored? Looks like it accepted either the string or the hex value, so that's my mistake. I suppose it would be a terrible hack to just extend the enum to include hexadecimal "strings" like this, right.... ;) +static const struct constant_table p9_cache_mode[] = { + { "loose", CACHE_SC_LOOSE }, + { "0b00000000", CACHE_SC_LOOSE }, + { "fscache", CACHE_SC_FSCACHE }, + { "0b10001111", CACHE_SC_FSCACHE }, ... + {} I think the right approach would be to just reinstate get_cache_mode() to do open-coded parsing as before, and get rid of the enum for the cache option. Would you like me to send a patch 5/4, or an updated 4/4 to implement this, or would you rather do it yourself if you think you have a better chance of getting it right than I do? As for the other enum, I think we're still ok (though maybe you can confirm) because p9_show_client_options() still does a switch on clnt->proto_version, and outputs the appropriate mount option string. -Eric > I'll try to find some time to play with this and let's send a patch > before the merge window coming in fast... This was due for next > week-ish!