From: Joel Becker <Joel.Becker@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
ocfs2-devel@oss.oracle.com, Tao Ma <tao.ma@oracle.com>,
Dave Chinner <dchinner@redhat.com>,
Christoph Hellwig <hch@lst.de>, Mark Fasheh <mfasheh@suse.com>
Subject: [PATCH] Revert "writeback: limit write_cache_pages integrity scanning to current EOF"
Date: Mon, 28 Jun 2010 10:35:29 -0700 [thread overview]
Message-ID: <20100628173529.GA10573@mail.oracle.com> (raw)
This reverts commit d87815cb2090e07b0b0b2d73dc9740706e92c80c.
This patch causes any filesystem with an allocation unit larger than the
filesystem blocksize will leak unzeroed data. During a file extend, the
entire allocation unit is zeroed. However, this patch prevents the tail
blocks of the allocation unit from being written back to disk. When the
file is next extended, i_size will now cover these unzeroed blocks,
leaking the old contents of the disk to userspace and creating a corrupt
file.
This affects ocfs2 directly. As Tao Ma mentioned in his reporting
email:
1. all the place we use filemap_fdatawrite in ocfs2 doesn't flush pages
after i_size now.
2. sync, fsync, fdatasync and umount don't flush pages after i_size(they
are called from writeback_single_inode).
3. reflink have a BUG_ON triggered because we have some dirty pages
while during CoW. http://oss.oracle.com/bugzilla/show_bug.cgi?id=1265
Because this patch breaks ocfs2 file extends, we need to request its
reversion.
Reported-by: Tao Ma <tao.ma@oracle.com>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
---
mm/page-writeback.c | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index bbd396a..b3dbb80 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -851,22 +851,7 @@ int write_cache_pages(struct address_space *mapping,
if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
range_whole = 1;
cycled = 1; /* ignore range_cyclic tests */
-
- /*
- * If this is a data integrity sync, cap the writeback to the
- * current end of file. Any extension to the file that occurs
- * after this is a new write and we don't need to write those
- * pages out to fulfil our data integrity requirements. If we
- * try to write them out, we can get stuck in this scan until
- * the concurrent writer stops adding dirty pages and extending
- * EOF.
- */
- if (wbc->sync_mode == WB_SYNC_ALL &&
- wbc->range_end == LLONG_MAX) {
- end = i_size_read(mapping->host) >> PAGE_CACHE_SHIFT;
- }
}
-
retry:
done_index = index;
while (!done && (index <= end)) {
--
1.7.1
--
"Senator let's be sincere,
As much as you can."
Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
next reply other threads:[~2010-06-28 17:38 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-28 17:35 Joel Becker [this message]
2010-06-29 0:24 ` [PATCH] Revert "writeback: limit write_cache_pages integrity scanning to current EOF" Dave Chinner
2010-06-29 0:54 ` Joel Becker
2010-06-29 1:12 ` Linus Torvalds
2010-06-29 1:58 ` [Ocfs2-devel] " Joel Becker
2010-06-29 2:20 ` Linus Torvalds
2010-06-29 2:44 ` Dave Chinner
2010-06-29 8:16 ` Joel Becker
2010-06-30 1:30 ` Joel Becker
2010-07-06 19:06 ` Joel Becker
2010-06-29 1:56 ` Dave Chinner
2010-06-29 2:04 ` Joel Becker
2010-06-29 2:27 ` Dave Chinner
2010-06-29 7:18 ` Joel Becker
2010-07-02 22:49 ` [PATCH] ocfs2: Zero the tail cluster when extending past i_size Joel Becker
2010-07-03 21:32 ` [PATCH 1/2] ocfs2: Zero the tail cluster when extending past i_size v2 Joel Becker
2010-07-03 21:33 ` [PATCH 2/2] ocfs2: No need to zero pages past i_size. " Joel Becker
2010-07-04 15:13 ` Tao Ma
2010-07-05 1:38 ` Tao Ma
2010-07-06 7:10 ` Joel Becker
2010-07-06 7:09 ` Joel Becker
2010-07-06 18:39 ` [Ocfs2-devel] " Joel Becker
2010-07-05 3:51 ` [PATCH 1/2] ocfs2: Zero the tail cluster when extending past " Tao Ma
2010-07-06 7:17 ` Joel Becker
2010-07-06 7:54 ` Tao Ma
2010-07-06 11:58 ` Joel Becker
2010-07-07 0:42 ` Tao Ma
2010-07-07 2:03 ` Joel Becker
2010-07-06 18:48 ` Joel Becker
2010-07-06 18:57 ` Joel Becker
2010-07-07 11:16 ` [PATCH 0/3] ocfs2: Tail zeroing fixes Joel Becker
2010-07-12 22:45 ` [Ocfs2-devel] " Joel Becker
2010-07-07 11:16 ` [PATCH 1/3] ocfs2: When zero extending, do it by page Joel Becker
2010-07-07 15:19 ` Tao Ma
2010-07-07 20:04 ` Joel Becker
2010-07-08 3:44 ` Tao Ma
2010-07-08 9:51 ` Joel Becker
2010-07-07 11:16 ` [PATCH 2/3] ocfs2: Zero the tail cluster when extending past i_size Joel Becker
2010-07-07 11:16 ` [PATCH 3/3] ocfs2: No need to zero pages " Joel Becker
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=20100628173529.GA10573@mail.oracle.com \
--to=joel.becker@oracle.com \
--cc=dchinner@redhat.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@suse.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=tao.ma@oracle.com \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox