Fix a bug in chown, chmod, and chflags. When the setfflags(), setffown(),
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 23 Nov 2004 04:03:26 +0000 (04:03 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 23 Nov 2004 04:03:26 +0000 (04:03 +0000)
commit186fccd614aa17bbcb0008f456aa5ecd84665557
treef87da1809751417e1c4c27330b332bbd5238f846
parent466bbc10a88e37d403f75c9512f758446435fbe7
Fix a bug in chown, chmod, and chflags.  When the setfflags(), setffown(),
and setfmode() API was cleaned up to not remove vrefs maintained by the
caller it resulted in an incorrect vref+vn_lock combination which fails
to clear the VINACTIVE bit on the vnode.  vget() clears this bit as part of
its work.  This prevented the filesystem from synchronizing the changes
out to the inode unless other modifications were made to the file as well,
which resulted in weird errors such as ./MAKEDEV all creating /dev/null with
perms 600 (the chmod it does afterwords doesn't always take effect), and
other things.

Additional thanks to walt for providing the information that led to the
diagnosis.

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>,
             walt <wa1ter@myrealbox.com>,
     Andreas Hauser <andy@splashground.de>
sys/kern/vfs_syscalls.c