From: Mathieu Fluhr <mfluhr@nero.com>
To: Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: smbfs: lseek returns EINVAL when using large files.
Date: Mon, 11 Apr 2005 11:07:43 +0200 [thread overview]
Message-ID: <1113210463.1744.11.camel@c-l-175> (raw)
Hello
It seems that the smbfs driver does not handle correctly large files
(>2GB). The thing is that statting them is correct (for example, the
st_size field is correctly set), but as soon as you try to make a lseek
with an offset larget than INT_MAX, you get a EINVAL error.
Note: This is not coming out of the remote samba server (Tested with
under windows, and it is working fine).
I'm using a 2.6.10 kernel without external patches. I parsed the 2.6.11
changelog to see if this problem has been fixed, but I didn't found
anything related. If this has already been discussed, just let me
know ;-)
You can reproduce this bug with this little program:
-8<------------------------------------------
/* Enable large file support for x86 */
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <limits.h>
#include <stdio.h>
int main(int argc, char **argv)
{
int fd = open(argv[1], O_RDONLY);
if(fd == -1)
perror("open");
struct stat st;
fstat(fd, &st);
printf("filesize: %llu\n", st.st_size);
/* Go at end... */
if(lseek(fd, 0, SEEK_END) == (off_t)(-1))
perror("lseek");
close(fd);
return 0;
}
-8<------------------------------------------
Best Regards,
Mathieu Fluhr
next reply other threads:[~2005-04-11 9:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-11 9:07 Mathieu Fluhr [this message]
2005-04-11 9:17 ` Arjan van de Ven
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=1113210463.1744.11.camel@c-l-175 \
--to=mfluhr@nero.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®