Commit c31480a1 authored by Konstantin Belousov's avatar Konstantin Belousov
Browse files

UFS snapshots: properly set the vm object size.

Citing Kirk:
The previous code [before 8563de2f -- 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.freebsd@omnilan.de>
Reviewed by:	mckusick
Tested by:	cy
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
parent c61fae14
......@@ -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 @@ ffs_snapshot(mp, snapfile)
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);
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment