Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2694189rdb; Mon, 5 Feb 2024 14:57:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEc+gFWiqH/MfFsNpSR3aMGLcHT3d5GEx7tWfoyIYqS0k4z8sJ6dRbP12WxsDy7FeOuW9OP X-Received: by 2002:ac8:4e8b:0:b0:42c:1267:c5c7 with SMTP id 11-20020ac84e8b000000b0042c1267c5c7mr993971qtp.36.1707173842126; Mon, 05 Feb 2024 14:57:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707173842; cv=pass; d=google.com; s=arc-20160816; b=raRvV2Yw0Yh9SnKYmW8A3HVJ2EPV3hxR7nvNdS4ImY0D6bp/UYN8AYKXopw1XC+GMv 8Eh49zBOlfwFp8B8dzKb5ou39pjJ4clRzCHO8pS0H1IIOSFxBeor7nD+DwxqApsKejoO y5+1Im0Rb0u1GTqOCBjvapb45XZh9NTprJuRWoYJkIJ3M/Nhl8Y0QZNfmKcXK26Vcxbz SWKCwI9dE12stPlJM4+W1QzNsn8zryq/oyhRw0VxvftyghzPMQqfY4Foq168g8VawQqh e9Y+VgVLg/lzbcczY5mtYpgMn4BQICSuxZM1k6QKBzA+iAB8sOCfmDVe+i+Re9WzShup A35A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=yneXKAl76UfBB4G/b+Ka6wc01rtEX0msSH9gfV0s6M8=; fh=gwfaTHmbnboKz4IEVi+gT+HVOYqKiTtMB142XEw9Xic=; b=DPA/c37DYgGF8J4Hn+m/Q6VWnTMTHpO9quk38hRa0eYwlLWgF1S7KsTaPMcs9mFy5g Ad/NrL5viOnz+3lN//VgIjs2vSMxoNhB+1tyTUADE/eY6sV+nLEPB9a/8N9qVW4C96pV SbP+TFyqIu43dq5SDtdfnNmRF72UMDc5xag4gbqAjvFxULH55R5WF2vJ9qN8Cp34eiCj 3IctGNCZ4PChfFvrC77+Ax3dd7xlSkwf1+TzSlrKdUOohS+Y5qScPVGI5/e/+4s7QeqZ 2tAjuiU3zrxSTZwoB7xxwRwcySPM2lecJSpUZ/PeYwnZEPx/eDc3bFQRSe6CNcaflYXP Qwrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="PUJRph/B"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-ext4+bounces-1126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1126-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCUOD83oFRboJAw8Q1VpS3WwZvdaZen86O8sTFhY9Ut4o1mA4XNypGv6Zb2tc1tcvsNMhyo1f+PiVvCsgo8SXpUuNnnUG5Jegcfx0/ORUw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w5-20020a05620a444500b00783f58e5155si1075816qkp.3.2024.02.05.14.57.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 14:57:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="PUJRph/B"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-ext4+bounces-1126-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1126-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D50041C26C38 for ; Mon, 5 Feb 2024 22:57:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C130F446B7; Mon, 5 Feb 2024 22:56:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PUJRph/B" X-Original-To: linux-ext4@vger.kernel.org Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 32D661EB46; Mon, 5 Feb 2024 22:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707173792; cv=none; b=QTTkLH5t6jJkbUUgCYW9etxfDe528svG86lD5YEb5DJfTlW/E9Z86p3lJBnyKkdcLFTMIMgRmM1HTVBJ+elyxEqlRM/wZf1Gx121UTZa3C91ea4vtl47hQyZSzP+q/dr1Qu5OPqp039vDdgggB8Mo6moRX5J/uBkKi73DgxJvCQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707173792; c=relaxed/simple; bh=5Drkk1LxOHXAWjDy7FEREOApjq8Kex+jv6emR7dDYi4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gSB/bSs0worhDDr+p+dk8SOuMLEERK38jrGi9J/m9O+fQlPF+hFtuOZsXKwLf4D4/NX1Ib0Om3aVoyyLzy6lJygf9H/0QFW/bvaKxiY0NAQeGzVLFqVW3JQQP5zp0n2aKTh5p2JKijcvR5Y9fYQNe+E0jjX772HAD9iEvvxPxsk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=PUJRph/B; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Mon, 5 Feb 2024 17:56:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707173788; 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: in-reply-to:in-reply-to:references:references; bh=yneXKAl76UfBB4G/b+Ka6wc01rtEX0msSH9gfV0s6M8=; b=PUJRph/BCxVzc6ntkk5bZNVG+jySNFceLeDgdY8W23/c3O0QL4z2a62jAa7U0JmPJglLLm TjAeNC6HDy3zEGrBOFEA/UP7FLc0VOwJnJGXAoF+i6YnFgLRRPWrhEEDY8gvmgonEuI4q/ HRmqAT6CQlgOSsH0QCyfnBjyIwkg2xI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Dave Chinner Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH 1/6] fs: super_block->s_uuid_len Message-ID: References: <20240205200529.546646-1-kent.overstreet@linux.dev> <20240205200529.546646-2-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Tue, Feb 06, 2024 at 08:58:49AM +1100, Dave Chinner wrote: > On Mon, Feb 05, 2024 at 03:05:12PM -0500, Kent Overstreet wrote: > > Some weird old filesytems have UUID-like things that we wish to expose > > as UUIDs, but are smaller; add a length field so that the new > > FS_IOC_(GET|SET)UUID ioctls can handle them in generic code. > > > > Signed-off-by: Kent Overstreet > > --- > > fs/super.c | 1 + > > include/linux/fs.h | 1 + > > 2 files changed, 2 insertions(+) > > > > diff --git a/fs/super.c b/fs/super.c > > index d35e85295489..ed688d2a58a7 100644 > > --- a/fs/super.c > > +++ b/fs/super.c > > @@ -375,6 +375,7 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags, > > s->s_time_gran = 1000000000; > > s->s_time_min = TIME64_MIN; > > s->s_time_max = TIME64_MAX; > > + s->s_uuid_len = sizeof(s->s_uuid); > > So if the filesystem doesn't copy a uuid into sb->s_uuid, then we > allow those 16 bytes to be pulled from userspace? > > Shouldn't this only get set when the filesystem copies it's uuid > to the superblock? > > And then in the get uuid ioctl, if s_uuid_len is zero we can return > -ENOENT to indicate the filesystem doesn't have a UUID, rather that > require userspace to determine a filesystem doesn't have a valid > UUID somehow... *nod* this all falls out of your super_set_uuid() suggestion