From: Chris Mason <chris.mason@oracle.com>
To: Mitch Harder <mitch.harder@sabayonlinux.org>
Cc: "João Eduardo Luís" <jecluis@gmail.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: last_index variable in btrfs_buffered_write function
Date: Tue, 12 Jul 2011 10:11:20 -0400 [thread overview]
Message-ID: <1310479850-sup-3754@shiny> (raw)
In-Reply-To: <CAKcLGm_wag+9zEwt-=6uNpG203EP+vHcOA9NG0t=xJACiiOGuQ@mail.gmail.com>
Excerpts from Mitch Harder's message of 2011-07-11 15:38:45 -0400:
> 2011/7/11 Jo=C3=A3o Eduardo Lu=C3=ADs <jecluis@gmail.com>:
> > Hello.
> >
> > Am I reading the code the wrong way, or is the 'last_index' variabl=
e in '__btrfs_buffered_write()' (and previously used in 'btrfs_file_aio=
_write()') irrelevant?
> >
> > It appears to just be used in 'prepare_pages()', passed as an argum=
ent, but never actually used by this function.
> >
> > Furthermore, I'm not sure what is intended with this variable, but =
if the idea is to assign it with the =C2=A0last page in the range, then=
I would say that instead of
> >
> >> last_index =3D (pos + iov_iter_count(i)) >> PAGE_CACHE_SHIFT;
> >
> > it should be
> >
> >> =C2=A0last_index =3D (pos + iov_iter_count(i) - 1) >> PAGE_CACHE_S=
HIFT;
> >
> > Then again, I may be missing something.
> >
> > Cheers.
> >
>=20
> I came to the same conclusion a few months ago when looking at a bug
> in the same area of code.
>=20
> The calculation appears to be wrong, but since it's not used anywhere=
,
> you can't say for certain. :)
>=20
> I just haven't gotten around to testing a patch to confirm the hypoth=
esis.
I'd say it is a victim of a cleanup that didn't completely clean it up.
It is unused ;)
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-07-12 14:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-11 16:56 last_index variable in btrfs_buffered_write function João Eduardo Luís
2011-07-11 19:38 ` Mitch Harder
2011-07-12 14:11 ` Chris Mason [this message]
2011-07-12 19:43 ` Mitch Harder
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=1310479850-sup-3754@shiny \
--to=chris.mason@oracle.com \
--cc=jecluis@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mitch.harder@sabayonlinux.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 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.