Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171558389
D31780.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31780.diff
View Options
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -646,7 +646,7 @@
cluster_write(struct vnode *vp, struct vn_clusterw *vnc, struct buf *bp,
u_quad_t filesize, int seqcount, int gbflags)
{
- daddr_t lbn;
+ daddr_t lbn, pbn;
int maxclen, cursize;
int lblocksize;
int async;
@@ -753,14 +753,16 @@
bp->b_blkno == bp->b_lblkno &&
(VOP_BMAP(vp, lbn, NULL, &bp->b_blkno, &maxclen,
NULL) != 0 || bp->b_blkno == -1)) {
+ pbn = bp->b_blkno;
bawrite(bp);
vnc->v_clen = 0;
- vnc->v_lasta = bp->b_blkno;
+ vnc->v_lasta = pbn;
vnc->v_cstart = lbn + 1;
vnc->v_lastw = lbn;
return;
}
vnc->v_clen = maxclen;
+ pbn = bp->b_blkno;
if (!async && maxclen == 0) { /* I/O not contiguous */
vnc->v_cstart = lbn + 1;
bawrite(bp);
@@ -774,6 +776,7 @@
* are operating sequentially, otherwise let the buf or
* update daemon handle it.
*/
+ pbn = bp->b_blkno;
bdwrite(bp);
if (seqcount > 1) {
cluster_wbuild_wb(vp, lblocksize, vnc->v_cstart,
@@ -785,15 +788,17 @@
/*
* We are low on memory, get it going NOW
*/
+ pbn = bp->b_blkno;
bawrite(bp);
} else {
/*
* In the middle of a cluster, so just delay the I/O for now.
*/
+ pbn = bp->b_blkno;
bdwrite(bp);
}
vnc->v_lastw = lbn;
- vnc->v_lasta = bp->b_blkno;
+ vnc->v_lasta = pbn;
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 12, 6:21 PM (13 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38563169
Default Alt Text
D31780.diff (1 KB)
Attached To
Mode
D31780: cluster_write(): do not access buffer after it is released
Attached
Detach File
Event Timeline
Log In to Comment