Linux NILFS development
 help / color / mirror / Atom feed
* re: nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption
@ 2013-04-25  7:49 Dan Carpenter
       [not found] ` <20130425074947.GB11880-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2013-04-25  7:49 UTC (permalink / raw)
  To: slava-yeENwD64cLxBDgjK7y7TUQ
  Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA, kbuild-JC7UmRfGjtg

[ It's weird that kbuild didn't catch this ].

Hello Vyacheslav Dubeyko,

The patch bb594c4767b0: "nilfs2: fix issue with flush kernel thread
after remount in RO mode because of driver's internal error or
metadata corruption" from Apr 18, 2013, leads to the following 
warning:
"fs/nilfs2/inode.c:211 nilfs_writepage()
	 error: we previously assumed 'inode' could be null (see line 195)"

fs/nilfs2/inode.c
   190  static int nilfs_writepage(struct page *page, struct writeback_control *wbc)
   191  {
   192          struct inode *inode = page->mapping->host;
   193          int err;
   194  
   195          if (inode && (inode->i_sb->s_flags & MS_RDONLY)) {
                    ^^^^^
New check.

   196                  /*
   197                   * It means that filesystem was remounted in read-only
   198                   * mode because of error or metadata corruption. But we
   199                   * have dirty pages that try to be flushed in background.
   200                   * So, here we simply discard this dirty page.
   201                   */
   202                  nilfs_clear_dirty_page(page, false);
   203                  unlock_page(page);
   204                  return -EROFS;
   205          }
   206  
   207          redirty_page_for_writepage(wbc, page);
   208          unlock_page(page);
   209  
   210          if (wbc->sync_mode == WB_SYNC_ALL) {
   211                  err = nilfs_construct_segment(inode->i_sb);
                                                      ^^^^^^^^^^^
Old dereference.

   212                  if (unlikely(err))
   213                          return err;
   214          } else if (wbc->for_reclaim)
   215                  nilfs_flush_segment(inode->i_sb, inode->i_ino);
                                            ^^^^^^^^^^^
Old dereference.

   216  
   217          return 0;
   218  }

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-25 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-25  7:49 nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption Dan Carpenter
     [not found] ` <20130425074947.GB11880-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2013-04-25  9:38   ` [PATCH] nilfs2: fix warning in nilfs_writepage() Vyacheslav Dubeyko
2013-04-25 20:46     ` Andrew Morton
     [not found]       ` <20130425134610.d26f087c0db29d0703736db3-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2013-04-25 20:55         ` Dan Carpenter
2013-04-25 14:00   ` [kbuild] nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption Fengguang Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox