diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2010-02-22 17:17:44 +0300 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-02-23 14:26:34 -0800 |
commit | 4ce1e9adabbad8f2c45ceeeb6de56cc368484297 (patch) | |
tree | 960188ec419b55ecaa3288b3d54aa5e2fe481b02 /fs | |
parent | 5b3a4db3e4009aff918abb1353eb3f4925393a7b (diff) | |
download | op-kernel-dev-4ce1e9adabbad8f2c45ceeeb6de56cc368484297.zip op-kernel-dev-4ce1e9adabbad8f2c45ceeeb6de56cc368484297.tar.gz |
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')
-rw-r--r-- | fs/ceph/addr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 25360d5..23bb0ce 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -144,7 +144,7 @@ static int ceph_set_page_dirty(struct page *page) */ static void ceph_invalidatepage(struct page *page, unsigned long offset) { - struct inode *inode = page->mapping->host; + struct inode *inode; struct ceph_inode_info *ci; struct ceph_snap_context *snapc = (void *)page->private; @@ -153,6 +153,8 @@ static void ceph_invalidatepage(struct page *page, unsigned long offset) BUG_ON(!PagePrivate(page)); BUG_ON(!page->mapping); + inode = page->mapping->host; + /* * We can get non-dirty pages here due to races between * set_page_dirty and truncate_complete_page; just spit out a |