While checking for update of snapshot file in the ffs_copyonwrite,

first filter out metadata update. Otherwise, devfs vnode could be
erronously interpreted as ufs one, causing further check of i_flags
to use random memory.

PR:	kern/100365
Debugged and fix described by:	tegge
Approved by:	pjd (mentor)
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2006-08-21 17:20:19 +00:00
parent 3dd3357a13
commit 3f65847e2f

View File

@ -2091,7 +2091,7 @@ ffs_copyonwrite(devvp, bp)
int launched_async_io, prev_norunningbuf;
long saved_runningbufspace;
if ((VTOI(bp->b_vp)->i_flags & SF_SNAPSHOT) != 0)
if (devvp != bp->b_vp && (VTOI(bp->b_vp)->i_flags & SF_SNAPSHOT) != 0)
return (0); /* Update on a snapshot file */
if (td->td_pflags & TDP_COWINPROGRESS)
panic("ffs_copyonwrite: recursive call");