exofs: readpage_strip: Add a BUG_ON to check for PageLocked(page)
authorKautuk Consul <consul.kautuk@gmail.com>
Mon, 20 Feb 2012 08:46:12 +0000 (03:46 -0500)
committerBoaz Harrosh <bharrosh@panasas.com>
Thu, 2 Aug 2012 11:52:12 +0000 (14:52 +0300)
readpage_strip can be called from several code paths all of which
require that the page be locked before any operations are carried
out.

Since we export the exofs_readpage callback to the VFS, add a
BUG_ON to check for PageLocked(page) to make sure that this
understanding is never compromised.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
fs/exofs/inode.c

index 5badb0c039de404b24208c8e6c2041b3331ae5bb..9a5ed30b8a354e47d4a32e62dfd3fc6246ab068f 100644 (file)
@@ -389,6 +389,8 @@ static int readpage_strip(void *data, struct page *page)
        size_t len;
        int ret;
 
+       BUG_ON(!PageLocked(page));
+
        /* FIXME: Just for debugging, will be removed */
        if (PageUptodate(page))
                EXOFS_ERR("PageUptodate(0x%lx, 0x%lx)\n", pcol->inode->i_ino,