aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/addr.c
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2010-02-22 09:17:44 -0500
committerSage Weil <sage@newdream.net>2010-02-23 17:26:34 -0500
commit4ce1e9adabbad8f2c45ceeeb6de56cc368484297 (patch)
tree960188ec419b55ecaa3288b3d54aa5e2fe481b02 /fs/ceph/addr.c
parent5b3a4db3e4009aff918abb1353eb3f4925393a7b (diff)
ceph: move dereference after NULL test
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r--fs/ceph/addr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 25360d517d1b..23bb0ceabe31 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -144,7 +144,7 @@ static int ceph_set_page_dirty(struct page *page)
144 */ 144 */
145static void ceph_invalidatepage(struct page *page, unsigned long offset) 145static void ceph_invalidatepage(struct page *page, unsigned long offset)
146{ 146{
147 struct inode *inode = page->mapping->host; 147 struct inode *inode;
148 struct ceph_inode_info *ci; 148 struct ceph_inode_info *ci;
149 struct ceph_snap_context *snapc = (void *)page->private; 149 struct ceph_snap_context *snapc = (void *)page->private;
150 150
@@ -153,6 +153,8 @@ static void ceph_invalidatepage(struct page *page, unsigned long offset)
153 BUG_ON(!PagePrivate(page)); 153 BUG_ON(!PagePrivate(page));
154 BUG_ON(!page->mapping); 154 BUG_ON(!page->mapping);
155 155
156 inode = page->mapping->host;
157
156 /* 158 /*
157 * We can get non-dirty pages here due to races between 159 * We can get non-dirty pages here due to races between
158 * set_page_dirty and truncate_complete_page; just spit out a 160 * set_page_dirty and truncate_complete_page; just spit out a