From: Chris Mason <mason@suse.com>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] [2.4] beyond_eof check in generic_direct_IO
Date: 06 Aug 2003 15:25:38 -0400 [thread overview]
Message-ID: <1060197938.5877.442.camel@tiny.suse.com> (raw)
Hello all,
reiserfs has to do a few odd tail conversion steps during direct io.
Picture a file whose size is currently 3500 bytes, and a direct io write
extending it to 4096 bytes.
reiserfs will have those 3500 bytes packed into a tail, and when it gets
a get_block call with create == 1, it will convert the tail into a full
block and return the newly created block.
The new generic_direct_IO code doesn't send create == 1 to get_block
unless the new block is entirely past eof. I think it should instead
allow any part of the block to be past eof, which allows reiserfs to
properly convert the tail:
-chris
--- 1.89/fs/buffer.c Tue Jun 24 17:11:29 2003
+++ edited/fs/buffer.c Fri Jul 18 13:24:57 2003
@@ -2147,7 +2148,7 @@
bh.b_size = blocksize;
bh.b_page = NULL;
- if (((loff_t) blocknr) * blocksize >= inode->i_size)
+ if (((loff_t) (blocknr + 1)) * blocksize > inode->i_size)
beyond_eof = 1;
/* Only allow get_block to create new blocks if we are safely
reply other threads:[~2003-08-06 19:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1060197938.5877.442.camel@tiny.suse.com \
--to=mason@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/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