Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2002 03:00:08 -0700 (PDT)
From:      Maxim Konovalov <maxim@FreeBSD.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/41792: lseek after ftruncate fails
Message-ID:  <200209231000.g8NA08UN032576@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/41792; it has been noted by GNATS.

From: Maxim Konovalov <maxim@FreeBSD.org>
To: Yury Izrailevsky <izrailev@yahoo.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: misc/41792: lseek after ftruncate fails
Date: Mon, 23 Sep 2002 13:59:50 +0400 (MSD)

 Hello,
 
 [...]
 > >Environment:
 > FreeBSD 4.6.1-RELEASE-p10
 > >Description:
 >       File operation problem. Running the following:
 >
 > write(fd, buffer, 8K);
 > ftruncate(fd, 0);
 > write(fd, buffer, 1);
 > off = lseek(fd, 0, SEEK_END);
 > printf("%d", off);
 >
 > Output: 24576, expected: 1.
 
 Can't reproduce on 4.6-STABLE:
 
 $ uname -a
 FreeBSD golf.macomnet.net 4.6-20020805-MACOMNET-STABLE FreeBSD
 4.6-20020805-MACOMNET-STABLE #19: Fri Sep 20 17:09:52 MSD 2002
 maxim@golf.macomnet.net:/usr/obj/usr/src/sys/GOLF  i386
 $ rm test.file
 $ ./trunc
 file offset=1, expected 1
 $ ls -l test.file
 -rw-r--r--  1 maxim  staff  1 23 ΣΕΞ 13:55 test.file
 $
 
 > The size of the actual file is 1 (if you ls -l on it). However,
 > lseek goes way past it...
 >
 > Noticed this while running connectathon rewind test (part of special
 > test suite). But fails even if don't go over NFS but just run on the
 > local file system.
 >
 > I suspect the problem is with the FS cache. Or perhaps lseek and/or
 > ftruncate are just broken...
 
 [...]
 
 -- 
 Maxim Konovalov, maxim@FreeBSD.org
 
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209231000.g8NA08UN032576>