The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c31480a1f66537e59b02e935a547bcfc76715278

commit c31480a1f66537e59b02e935a547bcfc76715278
Author:     Konstantin Belousov <k...@freebsd.org>
AuthorDate: 2021-02-15 03:36:02 +0000
Commit:     Konstantin Belousov <k...@freebsd.org>
CommitDate: 2021-02-16 05:11:52 +0000

    UFS snapshots: properly set the vm object size.
    
    Citing Kirk:
    The previous code [before 8563de2f2799b2cb -- kib] did not call
    vnode_pager_setsize() but worked because later in ffs_snapshot() it
    does a UFS_WRITE() to output the snaplist. Previously the UFS_WRITE()
    allocated the extra block at the end of the file which caused it to do
    the needed vnode_pager_setsize(). But the new code had already allocated
    the extra block, so UFS_WRITE() did not extend the size and thus did not
    do the vnode_pager_setsize().
    
    PR:     253158
    Reported by:    Harald Schmalzbauer <bugzilla.free...@omnilan.de>
    Reviewed by:    mckusick
    Tested by:      cy
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/ufs/ffs/ffs_snapshot.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index 8f0adde6f5e4..6da84fb46bb0 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/rwlock.h>
 #include <sys/vnode.h>
 
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
+
 #include <geom/geom.h>
 
 #include <ufs/ufs/extattr.h>
@@ -328,6 +331,7 @@ restart:
                goto out;
        bawrite(bp);
        ip->i_size = lblktosize(fs, (off_t)(numblks + 1));
+       vnode_pager_setsize(vp, ip->i_size);
        DIP_SET(ip, i_size, ip->i_size);
        UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE);
        /*
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to