From: Simon Paillard <spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
To: Lionel Elie Mamane
<lionel-vlyxx04YXHqHXe+LvDLADg@public.gmane.org>,
604928-61a8vm9lEZVf4u+23C9RwQ@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Bug#604928: stat.2: EOVERFLOW not only for st_size; bit/byte confusion
Date: Tue, 23 Oct 2012 01:55:00 +0200 [thread overview]
Message-ID: <20121022235500.GA16004@glenfiddich.mraw.org> (raw)
In-Reply-To: <20101125140830.GA14353-rNNsFfiJtZ89bTkMJW/ABGJiwOkYxero@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]
Control: -1 found 3.42-1
On Thu, Nov 25, 2010 at 03:08:30PM +0100, Lionel Elie Mamane wrote:
> stat(2) says:
>
> ERRORS
> (...)
> EOVERFLOW
> (stat()) path refers to a file whose size cannot be represented in the
> type off_t. This can occur when an application compiled on a 32-bit
> platform without -D_FILE_OFFSET_BITS=64 calls stat() on a file whose
> size exceeds (2<<31)-1 bits.
>
> 1) It would seem to me that the condition for this to occur would be a
> file whose size exceeds (2<<31)-1 *bytes*, not "bits".
Still applicable to manpages 3.43.
> 2) I got this for an overflow on st_ino (64 bit kernel, 32 bit
> userland, CIFS mount of a Windows-served share).
Confirmed with
OpenGroup: http://pubs.opengroup.org/onlinepubs/009695399/functions/stat.html
[EOVERFLOW]
The file size in bytes or the number of blocks allocated to the file or
the file serial number cannot be represented correctly in the structure
pointed to by buf.
egblic: sysdeps/unix/sysv/linux/xstatconv.c it can be st_ino, st_size or st_blocks
> So I'd suggest this text become something along the lines of:
>
> path or fd refers to a file for which the value of a field of the
> stat structure cannot be represented in its type. This usually
> occurs with applications compiled on a 32-bit platform without
> -D_FILE_OFFSET_BITS=64. The most common occurrence is when such an
> application calls stat() on a file whose size exceeds
> (2<<31)-1 bytes; but it can also occur e.g. for the st_ino field,
> e.g. when such an application is run on a 64 bit kernel.
An other proposal attached.
--
Simon Paillard
[-- Attachment #2: 604928.EOVERFLOW.diff --]
[-- Type: text/x-diff, Size: 789 bytes --]
diff --git a/man2/stat.2 b/man2/stat.2
index 0b82e1d..fb2f9dd 100644
--- a/man2/stat.2
+++ b/man2/stat.2
@@ -343,15 +343,18 @@ is not a directory.
.B EOVERFLOW
.RB ( stat ())
.I path
-refers to a file whose size cannot be represented in the type
-.IR off_t .
-This can occur when an application compiled on a 32-bit platform without
+refers to a file whose size, inode number, or number of blocks cannot be represented in their respective type
+.IR off_t ,
+.IR ino_t ,
+or
+.IR blkcnt_t .
+This usually occurs when an application compiled on a 32-bit platform without
.I -D_FILE_OFFSET_BITS=64
calls
.BR stat ()
on a file whose size exceeds
.I (1<<31)-1
-bits.
+bytes.
.SH "CONFORMING TO"
These system calls conform to SVr4, 4.3BSD, POSIX.1-2001.
.\" SVr4 documents additional
next parent reply other threads:[~2012-10-22 23:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20101125140830.GA14353@capsaicin.mamane.lu>
[not found] ` <20101125140830.GA14353-rNNsFfiJtZ89bTkMJW/ABGJiwOkYxero@public.gmane.org>
2012-10-22 23:55 ` Simon Paillard [this message]
[not found] ` <20121022235500.GA16004-8MNqHwMchPhGJ/Ie3qa20WD2FQJk+8+b@public.gmane.org>
2012-11-07 19:13 ` [PATCH] stat.2: EOVERFLOW not only for st_size, not in bits Simon Paillard
2012-11-11 10:41 ` Bug#604928: stat.2: EOVERFLOW not only for st_size; bit/byte confusion Michael Kerrisk (man-pages)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121022235500.GA16004@glenfiddich.mraw.org \
--to=spaillard-8fiuurrzop0dnm+yrofe0a@public.gmane.org \
--cc=604928-61a8vm9lEZVf4u+23C9RwQ@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lionel-vlyxx04YXHqHXe+LvDLADg@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).