From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A487D36B995 for ; Tue, 28 Oct 2025 23:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761693334; cv=none; b=egfW1pHFp8lsGKx6fDawz3TR9+Ln/A7ZpVfyaxDlmsfDtO2iWq9L8pwYVJAO8z3Xq/oAzWWSH1TksOoSWwf07LNSrPwNTNLiI+OkL7rn8xfFOKCtcnLXyZVQsgYDeByVapwFKklmTEuCrQfXhudT+loKg8CtjswopKA76A/jStM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761693334; c=relaxed/simple; bh=Q/5rMjO4hLAsjliBI+epYQnAKoS2XrmFf1dhmL0+U1E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IR+gXSrsqVGMHTtS0bltlQ0zfOUElO5LOFD33npLiQ3nyxmV1etF0vrcxqZQwjrGkh2Tdxd/dVjo5aMLcm0ZfjxmFqVAxodhLiUlqkQWk9c6XeYrC7Pha9GQPDKioF+l6m4pkV8gdKIb/kCVvX1jiEGwPfaJ++q68aZfR27VxgU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S3fSu16H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S3fSu16H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ED14C4CEE7; Tue, 28 Oct 2025 23:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761693334; bh=Q/5rMjO4hLAsjliBI+epYQnAKoS2XrmFf1dhmL0+U1E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S3fSu16HrAXh51Mm8MmsWlmN7ER1jB/uysZZSZZLlvY8T7bADZliHjryLH2dxnEI3 1k7R400Z9DA8zHWiwCvpHW20+4yxr+iMsnCrCyveprbhNcmeZ1LgqVJ23tGc0egXAR ZdI/4PlZkB8wsHStuv0xdwR/WVQonGGIWMVQElYh4bY+wrubplNOxJXDFbU8ZHSKEg GIEzWSCUVcXTMVRrkztHbM6gC9FdDltBhcdA2B0GdHJhieL/SlkUVBp7qZW+WG1JKd 3crsXuvrTUbx+XtYyrDY/RYTvPPlflmcuoH4e9L9WULrVqL4M12zlfNZfNP9/agI37 kEhcuGXQDM0Wg== Date: Wed, 29 Oct 2025 00:15:31 +0100 From: Alejandro Colomar To: linux-man@vger.kernel.org, Jan Kara Cc: Alejandro Colomar , Pali =?utf-8?B?Um9ow6Fy?= , "G. Branden Robinson" Subject: [PATCH v2] man/man3/readdir.3, man/man3type/stat.3type: Improve documentation about .d_ino and .st_ino Message-ID: <7cce7dac8fb57608d71b073f8a3c94532e5cb688.1761693028.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: Precedence: bulk X-Mailing-List: linux-man@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Suggested-by: Pali Rohár Co-authored-by: Pali Rohár Cc: "G. Branden Robinson" Signed-off-by: Alejandro Colomar --- Hi Jan, Would you mind reviewing this? The thread started here: . Hi Branden, I wasn't able to do anything after your request from . Pali will probably be better placed to do that, since he authored that text. Hi Pali, Sorry for being so slow with this! I wasn't able to work on this until now. Have a lovely night! Alex man/man3/readdir.3 | 22 +++++++++++++++++++++- man/man3type/stat.3type | 16 +++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/man/man3/readdir.3 b/man/man3/readdir.3 index e1c7d2a6a..368e98e6e 100644 --- a/man/man3/readdir.3 +++ b/man/man3/readdir.3 @@ -58,7 +58,27 @@ .SH DESCRIPTION structure are as follows: .TP .I .d_ino -This is the inode number of the file. +This is the inode number of the file, +which belongs to the filesystem +.I .st_dev +(see +.BR stat (3type)) +of the directory on which +.BR readdir () +was called. +If the directory entry is the mount point, +then +.I .d_ino +differs from +.IR .st_ino : +.I .d_ino +is the inode number of the underlying mount point, +while +.I .st_ino +is the inode number of the mounted file system. +According to POSIX, +this Linux behavior is considered to be a bug, +but is nevertheless conforming. .TP .I .d_off The value returned in diff --git a/man/man3type/stat.3type b/man/man3type/stat.3type index f3c312bf0..b87195766 100644 --- a/man/man3type/stat.3type +++ b/man/man3type/stat.3type @@ -66,7 +66,21 @@ .SH DESCRIPTION macros may be useful to decompose the device ID in this field.) .TP .I .st_ino -This field contains the file's inode number. +This field contains the file's inode number, +which belongs to the +.IR .st_dev . +If +.BR stat (2) +was called on the mount point, +then +.I .d_ino +differs from +.IR .st_ino : +.I .d_ino +is the inode number of the underlying mount point, +while +.I .st_ino +is the inode number of the mounted file system. .TP .I .st_mode This field contains the file type and mode. base-commit: abac986a3283e679b6b323f58ab6677bc49a05e0 -- 2.51.0