Skip to content

Commit

Permalink
nilfs2: remove unneeded test in nilfs_writepage()
Browse files Browse the repository at this point in the history
page->mapping->host cannot be NULL in nilfs_writepage(), so remove the
unneeded test.

The fixes the smatch warning: "fs/nilfs2/inode.c:211 nilfs_writepage()
error: we previously assumed 'inode' could be null (see line 195)".

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Vyacheslav Dubeyko authored and Linus Torvalds committed May 1, 2013
1 parent dc33f5f commit eb53b6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nilfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static int nilfs_writepage(struct page *page, struct writeback_control *wbc)
struct inode *inode = page->mapping->host;
int err;

if (inode && (inode->i_sb->s_flags & MS_RDONLY)) {
if (inode->i_sb->s_flags & MS_RDONLY) {
/*
* It means that filesystem was remounted in read-only
* mode because of error or metadata corruption. But we
Expand Down

0 comments on commit eb53b6d

Please sign in to comment.