ceph: move dereference after NULL test
PATCH 1/1 ceph: move dereference after NULL test
Signed-off-by Alexander Beregalov <[email protected]>
--- fs/ceph/addr.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/ceph/addr.c +3 -1
@@ -143,7 +143,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;
@@ -152,6 +152,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
Signature · 9 lines
1.7.0 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
Sage Weil
AppliedQuoted 19 lines · Alexander Beregalov
Signed-off-by Alexander Beregalov <[email protected]>--- fs/ceph/addr.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fs/ceph/addr.c +1
-1@@ -143,7 +143,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;
fs/ceph/addr.c static void ceph_invalidatepage(struct page *page, unsigned long offset) · line 159
Quoted 8 lines
fs/ceph/addr.c +2
-0@@ -152,6 +152,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
Applied, thanks!
sage
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev