From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.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 99E5533067F for ; Fri, 6 Mar 2026 07:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772783472; cv=none; b=r+gIOhzM3ZImOG19aACGiyykzgHpf9dnzxIcAY7QZqzIw+iqPLkxpPm4H0ouSvvQYXzJS7GwLaA+aY2d3HFsuLinI8yZeaYvt3Xv4zbokhOH9UFzKXs6KpHpFKFjxgk/qOyOe/iuUe/KSTozuhCYp4LjzVOeTYSG9P2SlS75RsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772783472; c=relaxed/simple; bh=8AkXqGMXuu5Jb6MzJp4/2VAqJZtxWcNL3wjTf+K9WeE=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=s904s9Ma3jZ49rVOchU5zmGCWZKsIL2Csruz1iMUJTROhet/82EVxLREndXsfPd+UinCEl9wXaBsgAcKLc38wsJIvX0MQbZrGAdjUaYZDd3VuLyvv8HholyhgtUrRpUBA5apiSPslq2G6nLsq0Wb+rGY0X8Bt0sSvsoA5fGVmlA= 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=jgaVhfmq; arc=none smtp.client-ip=209.85.216.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="jgaVhfmq" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-3590042fa8eso5477267a91.1 for ; Thu, 05 Mar 2026 23:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772783471; x=1773388271; darn=lists.linux.dev; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iOZw9GYYmIkLbh3GRopPX2ayTgH4KaepuXViYt6fWFI=; b=jgaVhfmq2hlcD5NXK9Xz8+iDP+L9mF3xXENdiXTfF0JQi7o/Y6ZzslbaTJppPdpb1k 7H5x/iqznJDrUU2NslqRqMkSUX6WsMLY+Nk5p/uAR5bzy92cVsWyChMq+PUJD/heQ8E+ yDEfjEzLcFa/ejgwwUCnuLna4uY9/eeWBhTl3mqUbxkTdISoQID6vT6sws0uArKNeAeU 1kZga/Z2vJoOANInC+98N9TL1wiktodsKevAP413Cas7PB5VSDOrirUkJqwHrHQCQwS+ aKknr44x9pWQDPUfQft0E+209luyiHq1P4AoRoqgMsibG52A64H6nYvIK4ATEpMwAGNF hjdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772783471; x=1773388271; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iOZw9GYYmIkLbh3GRopPX2ayTgH4KaepuXViYt6fWFI=; b=J7nXyvu7qer0Zu9wr3n7jaPrUZ10H0Yt7zvtrLqNxoeo4FPjcOUzDWjN2apC29r01w 18IxnV1IKuizv49vHi71cgDFuwLJdR3WVygoKGAyeYOoz1b86vTOtc4Hw7hhdCfCl4GN Uvo0dOG76NxcNgDnSJcwXJ/91KHtPJtmX1LrLBzMlQc7INW9cg53KOgdaDDj8R80E/Qc w5aM3vZa72S07ChAcyGMatabbZrYYmZJF/4CvTKxj7oCsa5npEvGN7r8uo6q1x05/Wqi ElSNZF7Aa07iYJrFq+qEtVw7E7GmXE1L1g1k3qKqZl/2y8O8FRf61mJ5oeswOTTikmAr 8mMQ== X-Forwarded-Encrypted: i=1; AJvYcCVSg7bLXaeC5MxX8Sfg9rT+IqwD0hZKQtRPE5N53+qkPGW6O88aHYmJXmrLwnzRxs3mgUzA@lists.linux.dev X-Gm-Message-State: AOJu0YzVgJgnQSfK57lZJEm1MBF0SAEh4f7h0stBldj0KFdbh5dFE31B ghPPK3rPW2W0ZzvdoFL1P1VzVuvs+uAKUzNvedsmADI+ApMpTKB0TbPU X-Gm-Gg: ATEYQzwWb8Ce1NZ4EFU9dLzbSsDcoTghr6WbZ9Fb4TDaEHgdYDGP4l3YRbjD9aGdLtE 8eeQL3S77HgTXtj/wUACIm56yfqj5uhX1jkMqVYXn65/7pN03DX/07ufBrtuF77AKZZLfHfd5Fi lrsl57UTEccic5p+HHP0mDylklRX9iI7PTTU+kAAIXIrQTbf+xpcvFiHrI3QxbfbG63fP9ommr8 T0g+WQmEuSH4S338EwuWW5I+dM8dYfjQfz+ZmcP3HhwjziMrpZ+V5B0Hqir5WcehnCK/lAoyzeH h3WJtF98fTYwctzfoSI43U3XvvA3/JO5ZyOzQW88shMvvNHkQUyDK31zCWUitQCX1V+qIJ5fBpx DCe7SaMpUMXvagvY97VpSrIgI/jSJ3GmdFiH+uKzJGPHmCz++rB5mTaFX2Ll7RySNrKiGL6IeYR 2ErPeABwOOWjCo6YM8VGuIdz0SAO6W0aZwEqngyogcoYFV1dVRHMW92WT3RQ4= X-Received: by 2002:a17:90b:17cb:b0:359:7906:d996 with SMTP id 98e67ed59e1d1-359be343fe5mr1239835a91.23.1772783470742; Thu, 05 Mar 2026 23:51:10 -0800 (PST) Received: from localhost ([2405:201:3017:184:52f5:ed80:f874:1efc]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-359b2d50ebdsm4092347a91.5.2026.03.05.23.51.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Mar 2026 23:51:10 -0800 (PST) Precedence: bulk X-Mailing-List: criu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 06 Mar 2026 13:21:03 +0530 Message-Id: Cc: , , , , , , , , "Aleksa Sarai" , "Askar Safin" Subject: Re: [PATCH v3] man/man2/statmount.2: Document STATMOUNT_BY_FD From: "Bhavik Sachdev" To: "Alejandro Colomar" , "Bhavik Sachdev" , X-Mailer: aerc 0.21.0 References: In-Reply-To: On Thu Mar 5, 2026 at 10:49 PM IST, Alejandro Colomar wrote: > Hi, > > On 2026-03-04T15:58:21+0100, Alejandro Colomar wrote: >> Hi Bhavik, >>=20 >> Sorry for the delay; I had an issue with my mail provider. It's now >> resolved. >>=20 >> On 2026-02-26T08:40:16+0530, Bhavik Sachdev wrote: >> > STATMOUNT_BY_FD introduces the ability to get information about a moun= t >> > using a fd on the mount. This functionality is currently in linux-next >> > [1]. >> >=20 >> > Link [1]: >> > >> >=20 >> > Signed-off-by: Bhavik Sachdev >> > Message-ID: <57c96336ccfbdc05f60b7875c315a8c1dd0d14b8.1771870334.git.b= .sachdev1904@gmail.com> >> > Message-ID: <7d4b22c595feeadb3be6df8a8781344597120f7e.1771870502.git.b= .sachdev1904@gmail.com> > > I've applied the patch. I've amended the few formatting issues I > reported below. Since the only important issue was the wording one, and > Askar confirmed it's good, I took the patch. > Thanks Alex, Askar and Aleksa for taking a look :) > BTW, Branden, I'm getting a diagnostic from groff: > > TROFF .tmp/man/man2/statmount.2.pdf.set > ! (troff -mandoc -Tpdf -wbreak -rS12 -rU0 <.tmp/man/man2/statmount.2.pd= f.troff 2>&1 >.tmp/man/man2/statmount.2.pdf.set) \ > | grep ^ >&2 > .tmp/man/man2/statmount.2:155: warning: table row does not fit on page 2 > > But the PDF looks good to me. Would you mind looking at that page and > telling me what you'd do with that diagnostic, and whether I should care > about it? > > > Have a lovely day! > Alex > >> > --- >> > Hey Alex! >> >=20 >> > > Also, should we say the same as elsewhere?: >> > > "It is an ORed combination of the following constants" >> > > and then a list which contains only STATMOUNT_BY_FD? >> >=20 >> > I am not really sure that statmount flags will be a ORed combination i= n >> > the future i.e (STATMOUNT_BY_FD | STATMOUNT_NEW_FLAG) would be somethi= ng >> > that is valid. >> >=20 >> > I think for now, it is better we don't do that. >> >=20 >> > Thanks, >> > Bhavik >> >=20 >> > man/man2/statmount.2 | 40 ++++++++++++++++++++++++++++++++++++++-- >> > 1 file changed, 38 insertions(+), 2 deletions(-) >> >=20 >> > diff --git a/man/man2/statmount.2 b/man/man2/statmount.2 >> > index 5ac96796c..1556342de 100644 >> > --- a/man/man2/statmount.2 >> > +++ b/man/man2/statmount.2 >> > @@ -24,7 +24,10 @@ .SH SYNOPSIS >> > .EX >> > .B struct mnt_id_req { >> > .BR " __u32 size;" " /* sizeof(struct mnt_id_req) */" >> > -.BR " __u32 mnt_ns_fd;" " /* fd of mnt_ns to query the mnt_id i= n */" >> > +.BR " union {" >> > +.BR " __u32 mnt_ns_fd;" " /* fd of mnt_ns to query the m= nt_id in */" >> > +.BR " __u32 mnt_fd;" " /* fd on the mount being queri= ed */" >> > +.BR " };" >> > .BR " __u64 mnt_id;" " /* The mnt_id being queried */" >> > .BR " __u64 param;" " /* ORed combination of the STATMOUNT_= constants */" >> > .BR " __u32 mnt_ns_id;" " /* The id of mnt_ns to query the mnt_= id in */" >> > @@ -89,7 +92,8 @@ .SH DESCRIPTION >> > .I bufsize >> > with the fields filled in as described below. >> > .I flags >> > -must be 0. >> > +must either be 0 or >> > +.BR STATMOUNT_BY_FD . >> > .P >> > (Note that reserved space and padding is omitted.) >> > .SS The mnt_id_req structure >> > @@ -110,6 +114,27 @@ .SS The mnt_id_req structure >> > .I req.mnt_id >> > (since Linux 6.18). >> > .P >> > +.I req.mnt_fd >> > +is a file descriptor on a mount. >>=20 >> Is this the same as a "mount object file descriptor" as describer in >> fsopen(2)? If so, we should use the same language, I think. >>=20 >> CC +=3D Aleksa, Askar >>=20 >> > +If >> > +.B STATMOUNT_BY_FD >> > +flag is specified, >> > +.I req.mnt_id >> > +and >> > +.I req.mnt_ns_id >> > +are zeroed, the function will return information about the mount the = fd is on >>=20 >> We always spell "file descriptor", not fd. >>=20 >> Aleksa, Askar, would you mind reviewing this patch? You may have >> comments on some specific terms used here, as they might relate to >> fsopen(2). >>=20 >> > +(Since Linux 7.0). >>=20 >> s/Since/since/ >>=20 >> > +.P >> > +The fd can also be on a mount that has been lazily unmounted (see >> > +.BR umount2 (2) >> > +with >> > +.BR MNT_DETACH ). >> > +In this case, >> > +.BR STATMOUNT_MNT_POINT >>=20 >> s/BR/B/ >>=20 >> BR is for alternating bold and roman. >>=20 >>=20 >> Other than the questios/doubts about mounts and file descriptors, and >> these minor formatting/source issues (which I would have amended >> otherwise), the patch looks good to me. >>=20 >>=20 >> Have a lovely day! >> Alex >>=20 >> > +and >> > +.BR STATMOUNT_MNT_NS_ID >> > +will be unset, since an unmounted mount is no longer a part of the fi= lesystem. >> > +.P >> > .I req.mnt_id >> > can be obtained from either >> > .BR statx (2) >> > @@ -392,6 +417,17 @@ .SH ERRORS >> > .I req.mnt_ns_fd >> > were set. >> > .TP >> > +.B EINVAL >> > +.I req.mnt_id >> > +or >> > +.I req.mnt_ns_id >> > +was specified alongside >> > +.IR req.mnt_fd . >> > +.TP >> > +.B EBADF >> > +.I req.mnt_fd >> > +is an invalid file descriptor. >> > +.TP >> > .B E2BIG >> > .I req >> > is too large. >> > --=20 >> > 2.53.0 >> >=20 >>=20 >> --=20 >>