From: Linus Torvalds <torvalds@linux-foundation.org>
To: Josef Bacik <josef@redhat.com>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, randy.dunlap@oracle.com
Subject: Re: [PATCH] cleanup block based fiemap
Date: Fri, 23 Apr 2010 08:00:35 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.00.1004230753480.3739@i5.linux-foundation.org> (raw)
In-Reply-To: <20100423144420.GC2351@localhost.localdomain>
On Fri, 23 Apr 2010, Josef Bacik wrote:
>
> I'm resending this patch again since it doesn't seem to have made it in yet.
> The generic block fiemap stuff doesn't use the right typing and has a problem
> with not setting the last extent flag properly. Also there is an issue with
> GFS2 where it doesn't like non-block aligned requests, so this fixes all these
> issues. Thanks,
I'd really like the patch to clean up the crazy stuff too.
As-is, there's at least two remaining issues I see from just reading the
patch:
> + if (len >= i_size_read(inode)) {
> + whole_file = true;
> + len = i_size_read(inode);
> + }
...
> if (!past_eof &&
> blk_to_logical(inode, start_blk) >=
> - blk_to_logical(inode, 0)+i_size_read(inode))
> + blk_to_logical(inode, 0) + i_size_read(inode))
> past_eof = 1;
Issue #1: it does that i_size_read() several times. What happens if the
file grows? Maybe we hold the i_mutex already, although I don't see it.
Regardless, it seems bogus to read the size several times.
Issue #2: "blk_to_logical(inode, 0)"? WTF? Since when has shifting zero
ever resulted in anything interesting or relevant? There's at least two of
those things.
Linus
next prev parent reply other threads:[~2010-04-23 15:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-23 14:44 Josef Bacik
2010-04-23 15:00 ` Linus Torvalds [this message]
2010-04-23 15:18 ` Josef Bacik
2010-04-23 15:27 ` Linus Torvalds
2010-04-23 15:47 ` Josef Bacik
2010-04-23 15:56 ` Linus Torvalds
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=alpine.LFD.2.00.1004230753480.3739@i5.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=josef@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.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 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®