[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <320c5b270669c235c5513b5f5763a529abcf88dd.1416219974.git.osandov@osandov.com>
Date: Mon, 17 Nov 2014 02:36:56 -0800
From: Omar Sandoval <osandov@...ndov.com>
To: linux-btrfs@...r.kernel.org
Cc: Mel Gorman <mgorman@...e.de>, linux-kernel@...r.kernel.org,
<linux-fsdevel@...r.kernel.org>,
Omar Sandoval <osandov@...ndov.com>
Subject: [RFC PATCH 3/6] btrfs: don't set ->private on swapcache pages
Swapcache pages use ->private to store the swp_entry_t; overwriting it is sure
to cause insanity.
Signed-off-by: Omar Sandoval <osandov@...ndov.com>
---
fs/btrfs/extent_io.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 9b67b37..54b2d00 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2824,6 +2824,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree,
static void attach_extent_buffer_page(struct extent_buffer *eb,
struct page *page)
{
+ BUG_ON(PageSwapCache(page));
if (!PagePrivate(page)) {
SetPagePrivate(page);
page_cache_get(page);
@@ -2835,6 +2836,7 @@ static void attach_extent_buffer_page(struct extent_buffer *eb,
void set_page_extent_mapped(struct page *page)
{
+ BUG_ON(PageSwapCache(page));
if (!PagePrivate(page)) {
SetPagePrivate(page);
page_cache_get(page);
@@ -2903,7 +2905,8 @@ static int __do_readpage(struct extent_io_tree *tree,
size_t blocksize = inode->i_sb->s_blocksize;
unsigned long this_bio_flag = *bio_flags & EXTENT_BIO_PARENT_LOCKED;
- set_page_extent_mapped(page);
+ if (likely(!PageSwapCache(page)))
+ set_page_extent_mapped(page);
end = page_end;
if (!PageUptodate(page)) {
--
2.1.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists