Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 1995 15:14:22 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        hackers@freebsd.org, current@freebsd.org
Subject:   ffs_truncate problem?
Message-ID:  <199511202214.PAA02255@phaeton.artisoft.com>

next in thread | raw e-mail | index | archive | help
In /sys/ufs/ffs/ffs_inode.c in ffs_truncate():


	oip->i_flag |= IN_CHANGE | IN_UPDATE;
	error = VOP_UPDATE(ovp, &tv, &tv, 1);
	if (error)
		allerror = error;
	/*
	 * Having written the new inode to disk, save its new configuration
	 * and put back the old block pointers long enough to process them.
	 * Note that we save the new block configuration so we can check it
	 * when we are done.
	 */
	bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof newblks);
	bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks);
	oip->i_size = osize;
	vflags = ((length > 0) ? V_SAVE : 0) | V_SAVEMETA;
	allerror = vinvalbuf(ovp, vflags, ap->a_cred, ap->a_p, 0, 0);

When truncating a file short.

Does is strike anyone as odd that the code keeps going if the VOP_UPDATE
fails?

This *might* explain the read-only NFS mount file truncation.  Basically
the error (if any) from VOP_UPDATE() is ignored.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511202214.PAA02255>