Ensure that softdep_sync_metadata can handle bmsafemap and mkdir entries
if they ever arise (which should not happen as softdep_sync_metadata is currently used).
This commit is contained in:
parent
8b89ef0a2d
commit
4cbb89d95d
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
|
||||
*
|
||||
@ -53,8 +52,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ffs_softdep.c 9.32 (McKusick) 2/17/99
|
||||
* $Id: ffs_softdep.c,v 1.21 1999/01/22 09:07:32 dg Exp $
|
||||
* from: @(#)ffs_softdep.c 9.33 (McKusick) 2/25/99
|
||||
* $Id: ffs_softdep.c,v 1.22 1999/02/17 20:01:20 mckusick Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2155,6 +2154,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp)
|
||||
/*
|
||||
* Dependency on "." and ".." being written to disk.
|
||||
*/
|
||||
mkdir1->md_buf = newdirbp;
|
||||
LIST_INSERT_HEAD(&mkdirlisthd, mkdir1, md_mkdirs);
|
||||
WORKLIST_INSERT(&newdirbp->b_dep, &mkdir1->md_list);
|
||||
bdwrite(newdirbp);
|
||||
@ -3845,6 +3845,48 @@ softdep_sync_metadata(ap)
|
||||
}
|
||||
break;
|
||||
|
||||
case D_MKDIR:
|
||||
/*
|
||||
* This case should never happen if the vnode has
|
||||
* been properly sync'ed. However, if this function
|
||||
* is used at a place where the vnode has not yet
|
||||
* been sync'ed, this dependency can show up. So,
|
||||
* rather than panic, just flush it.
|
||||
*/
|
||||
nbp = WK_MKDIR(wk)->md_buf;
|
||||
if (getdirtybuf(&nbp, waitfor) == 0)
|
||||
break;
|
||||
FREE_LOCK(&lk);
|
||||
if (waitfor == MNT_NOWAIT) {
|
||||
bawrite(nbp);
|
||||
} else if ((error = VOP_BWRITE(nbp)) != 0) {
|
||||
bawrite(bp);
|
||||
return (error);
|
||||
}
|
||||
ACQUIRE_LOCK(&lk);
|
||||
break;
|
||||
|
||||
case D_BMSAFEMAP:
|
||||
/*
|
||||
* This case should never happen if the vnode has
|
||||
* been properly sync'ed. However, if this function
|
||||
* is used at a place where the vnode has not yet
|
||||
* been sync'ed, this dependency can show up. So,
|
||||
* rather than panic, just flush it.
|
||||
*/
|
||||
nbp = WK_BMSAFEMAP(wk)->sm_buf;
|
||||
if (getdirtybuf(&nbp, waitfor) == 0)
|
||||
break;
|
||||
FREE_LOCK(&lk);
|
||||
if (waitfor == MNT_NOWAIT) {
|
||||
bawrite(nbp);
|
||||
} else if ((error = VOP_BWRITE(nbp)) != 0) {
|
||||
bawrite(bp);
|
||||
return (error);
|
||||
}
|
||||
ACQUIRE_LOCK(&lk);
|
||||
break;
|
||||
|
||||
default:
|
||||
panic("softdep_sync_metadata: Unknown type %s",
|
||||
TYPENAME(wk->wk_type));
|
||||
|
@ -52,8 +52,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)softdep.h 9.5 (McKusick) 2/11/98
|
||||
* $Id:$
|
||||
* @(#)softdep.h 9.6 (McKusick) 2/25/99
|
||||
* $Id: softdep.h,v 1.4 1998/05/19 23:07:25 julian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/queue.h>
|
||||
@ -517,6 +517,7 @@ struct mkdir {
|
||||
struct worklist md_list; /* id_inowait or buffer holding dir */
|
||||
# define md_state md_list.wk_state /* type: MKDIR_PARENT or MKDIR_BODY */
|
||||
struct diradd *md_diradd; /* associated diradd */
|
||||
struct buf *md_buf; /* MKDIR_BODY: buffer holding dir */
|
||||
LIST_ENTRY(mkdir) md_mkdirs; /* list of all mkdirs */
|
||||
};
|
||||
LIST_HEAD(mkdirlist, mkdir) mkdirlisthd;
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
|
||||
*
|
||||
@ -53,8 +52,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ffs_softdep.c 9.32 (McKusick) 2/17/99
|
||||
* $Id: ffs_softdep.c,v 1.21 1999/01/22 09:07:32 dg Exp $
|
||||
* from: @(#)ffs_softdep.c 9.33 (McKusick) 2/25/99
|
||||
* $Id: ffs_softdep.c,v 1.22 1999/02/17 20:01:20 mckusick Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2155,6 +2154,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp)
|
||||
/*
|
||||
* Dependency on "." and ".." being written to disk.
|
||||
*/
|
||||
mkdir1->md_buf = newdirbp;
|
||||
LIST_INSERT_HEAD(&mkdirlisthd, mkdir1, md_mkdirs);
|
||||
WORKLIST_INSERT(&newdirbp->b_dep, &mkdir1->md_list);
|
||||
bdwrite(newdirbp);
|
||||
@ -3845,6 +3845,48 @@ softdep_sync_metadata(ap)
|
||||
}
|
||||
break;
|
||||
|
||||
case D_MKDIR:
|
||||
/*
|
||||
* This case should never happen if the vnode has
|
||||
* been properly sync'ed. However, if this function
|
||||
* is used at a place where the vnode has not yet
|
||||
* been sync'ed, this dependency can show up. So,
|
||||
* rather than panic, just flush it.
|
||||
*/
|
||||
nbp = WK_MKDIR(wk)->md_buf;
|
||||
if (getdirtybuf(&nbp, waitfor) == 0)
|
||||
break;
|
||||
FREE_LOCK(&lk);
|
||||
if (waitfor == MNT_NOWAIT) {
|
||||
bawrite(nbp);
|
||||
} else if ((error = VOP_BWRITE(nbp)) != 0) {
|
||||
bawrite(bp);
|
||||
return (error);
|
||||
}
|
||||
ACQUIRE_LOCK(&lk);
|
||||
break;
|
||||
|
||||
case D_BMSAFEMAP:
|
||||
/*
|
||||
* This case should never happen if the vnode has
|
||||
* been properly sync'ed. However, if this function
|
||||
* is used at a place where the vnode has not yet
|
||||
* been sync'ed, this dependency can show up. So,
|
||||
* rather than panic, just flush it.
|
||||
*/
|
||||
nbp = WK_BMSAFEMAP(wk)->sm_buf;
|
||||
if (getdirtybuf(&nbp, waitfor) == 0)
|
||||
break;
|
||||
FREE_LOCK(&lk);
|
||||
if (waitfor == MNT_NOWAIT) {
|
||||
bawrite(nbp);
|
||||
} else if ((error = VOP_BWRITE(nbp)) != 0) {
|
||||
bawrite(bp);
|
||||
return (error);
|
||||
}
|
||||
ACQUIRE_LOCK(&lk);
|
||||
break;
|
||||
|
||||
default:
|
||||
panic("softdep_sync_metadata: Unknown type %s",
|
||||
TYPENAME(wk->wk_type));
|
||||
|
@ -52,8 +52,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)softdep.h 9.5 (McKusick) 2/11/98
|
||||
* $Id:$
|
||||
* @(#)softdep.h 9.6 (McKusick) 2/25/99
|
||||
* $Id: softdep.h,v 1.4 1998/05/19 23:07:25 julian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/queue.h>
|
||||
@ -517,6 +517,7 @@ struct mkdir {
|
||||
struct worklist md_list; /* id_inowait or buffer holding dir */
|
||||
# define md_state md_list.wk_state /* type: MKDIR_PARENT or MKDIR_BODY */
|
||||
struct diradd *md_diradd; /* associated diradd */
|
||||
struct buf *md_buf; /* MKDIR_BODY: buffer holding dir */
|
||||
LIST_ENTRY(mkdir) md_mkdirs; /* list of all mkdirs */
|
||||
};
|
||||
LIST_HEAD(mkdirlist, mkdir) mkdirlisthd;
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
|
||||
*
|
||||
@ -53,8 +52,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ffs_softdep.c 9.32 (McKusick) 2/17/99
|
||||
* $Id: ffs_softdep.c,v 1.21 1999/01/22 09:07:32 dg Exp $
|
||||
* from: @(#)ffs_softdep.c 9.33 (McKusick) 2/25/99
|
||||
* $Id: ffs_softdep.c,v 1.22 1999/02/17 20:01:20 mckusick Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2155,6 +2154,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp)
|
||||
/*
|
||||
* Dependency on "." and ".." being written to disk.
|
||||
*/
|
||||
mkdir1->md_buf = newdirbp;
|
||||
LIST_INSERT_HEAD(&mkdirlisthd, mkdir1, md_mkdirs);
|
||||
WORKLIST_INSERT(&newdirbp->b_dep, &mkdir1->md_list);
|
||||
bdwrite(newdirbp);
|
||||
@ -3845,6 +3845,48 @@ softdep_sync_metadata(ap)
|
||||
}
|
||||
break;
|
||||
|
||||
case D_MKDIR:
|
||||
/*
|
||||
* This case should never happen if the vnode has
|
||||
* been properly sync'ed. However, if this function
|
||||
* is used at a place where the vnode has not yet
|
||||
* been sync'ed, this dependency can show up. So,
|
||||
* rather than panic, just flush it.
|
||||
*/
|
||||
nbp = WK_MKDIR(wk)->md_buf;
|
||||
if (getdirtybuf(&nbp, waitfor) == 0)
|
||||
break;
|
||||
FREE_LOCK(&lk);
|
||||
if (waitfor == MNT_NOWAIT) {
|
||||
bawrite(nbp);
|
||||
} else if ((error = VOP_BWRITE(nbp)) != 0) {
|
||||
bawrite(bp);
|
||||
return (error);
|
||||
}
|
||||
ACQUIRE_LOCK(&lk);
|
||||
break;
|
||||
|
||||
case D_BMSAFEMAP:
|
||||
/*
|
||||
* This case should never happen if the vnode has
|
||||
* been properly sync'ed. However, if this function
|
||||
* is used at a place where the vnode has not yet
|
||||
* been sync'ed, this dependency can show up. So,
|
||||
* rather than panic, just flush it.
|
||||
*/
|
||||
nbp = WK_BMSAFEMAP(wk)->sm_buf;
|
||||
if (getdirtybuf(&nbp, waitfor) == 0)
|
||||
break;
|
||||
FREE_LOCK(&lk);
|
||||
if (waitfor == MNT_NOWAIT) {
|
||||
bawrite(nbp);
|
||||
} else if ((error = VOP_BWRITE(nbp)) != 0) {
|
||||
bawrite(bp);
|
||||
return (error);
|
||||
}
|
||||
ACQUIRE_LOCK(&lk);
|
||||
break;
|
||||
|
||||
default:
|
||||
panic("softdep_sync_metadata: Unknown type %s",
|
||||
TYPENAME(wk->wk_type));
|
||||
|
@ -52,8 +52,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)softdep.h 9.5 (McKusick) 2/11/98
|
||||
* $Id:$
|
||||
* @(#)softdep.h 9.6 (McKusick) 2/25/99
|
||||
* $Id: softdep.h,v 1.4 1998/05/19 23:07:25 julian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/queue.h>
|
||||
@ -517,6 +517,7 @@ struct mkdir {
|
||||
struct worklist md_list; /* id_inowait or buffer holding dir */
|
||||
# define md_state md_list.wk_state /* type: MKDIR_PARENT or MKDIR_BODY */
|
||||
struct diradd *md_diradd; /* associated diradd */
|
||||
struct buf *md_buf; /* MKDIR_BODY: buffer holding dir */
|
||||
LIST_ENTRY(mkdir) md_mkdirs; /* list of all mkdirs */
|
||||
};
|
||||
LIST_HEAD(mkdirlist, mkdir) mkdirlisthd;
|
||||
|
Loading…
Reference in New Issue
Block a user