From: Benjamin LaHaise <bcrl@kvack.org>
To: Zach Brown <zach.brown@oracle.com>
Cc: linux-aio@kvack.org, linux-kernel@vger.kernel.org,
Jeff Moyer <jmoyer@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] dio: invalidate clean pages before dio write
Date: Fri, 9 Mar 2007 20:22:44 -0500 [thread overview]
Message-ID: <20070310012244.GP6209@kvack.org> (raw)
In-Reply-To: <20070309223557.29256.4572.sendpatchset@tetsuo.zabbo.net>
On Fri, Mar 09, 2007 at 02:35:57PM -0800, Zach Brown wrote:
> + if (rw == WRITE && mapping->nrpages) {
> + int err = invalidate_inode_pages2_range(mapping,
> + offset >> PAGE_CACHE_SHIFT, end);
> + if (err && retval >= 0)
> + retval = err;
> + }
I don't think reporting the error is the correct thing to do in the presense
of the write having completed. It's a race that the caller can do nothing
about and is arguably a kernel bug, so I'd rather do something like:
if (err) {
if (!retval)
retval = err;
else
printk_ratelimited(KERN_DEBUG
"dio sucks and hit the race %ld %ld\n",
retval, err);
}
Aside from that, I much prefer this approach to fix the problem than going
around and changing semantics. Feel free to add my Signed-off-by.
-ben
--
"Time is of no importance, Mr. President, only life is important."
Don't Email: <zyntrop@kvack.org>.
prev parent reply other threads:[~2007-03-10 1:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-09 22:35 [PATCH] dio: invalidate clean pages before dio write Zach Brown
2007-03-10 1:22 ` Benjamin LaHaise [this message]
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=20070310012244.GP6209@kvack.org \
--to=bcrl@kvack.org \
--cc=akpm@linux-foundation.org \
--cc=jmoyer@redhat.com \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=zach.brown@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 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.