kernel - Fix softupdates panic with UFS
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 10 Dec 2012 23:02:01 +0000 (15:02 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 14 Dec 2012 03:15:51 +0000 (19:15 -0800)
* If getdirtybuf() was unable to lookup a dirty buffer from the
  flush_pagedep_deps path, we need to retry the lookup, rather than
  proceeding through processing the diradd.

Reported-by: marino@
Submitted-by: vsrinivas
sys/vfs/ufs/ffs_softdep.c

index b6a8cbf..d8a91f6 100644 (file)
@@ -4593,6 +4593,7 @@ flush_pagedep_deps(struct vnode *pvp, struct mount *mp,
                 * locate that buffer, ensure that there will be no rollback
                 * caused by a bitmap dependency, then write the inode buffer.
                 */
+retry_lookup:
                if (inodedep_lookup(ump->um_fs, inum, 0, &inodedep) == 0) {
                        panic("flush_pagedep_deps: lost inode");
                }
@@ -4602,6 +4603,8 @@ flush_pagedep_deps(struct vnode *pvp, struct mount *mp,
                 */
                if ((inodedep->id_state & DEPCOMPLETE) == 0) {
                        gotit = getdirtybuf(&inodedep->id_buf, MNT_WAIT);
+                       if (gotit == 0)
+                               goto retry_lookup;
                        FREE_LOCK(&lk);
                        if (gotit && (error = bwrite(inodedep->id_buf)) != 0)
                                break;