[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150420052752.26554.53475.stgit@notabene.brown>
Date: Mon, 20 Apr 2015 15:27:52 +1000
From: NeilBrown <neilb@...e.de>
To: David Howells <dhowells@...hat.com>, Chris Mason <clm@...com>,
Al Viro <viro@...IV.linux.org.uk>, Josef Bacik <jbacik@...com>,
David Sterba <dsterba@...e.cz>
Cc: linux-cachefs@...r.kernel.org, Dave Chinner <david@...morbit.com>,
linux-kernel@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>,
linux-fsdevel@...r.kernel.org, linux-btrfs@...r.kernel.org
Subject: [PATCH 1/3] cachefiles: perform test on s_blocksize when opening
cache file.
cachefiles requires that s_blocksize in the cache is not greater than
PAGE_SIZE, and performs the check every time a block is accessed.
Move the test to the place where the file is "opened", where other
file-validity tests are performed.
Signed-off-by: NeilBrown <neilb@...e.de>
---
fs/cachefiles/namei.c | 2 ++
fs/cachefiles/rdwr.c | 6 ------
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index 1e51714eb33e..5404afcdee98 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -649,6 +649,8 @@ lookup_again:
aops = object->dentry->d_inode->i_mapping->a_ops;
if (!aops->bmap)
goto check_error;
+ if (object->dentry->d_sb->s_blocksize > PAGE_SIZE)
+ goto check_error;
object->backer = object->dentry;
} else {
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index c6cd8d7a4eef..9bd44ff48cc0 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -414,9 +414,6 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
ASSERT(inode->i_mapping->a_ops->readpages);
/* calculate the shift required to use bmap */
- if (inode->i_sb->s_blocksize > PAGE_SIZE)
- goto enobufs;
-
shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
op->op.flags &= FSCACHE_OP_KEEP_FLAGS;
@@ -711,9 +708,6 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,
ASSERT(inode->i_mapping->a_ops->readpages);
/* calculate the shift required to use bmap */
- if (inode->i_sb->s_blocksize > PAGE_SIZE)
- goto all_enobufs;
-
shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
pagevec_init(&pagevec, 0);
--
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