All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max <relf@unn.ac.ru>
To: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Bryan Henderson <hbryan@us.ibm.com>,
	fsdevel <linux-fsdevel@vger.kernel.org>,
	Phillip Lougher <phillip@lougher.demon.co.uk>
Subject: Re: files of size larger than fs size
Date: Thu, 17 Mar 2005 13:48:30 -0800	[thread overview]
Message-ID: <4239FB2E.2080900@unn.ac.ru> (raw)
In-Reply-To: <1111095554.8158.39.camel@localhost>

Dave,

Shouldn't "fread(&data,sizeof(data),1,f)" and "read(fn, &data, 
sizeof(data))" produce identical results?
Is it a bug or what?

Max

Dave Kleikamp wrote:

>With this change, the file size on jfs becomes 2^48 + 4 as expected.
>
>--- jfs_bug.c.orig	2005-03-17 14:18:48.229634648 -0600
>+++ jfs_bug.c	2005-03-17 15:32:45.952750104 -0600
>@@ -13,12 +13,14 @@ int data = 0;
> struct flock fl;
> 
> void read1() {
>-    size_t rc = fread(&data,sizeof(data),1,f);
>+    /* size_t rc = fread(&data,sizeof(data),1,f); */
>+    size_t rc = read(fn, &data, sizeof(data));
>     printf("read() rc = %llu\n",rc);
> }
> 
> void write1() {
>-    size_t rc = fwrite(&data,sizeof(data),1,f);
>+    /* size_t rc = fwrite(&data,sizeof(data),1,f); */
>+    size_t rc = write(fn, &data, sizeof(data));
>     printf("write() rc = %llu\n",rc);
> }
> 
>
>  
>


  reply	other threads:[~2005-03-17 21:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-16  2:17 files of size larger than fs size Max
2005-03-16  1:21 ` Phillip Lougher
2005-03-16  2:57   ` Max
2005-03-16 17:05     ` Bryan Henderson
2005-03-17  4:52       ` Max
2005-03-17 15:22         ` Dave Kleikamp
2005-03-17 20:06           ` Bryan Henderson
2005-03-17 20:51             ` Dave Kleikamp
2005-03-17 21:29               ` Dave Kleikamp
2005-03-17 21:39                 ` Dave Kleikamp
2005-03-17 21:48                   ` Max [this message]
2005-03-17 21:58                     ` Dave Kleikamp
2005-03-17 22:25                 ` Bryan Henderson
2005-03-16  2:25 ` Sonny Rao

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=4239FB2E.2080900@unn.ac.ru \
    --to=relf@unn.ac.ru \
    --cc=hbryan@us.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=phillip@lougher.demon.co.uk \
    --cc=shaggy@austin.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.