Don't leak a locked buffer if last block on file system cannot be read.
This commit is contained in:
parent
ebb78f64c7
commit
ae5d9f3b1c
@ -292,9 +292,10 @@ ffs_snapshot(mp, snapfile)
|
||||
ip->i_size = lblktosize(fs, (off_t)numblks);
|
||||
DIP_SET(ip, i_size, ip->i_size);
|
||||
ip->i_flag |= IN_CHANGE | IN_UPDATE;
|
||||
if ((error = readblock(vp, bp, numblks - 1)) != 0)
|
||||
goto out;
|
||||
error = readblock(vp, bp, numblks - 1);
|
||||
bawrite(bp);
|
||||
if (error != 0)
|
||||
goto out;
|
||||
/*
|
||||
* Preallocate critical data structures so that we can copy
|
||||
* them in without further allocation after we suspend all
|
||||
|
Loading…
Reference in New Issue
Block a user