FreeBSD Bugzilla – Attachment 172710 Details for
Bug 93942
[vfs] [patch] panic: ufs_dirbad: bad dir (patch from DragonFly)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Ensure that pager is resized before UFS directory blocks are allocated.
1.patch (text/plain), 1.77 KB, created by
Konstantin Belousov
on 2016-07-19 10:08:19 UTC
(
hide
)
Description:
Ensure that pager is resized before UFS directory blocks are allocated.
Filename:
MIME Type:
Creator:
Konstantin Belousov
Created:
2016-07-19 10:08:19 UTC
Size:
1.77 KB
patch
obsolete
>diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c >index 53536ff..29d96a0 100644 >--- a/sys/ufs/ufs/ufs_lookup.c >+++ b/sys/ufs/ufs/ufs_lookup.c >@@ -881,6 +881,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) > struct buf *bp; > u_int dsize; > struct direct *ep, *nep; >+ u_int64_t old_isize; > int error, ret, blkoff, loc, spacefree, flags, namlen; > char *dirbuf; > >@@ -909,16 +910,18 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) > return (error); > } > #endif >+ old_isize = dp->i_size; >+ vnode_pager_setsize(dvp, (u_long)dp->i_offset + DIRBLKSIZ); > if ((error = UFS_BALLOC(dvp, (off_t)dp->i_offset, DIRBLKSIZ, > cr, flags, &bp)) != 0) { > if (DOINGSOFTDEP(dvp) && newdirbp != NULL) > bdwrite(newdirbp); >+ vnode_pager_setsize(dvp, (u_long)old_isize); > return (error); > } > dp->i_size = dp->i_offset + DIRBLKSIZ; > DIP_SET(dp, i_size, dp->i_size); > dp->i_flag |= IN_CHANGE | IN_UPDATE; >- vnode_pager_setsize(dvp, (u_long)dp->i_size); > dirp->d_reclen = DIRBLKSIZ; > blkoff = dp->i_offset & > (VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_iosize - 1); >diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c >index 83df347..217ca90 100644 >--- a/sys/ufs/ufs/ufs_vnops.c >+++ b/sys/ufs/ufs/ufs_vnops.c >@@ -1913,13 +1913,13 @@ ufs_mkdir(ap) > dirtemplate = *dtp; > dirtemplate.dot_ino = ip->i_number; > dirtemplate.dotdot_ino = dp->i_number; >+ vnode_pager_setsize(tvp, DIRBLKSIZ); > if ((error = UFS_BALLOC(tvp, (off_t)0, DIRBLKSIZ, cnp->cn_cred, > BA_CLRBUF, &bp)) != 0) > goto bad; > ip->i_size = DIRBLKSIZ; > DIP_SET(ip, i_size, DIRBLKSIZ); > ip->i_flag |= IN_CHANGE | IN_UPDATE; >- vnode_pager_setsize(tvp, (u_long)ip->i_size); > bcopy((caddr_t)&dirtemplate, (caddr_t)bp->b_data, sizeof dirtemplate); > if (DOINGSOFTDEP(tvp)) { > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 93942
:
62913
| 172710