Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/ufs/ufs/ufs_vnops.c

[BACK] Up to [FreeBSD] / src / sys / ufs / ufs

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.331: download - view: text, markup, annotated - select for diffs
Tue Feb 7 09:51:41 2012 UTC (2 days, 12 hours ago) by kib
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.330: preferred, colored
Changes since revision 1.330: +12 -2 lines
SVN rev 231122 on 2012-02-07 09:51:41Z by kib

Sprinkle missed calls to asynchronous UFS_UPDATE() in attempt to
guarantee that all UFS inode metadata changes results in the dirtiness
of the inodeblock.  Due to missed inodeblock updates, syncer was
required to fsync each mount point' vnode to guarantee periodic
metadata flush.

Reviewed by:	mckusick
Tested by:	scottl
MFC after:	2 weeks

Revision 1.328.2.2.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.328.2.2: preferred, colored; next MAIN 1.329: preferred, colored
Changes since revision 1.328.2.2: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.328.2.2: download - view: text, markup, annotated - select for diffs
Wed Nov 9 18:51:41 2011 UTC (3 months ago) by pho
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.328.2.1: preferred, colored; branchpoint 1.328: preferred, colored; next MAIN 1.329: preferred, colored
Changes since revision 1.328.2.1: +9 -0 lines
SVN rev 227402 on 2011-11-09 18:51:41Z by pho

MFC r226971
Added missing cache purge of from argument.

Approved by:	re (kensmith)

Revision 1.317.2.6: download - view: text, markup, annotated - select for diffs
Mon Nov 7 23:09:18 2011 UTC (3 months ago) by pho
Branches: RELENG_8
Diff to: previous 1.317.2.5: preferred, colored; branchpoint 1.317: preferred, colored; next MAIN 1.318: preferred, colored
Changes since revision 1.317.2.5: +9 -0 lines
SVN rev 227325 on 2011-11-07 23:09:18Z by pho

MFC r226967, r226971:
Added missing cache purge of from argument.

Revision 1.330: download - view: text, markup, annotated - select for diffs
Mon Oct 31 20:24:33 2011 UTC (3 months, 1 week ago) by pho
Branches: MAIN
Diff to: previous 1.329: preferred, colored
Changes since revision 1.329: +2 -0 lines
SVN rev 226971 on 2011-10-31 20:24:33Z by pho

Fix the wrong commit log message for r226967: "Added missing cache purge
of from argument" and fix the comment.

Revision 1.329: download - view: text, markup, annotated - select for diffs
Mon Oct 31 15:01:47 2011 UTC (3 months, 1 week ago) by pho
Branches: MAIN
Diff to: previous 1.328: preferred, colored
Changes since revision 1.328: +7 -0 lines
SVN rev 226967 on 2011-10-31 15:01:47Z by pho

The kern_renameat() looks up the fvp using the DELETE flag, which causes
the removal of the name cache entry for fvp.

Reported by:	Anton Yuzhaninov <citrin citrin ru>
In collaboration with:	kib
MFC after:	1 week

Revision 1.328.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
Diff to: previous 1.328: preferred, colored
Changes since revision 1.328: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.328: download - view: text, markup, annotated - select for diffs
Sun Jun 12 19:27:05 2011 UTC (7 months, 4 weeks ago) by mckusick
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.327: preferred, colored
Changes since revision 1.327: +8 -0 lines
SVN rev 223020 on 2011-06-12 19:27:05Z by mckusick

Update to soft updates journaling to properly track freed blocks
that get claimed by snapshots.

Submitted by:	Jeff Roberson
Tested by:	Peter Holm

Revision 1.317.2.5: download - view: text, markup, annotated - select for diffs
Sun Apr 24 11:01:42 2011 UTC (9 months, 2 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.317.2.4: preferred, colored; branchpoint 1.317: preferred, colored
Changes since revision 1.317.2.4: +320 -231 lines
SVN rev 220986 on 2011-04-24 11:01:42Z by kib

Merge the part of r207141 that fixes the locking for ufs_rename() (and
r218838 followup).

Adopt the SU calls to the stable/8 SU implementation, with the help from
Kirk.

PR:	kern/156545
Reviewed by:	mckusick
Tested by:	pho

Revision 1.327: download - view: text, markup, annotated - select for diffs
Sat Feb 19 07:47:25 2011 UTC (11 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.326: preferred, colored
Changes since revision 1.326: +3 -1 lines
SVN rev 218838 on 2011-02-19 07:47:25Z by kib

v_mountedhere is a member of the union. Check that the vnodes have
proper type before using the member.

Reported and tested by:	Michael Butler <imb protected-networks net>

Revision 1.326: download - view: text, markup, annotated - select for diffs
Thu Feb 10 08:06:56 2011 UTC (11 months, 4 weeks ago) by netchild
Branches: MAIN
Diff to: previous 1.325: preferred, colored
Changes since revision 1.325: +2 -1 lines
SVN rev 218513 on 2011-02-10 08:06:56Z by netchild

Wrap long line.

Noticed by:	bz

Revision 1.325: download - view: text, markup, annotated - select for diffs
Wed Feb 9 15:33:13 2011 UTC (12 months ago) by netchild
Branches: MAIN
Diff to: previous 1.324: preferred, colored
Changes since revision 1.324: +11 -0 lines
SVN rev 218485 on 2011-02-09 15:33:13Z by netchild

Add some FEATURE macros for some UFS features.

SU+J is not included as a FEATURE macro:
 - it was not in the tree during the GSoC
 - I do not see an option to en-/disable it in NOTES

Two minor changes where made during the review compared to what was developed
during GSoC 2010.

No FreeBSD version bump, the userland application to query the features will
be committed last and can serve as an indication of the availablility if
needed.

Sponsored by:	Google Summer of Code 2010
Submitted by:	kibab
Reviewed by:	kib
X-MFC after:	to be determined in last commit with code from this project

Revision 1.324: download - view: text, markup, annotated - select for diffs
Thu Dec 30 10:52:07 2010 UTC (13 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.323: preferred, colored
Changes since revision 1.323: +3 -1 lines
SVN rev 216818 on 2010-12-30 10:52:07Z by kib

Handle missing jremrefs when a directory is renamed overtop of
another, deleting it.  If the directory is removed, UFS always need to
remove the .. ref, even if the ultimate ref on the parent would not
change. The new directory must have a new journal entry for that ref.
Otherwise journal processing would not properly account for the
parent's reference since it will belong to a removed directory entry.

Change ufs_rename()'s dotdot rename section to always
setup_dotdot_link(). In the tip != NULL case SUJ needs the newref dependency
allocated via setup_dotdot_link().

Stop setting isrmdir to 2 for newdirrem() in softdep_setup_remove().
Remove the isdirrem > 1 checks from newdirrem().

Reported by:	many
Submitted by:	jeff
Tested by:	pho

Revision 1.291.2.11.4.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.291.2.11: preferred, colored; next MAIN 1.292: preferred, colored
Changes since revision 1.291.2.11: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.317.2.4.4.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.317.2.4: preferred, colored; next MAIN 1.317.2.5: preferred, colored
Changes since revision 1.317.2.4: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.323: download - view: text, markup, annotated - select for diffs
Tue Nov 9 20:41:10 2010 UTC (15 months ago) by jhb
Branches: MAIN
Diff to: previous 1.322: preferred, colored
Changes since revision 1.322: +0 -2 lines
SVN rev 215052 on 2010-11-09 20:41:10Z by jhb

Remove unused includes of <sys/mutex.h> and <machine/mutex.h>.

Revision 1.322: download - view: text, markup, annotated - select for diffs
Tue Jul 6 07:11:04 2010 UTC (19 months ago) by jeff
Branches: MAIN
Diff to: previous 1.321: preferred, colored
Changes since revision 1.321: +12 -20 lines
SVN rev 209717 on 2010-07-06 07:11:04Z by jeff

 - Handle the truncation of an inode with an effective link count of 0 in
   the context of the process that reduced the effective count.  Previously
   all truncation as a result of unlink happened in the softdep flush
   thread.  This had the effect of being impossible to rate limit properly
   with the journal code.  Now the process issuing unlinks is suspended
   when the journal files.  This has a side-effect of improving rm
   performance by allowing more concurrent work.
 - Handle two cases in inactive, one for effnlink == 0 and another when
   nlink finally reaches 0.
 - Eliminate the SPACECOUNTED related code since the truncation is no
   longer delayed.

Discussed with:	mckusick

Revision 1.317.2.4.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 3 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.317.2.4: preferred, colored; next MAIN 1.317.2.5: preferred, colored
Changes since revision 1.317.2.4: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.321: download - view: text, markup, annotated - select for diffs
Sat Apr 24 07:05:35 2010 UTC (21 months, 2 weeks ago) by jeff
Branches: MAIN
Diff to: previous 1.320: preferred, colored
Changes since revision 1.320: +339 -250 lines
SVN rev 207141 on 2010-04-24 07:05:35Z by jeff

 - Merge soft-updates journaling from projects/suj/head into head.  This
   brings in support for an optional intent log which eliminates the need
   for background fsck on unclean shutdown.

Sponsored by:   iXsystems, Yahoo!, and Juniper.
With help from: McKusick and Peter Holm

Revision 1.317.2.4: download - view: text, markup, annotated - select for diffs
Sun Apr 18 20:34:46 2010 UTC (21 months, 3 weeks ago) by trasz
Branches: RELENG_8
CVS tags: RELENG_8_2_BP, RELENG_8_1_BP
Branch point for: RELENG_8_2, RELENG_8_1
Diff to: previous 1.317.2.3: preferred, colored; branchpoint 1.317: preferred, colored
Changes since revision 1.317.2.3: +171 -186 lines
SVN rev 206809 on 2010-04-18 20:34:46Z by trasz

MFC r202934:

Move out code that does POSIX.1e ACL inheritance into separate routines.

Reviewed by:	rwatson

Revision 1.317.2.3: download - view: text, markup, annotated - select for diffs
Sun Apr 18 19:21:08 2010 UTC (21 months, 3 weeks ago) by trasz
Branches: RELENG_8
Diff to: previous 1.317.2.2: preferred, colored; branchpoint 1.317: preferred, colored
Changes since revision 1.317.2.2: +157 -31 lines
SVN rev 206804 on 2010-04-18 19:21:08Z by trasz

MFC r200796:

Implement NFSv4 ACL support for UFS.

Reviewed by:	rwatson

Revision 1.291.2.11.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (23 months, 4 weeks ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.291.2.11: preferred, colored; next MAIN 1.292: preferred, colored
Changes since revision 1.291.2.11: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.320: download - view: text, markup, annotated - select for diffs
Sun Jan 24 15:12:27 2010 UTC (2 years ago) by trasz
Branches: MAIN
Diff to: previous 1.319: preferred, colored
Changes since revision 1.319: +171 -186 lines
SVN rev 202934 on 2010-01-24 15:12:27Z by trasz

Move out code that does POSIX.1e ACL inheritance into separate routines.

Reviewed by:	rwatson

Revision 1.319: download - view: text, markup, annotated - select for diffs
Mon Dec 21 19:39:10 2009 UTC (2 years, 1 month ago) by trasz
Branches: MAIN
Diff to: previous 1.318: preferred, colored
Changes since revision 1.318: +157 -31 lines
SVN rev 200796 on 2009-12-21 19:39:10Z by trasz

Implement NFSv4 ACL support for UFS.

Reviewed by:	rwatson

Revision 1.317.2.2.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.317.2.2: preferred, colored; next MAIN 1.317.2.3: preferred, colored
Changes since revision 1.317.2.2: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.317.2.2: download - view: text, markup, annotated - select for diffs
Thu Sep 24 21:32:56 2009 UTC (2 years, 4 months ago) by brooks
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.317.2.1: preferred, colored; branchpoint 1.317: preferred, colored
Changes since revision 1.317.2.1: +2 -0 lines
SVN rev 197473 on 2009-09-24 21:32:56Z by brooks

MFC r197269:
Allocate space for the group array in a static credential used in
the quota code.  One case was correctly handled in r194498, but
this one was missed.

PR:		kern/138657
Tested by:	PR submitter
MFC after:	3 days
Approved by:	re@ (kib)

Revision 1.318: download - view: text, markup, annotated - select for diffs
Thu Sep 17 12:35:13 2009 UTC (2 years, 4 months ago) by brooks
Branches: MAIN
Diff to: previous 1.317: preferred, colored
Changes since revision 1.317: +2 -0 lines
SVN rev 197269 on 2009-09-17 12:35:13Z by brooks

Allocate space for the group array in a static credential used in
the quota code.  One case was correctly handled in r194498, but
this one was missed.

PR:		kern/138657
Tested by:	PR submitter
MFC after:	3 days

Revision 1.317.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
Diff to: previous 1.317: preferred, colored
Changes since revision 1.317: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.317: download - view: text, markup, annotated - select for diffs
Thu Jul 2 20:05:21 2009 UTC (2 years, 7 months ago) by trasz
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.316: preferred, colored
Changes since revision 1.316: +25 -0 lines
SVN rev 195296 on 2009-07-02 20:05:21Z by trasz

Fix fpathconf(3) on fifos, in effect making ls(1) properly
display '+' on them.  Taken from kern/125613, with cosmetic
changes.

PR:		kern/125613
Submitted by:	Jaakko Heinonen <jh at saunalahti dot fi>
Approved by:	re (kib)

Revision 1.291.2.11: download - view: text, markup, annotated - select for diffs
Tue Jun 23 10:59:59 2009 UTC (2 years, 7 months ago) by kib
Branches: RELENG_7
CVS tags: RELENG_7_4_BP, RELENG_7_3_BP
Branch point for: RELENG_7_4, RELENG_7_3
Diff to: previous 1.291.2.10: preferred, colored; branchpoint 1.291: preferred, colored; next MAIN 1.292: preferred, colored
Changes since revision 1.291.2.10: +1 -1 lines
SVN rev 194696 on 2009-06-23 10:59:59Z by kib

MFC r194296:
Do not use casts (int *)0 and (struct thread *)0 for the arguments of
vn_rdwr, use NULL.

Revision 1.316: download - view: text, markup, annotated - select for diffs
Fri Jun 19 17:10:35 2009 UTC (2 years, 7 months ago) by brooks
Branches: MAIN
Diff to: previous 1.315: preferred, colored
Changes since revision 1.315: +2 -0 lines
SVN rev 194498 on 2009-06-19 17:10:35Z by brooks

Rework the credential code to support larger values of NGROUPS and
NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024
and 1023 respectively.  (Previously they were equal, but under a close
reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it
is the number of supplemental groups, not total number of groups.)

The bulk of the change consists of converting the struct ucred member
cr_groups from a static array to a pointer.  Do the equivalent in
kinfo_proc.

Introduce new interfaces crcopysafe() and crsetgroups() for duplicating
a process credential before modifying it and for setting group lists
respectively.  Both interfaces take care for the details of allocating
groups array. crsetgroups() takes care of truncating the group list
to the current maximum (NGROUPS) if necessary.  In the future,
crsetgroups() may be responsible for insuring invariants such as sorting
the supplemental groups to allow groupmember() to be implemented as a
binary search.

Because we can not change struct xucred without breaking application
ABIs, we leave it alone and introduce a new XU_NGROUPS value which is
always 16 and is to be used or NGRPS as appropriate for things such as
NFS which need to use no more than 16 groups.  When feasible, truncate
the group list rather than generating an error.

Minor changes:
  - Reduce the number of hand rolled versions of groupmember().
  - Do not assign to both cr_gid and cr_groups[0].
  - Modify ipfw to cache ucreds instead of part of their contents since
    they are immutable once referenced by more than one entity.

Submitted by:	Isilon Systems (initial implementation)
X-MFC after:	never
PR:		bin/113398 kern/133867

Revision 1.315: download - view: text, markup, annotated - select for diffs
Tue Jun 16 15:13:45 2009 UTC (2 years, 7 months ago) by kib
Branches: MAIN
Diff to: previous 1.314: preferred, colored
Changes since revision 1.314: +1 -1 lines
SVN rev 194296 on 2009-06-16 15:13:45Z by kib

Do not use casts (int *)0 and (struct thread *)0 for the arguments of
vn_rdwr, use NULL.

Reviewed by:	jhb
MFC after:	1 week

Revision 1.314: download - view: text, markup, annotated - select for diffs
Fri Jun 5 14:55:22 2009 UTC (2 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.313: preferred, colored
Changes since revision 1.313: +0 -1 lines
SVN rev 193511 on 2009-06-05 14:55:22Z by rwatson

Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC
and used in a large number of files, but also because an increasing number
of incorrect uses of MAC calls were sneaking in due to copy-and-paste of
MAC-aware code without the associated opt_mac.h include.

Discussed with:	pjd

Revision 1.313: download - view: text, markup, annotated - select for diffs
Wed May 27 14:11:23 2009 UTC (2 years, 8 months ago) by jamie
Branches: MAIN
Diff to: previous 1.312: preferred, colored
Changes since revision 1.312: +0 -1 lines
SVN rev 192895 on 2009-05-27 14:11:23Z by jamie

Add hierarchical jails.  A jail may further virtualize its environment
by creating a child jail, which is visible to that jail and to any
parent jails.  Child jails may be restricted more than their parents,
but never less.  Jail names reflect this hierarchy, being MIB-style
dot-separated strings.

Every thread now points to a jail, the default being prison0, which
contains information about the physical system.  Prison0's root
directory is the same as rootvnode; its hostname is the same as the
global hostname, and its securelevel replaces the global securelevel.
Note that the variable "securelevel" has actually gone away, which
should not cause any problems for code that properly uses
securelevel_gt() and securelevel_ge().

Some jail-related permissions that were kept in global variables and
set via sysctls are now per-jail settings.  The sysctls still exist for
backward compatibility, used only by the now-deprecated jail(2) system
call.

Approved by:	bz (mentor)

Revision 1.291.2.10: download - view: text, markup, annotated - select for diffs
Sat May 16 17:22:03 2009 UTC (2 years, 8 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.291.2.9: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.9: +3 -1 lines
SVN rev 192201 on 2009-05-16 17:22:03Z by kib

MFC r191315:
In ufs_checkpath(), recheck that '..' still points to the inode with
the same inode number after VFS_VGET() and relock of the vp. If '..'
changed, redo the lookup.

Supply the source inode number as an argument to ufs_checkpath() instead
of the source inode itself.

Revision 1.312: download - view: text, markup, annotated - select for diffs
Mon Apr 27 16:46:16 2009 UTC (2 years, 9 months ago) by rmacklem
Branches: MAIN
Diff to: previous 1.311: preferred, colored
Changes since revision 1.311: +3 -3 lines
SVN rev 191564 on 2009-04-27 16:46:16Z by rmacklem

 	Change the semantics of i_modrev/va_filerev to what is required for
 	the nfsv4 Change attribute. There are 2 changes:
 	1 - The value now changes on metadata changes as well as data
 	    modifications (incremented for IN_CHANGE instead of IN_UPDATE).
 	2 - It is now saved in spare space in the on-disk i-node so that it
 	    survives a crash.
 	Since va_filerev is not passed out into user space, the only current
 	use of va_filerev is in the nfs server, which uses it as the directory
 	cookie verifier. Since this verifier is only passed back to the server
 	by a client verbatim and then the server doesn't check it, changing the
 	semantics should not break anything currently in FreeBSD.

Reviewed by:	bde
Approved by:	kib (mentor)

Revision 1.311: download - view: text, markup, annotated - select for diffs
Mon Apr 20 14:36:01 2009 UTC (2 years, 9 months ago) by kib
Branches: MAIN
Diff to: previous 1.310: preferred, colored
Changes since revision 1.310: +3 -1 lines
SVN rev 191315 on 2009-04-20 14:36:01Z by kib

In ufs_checkpath(), recheck that '..' still points to the inode with
the same inode number after VFS_VGET() and relock of the vp. If '..'
changed, redo the lookup. To reduce code duplication, move the code to
read '..' dirent into the static helper function ufs_dir_dd_ino().

Supply the source inode number as an argument to ufs_checkpath() instead
of the source inode itself. The inode is unlocked, thus it might be
reclaimed, causing accesses to the freed memory.

Use vn_vget_ino() to get the '..' vnode by its inode number, instead of
directly code VFS_VGET() and relock, to properly busy the mount point
while vp lock is dropped.

Noted and reviewed by:	tegge
Tested by:	pho
MFC after:	1 month

Revision 1.310: download - view: text, markup, annotated - select for diffs
Sat Apr 18 16:47:33 2009 UTC (2 years, 9 months ago) by trasz
Branches: MAIN
Diff to: previous 1.309: preferred, colored
Changes since revision 1.309: +19 -19 lines
SVN rev 191249 on 2009-04-18 16:47:33Z by trasz

Use acl_alloc() and acl_free() instead of using uma(9) directly.
This will make switching to malloc(9) easier; also, it would be
neccessary to add these routines if/when we implement variable-size
ACLs.

Revision 1.291.2.9.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.291.2.9: preferred, colored; next MAIN 1.291.2.10: preferred, colored
Changes since revision 1.291.2.9: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.291.2.9: download - view: text, markup, annotated - select for diffs
Sun Mar 1 11:02:37 2009 UTC (2 years, 11 months ago) by trasz
Branches: RELENG_7
CVS tags: RELENG_7_2_BP
Branch point for: RELENG_7_2
Diff to: previous 1.291.2.8: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.8: +1 -1 lines
SVN rev 189226 on 2009-03-01 11:02:37Z by trasz

MFC r186194:

According to phk@, VOP_STRATEGY should never, _ever_, return
anything other than 0.  Make it so.  This fixes
"panic: VOP_STRATEGY failed bp=0xc320dd90 vp=0xc3b9f648",
encountered when writing to an orphaned filesystem.  Reason
for the panic was the following assert:
KASSERT(i == 0, ("VOP_STRATEGY failed bp=%p vp=%p", bp, bp->b_vp));
at vfs_bio:bufstrategy().

Reviewed by:	scottl, phk
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation

Revision 1.291.2.8: download - view: text, markup, annotated - select for diffs
Sat Feb 14 21:12:58 2009 UTC (2 years, 11 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.291.2.7: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.7: +1 -1 lines
SVN rev 188614 on 2009-02-14 21:12:58Z by kib

MFC r183070:
When downgrading the read-write mount to read-only, do_unmount() sets
MNT_RDONLY flag before the VFS_MOUNT() is called. In ufs_inactive()
and ufs_itimes_locked(), UFS verifies whether the fs is read-only by
checking MNT_RDONLY, but this may cause loss of the IN_MODIFIED flag
for inode on the fs being remounted rw->ro.

Introduce UFS_RDONLY() struct ufsmount' method that reports the value
of the fs_ronly. The later is set to 1 only after the remount is
finished.

Revision 1.309: download - view: text, markup, annotated - select for diffs
Wed Jan 21 20:08:17 2009 UTC (3 years ago) by jhb
Branches: MAIN
Diff to: previous 1.308: preferred, colored
Changes since revision 1.308: +2 -2 lines
SVN rev 187564 on 2009-01-21 20:08:17Z by jhb

Fix a few style bogons.

Submitted by:	bde

Revision 1.291.2.7: download - view: text, markup, annotated - select for diffs
Wed Jan 21 15:51:15 2009 UTC (3 years ago) by kib
Branches: RELENG_7
Diff to: previous 1.291.2.6: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.6: +0 -2 lines
SVN rev 187534 on 2009-01-21 15:51:15Z by kib

MFC r183211:
Initialize birthtime fields in vn_stat() to prevent stat(2) from
returning uninitialized birthtime. Most file systems don't initialize
birthtime properly in their VOP_GETTATTR().

MFC r183212:
Initialize va_flags and va_filerev properly in VOP_GETATTR(). Don't
initialize va_vaflags and va_spare because they are not part of the
VOP_GETATTR() API. Also don't initialize birthtime to ctime or zero.

MFC rr183213:
Initialize va_rdev to NODEV and va_fsid to VNOVAL before the
VOP_GETATTR() call in vn_stat(). Thus if a file system doesn't
initialize those fields in VOP_GETATTR() they will have a sane default
value.

MFC r183214:
Initialize va_rdev to NODEV instead of 0 or VNOVAL in VOP_GETATTR().
NODEV is more appropriate when va_rdev doesn't have a meaningful value.

MFC r183215:
fdescfs, devfs, mqueuefs, nfs, portalfs, pseudofs, tmpfs and xfs
initialize the vattr structure in VOP_GETATTR() with VATTR_NULL(),
vattr_null() or by zeroing it. Remove these to allow preinitialization
of fields work in vn_stat(). This is needed to get birthtime initialized
correctly.

Revision 1.308: download - view: text, markup, annotated - select for diffs
Wed Jan 21 14:42:00 2009 UTC (3 years ago) by jhb
Branches: MAIN
Diff to: previous 1.307: preferred, colored
Changes since revision 1.307: +22 -11 lines
SVN rev 187526 on 2009-01-21 14:42:00Z by jhb

Move the VA_MARKATIME flag for VOP_SETATTR() out into its own VOP:
VOP_MARKATIME() since unlike the rest of VOP_SETATTR(), VA_MARKATIME
can be performed while holding a shared vnode lock (the same functionality
is done internally by VOP_READ which can run with a shared vnode lock).
Add missing locking of the vnode interlock to the ufs implementation and
remove a special note and test from the NFS client about not supporting the
feature.

Inspired by:	ups
Tested by:	pho

Revision 1.307: download - view: text, markup, annotated - select for diffs
Tue Dec 16 21:13:11 2008 UTC (3 years, 1 month ago) by trasz
Branches: MAIN
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +1 -1 lines
SVN rev 186194 on 2008-12-16 21:13:11Z by trasz

According to phk@, VOP_STRATEGY should never, _ever_, return
anything other than 0.  Make it so.  This fixes
"panic: VOP_STRATEGY failed bp=0xc320dd90 vp=0xc3b9f648",
encountered when writing to an orphaned filesystem.  Reason
for the panic was the following assert:
KASSERT(i == 0, ("VOP_STRATEGY failed bp=%p vp=%p", bp, bp->b_vp));
at vfs_bio:bufstrategy().

Reviewed by:	scottl, phk
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation

Revision 1.291.2.6.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.291.2.6: preferred, colored; next MAIN 1.291.2.7: preferred, colored
Changes since revision 1.291.2.6: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.291.2.6: download - view: text, markup, annotated - select for diffs
Mon Nov 3 14:35:43 2008 UTC (3 years, 3 months ago) by kib
Branches: RELENG_7
CVS tags: RELENG_7_1_BP
Branch point for: RELENG_7_1
Diff to: previous 1.291.2.5: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.5: +11 -0 lines
SVN rev 184593 on 2008-11-03 14:35:43Z by kib

MFC r184408:
Provide an explanation for getinoquota() call in the ufs_access vop.

Approved by:	re (kensmith)

Revision 1.306: download - view: text, markup, annotated - select for diffs
Tue Oct 28 13:44:11 2008 UTC (3 years, 3 months ago) by trasz
Branches: MAIN
Diff to: previous 1.305: preferred, colored
Changes since revision 1.305: +8 -8 lines
SVN rev 184413 on 2008-10-28 13:44:11Z by trasz

Introduce accmode_t.  This is required for NFSv4 ACLs - it will be neccessary
to add more V* constants, and the variables changed by this patch were often
being assigned to mode_t variables, which is 16 bit.

Approved by:	rwatson (mentor)

Revision 1.305: download - view: text, markup, annotated - select for diffs
Tue Oct 28 12:00:28 2008 UTC (3 years, 3 months ago) by kib
Branches: MAIN
Diff to: previous 1.304: preferred, colored
Changes since revision 1.304: +11 -0 lines
SVN rev 184408 on 2008-10-28 12:00:28Z by kib

Provide an explanation for getinoquota() call in the ufs_access vop.

MFC after:	3 days

Revision 1.304: download - view: text, markup, annotated - select for diffs
Thu Oct 23 15:53:51 2008 UTC (3 years, 3 months ago) by des
Branches: MAIN
Diff to: previous 1.303: preferred, colored
Changes since revision 1.303: +3 -3 lines
SVN rev 184205 on 2008-10-23 15:53:51Z by des

Retire the MALLOC and FREE macros.  They are an abomination unto style(9).

MFC after:	3 months

Revision 1.271.2.15.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.271.2.15: preferred, colored; next MAIN 1.272: preferred, colored
Changes since revision 1.271.2.15: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.271.2.15: download - view: text, markup, annotated - select for diffs
Tue Sep 23 15:58:41 2008 UTC (3 years, 4 months ago) by jhb
Branches: RELENG_6
CVS tags: RELENG_6_4_BP
Branch point for: RELENG_6_4
Diff to: previous 1.271.2.14: preferred, colored; branchpoint 1.271: preferred, colored; next MAIN 1.272: preferred, colored
Changes since revision 1.271.2.14: +2 -3 lines
SVN rev 183301 on 2008-09-23 15:58:41Z by jhb

MFC: Fix vnode interlocking in QUOTA lock upgrade case in ufs_access().

Approved by:	re (kib)

Revision 1.291.2.5: download - view: text, markup, annotated - select for diffs
Tue Sep 23 15:57:39 2008 UTC (3 years, 4 months ago) by jhb
Branches: RELENG_7
Diff to: previous 1.291.2.4: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.4: +2 -3 lines
SVN rev 183300 on 2008-09-23 15:57:39Z by jhb

MFC: Fix vnode interlocking in QUOTA lock upgrade case in ufs_access().

Approved by:	re (kib)

Revision 1.303: download - view: text, markup, annotated - select for diffs
Sat Sep 20 19:46:45 2008 UTC (3 years, 4 months ago) by kib
Branches: MAIN
Diff to: previous 1.302: preferred, colored
Changes since revision 1.302: +0 -2 lines
SVN rev 183212 on 2008-09-20 19:46:45Z by kib

Initialize va_flags and va_filerev properly in VOP_GETATTR(). Don't
initialize va_vaflags and va_spare because they are not part of the
VOP_GETATTR() API. Also don't initialize birthtime to ctime or zero.

Submitted by:   Jaakko Heinonen <jh saunalahti fi>
Reviewed by:	bde
Discussed on:   freebsd-fs
MFC after:	1 month

Revision 1.302: download - view: text, markup, annotated - select for diffs
Tue Sep 16 16:15:38 2008 UTC (3 years, 4 months ago) by jhb
Branches: MAIN
Diff to: previous 1.301: preferred, colored
Changes since revision 1.301: +2 -3 lines
SVN rev 183078 on 2008-09-16 16:15:38Z by jhb

vdropl() drops the vnode interlock.  Thus, the code in the QUOTA case that
upgrades the vnode lock if it is share locked was dropping the interlock
before actually checking VI_DOOMED.  Fix this by do the vdropl() after the
check and relying on it to drop the vnode interlock.

Reported by:	pho
Reviewed by:	kib
MFC after:	1 week

Revision 1.301: download - view: text, markup, annotated - select for diffs
Tue Sep 16 10:59:35 2008 UTC (3 years, 4 months ago) by kib
Branches: MAIN
Diff to: previous 1.300: preferred, colored
Changes since revision 1.300: +1 -1 lines
SVN rev 183070 on 2008-09-16 10:59:35Z by kib

When downgrading the read-write mount to read-only, do_unmount() sets
MNT_RDONLY flag before the VFS_MOUNT() is called. In ufs_inactive()
and ufs_itimes_locked(), UFS verifies whether the fs is read-only by
checking MNT_RDONLY, but this may cause loss of the IN_MODIFIED flag
for inode on the fs being remounted rw->ro.

Introduce UFS_RDONLY() struct ufsmount' method that reports the value
of the fs_ronly. The later is set to 1 only after the remount is
finished.

Reviewed by:	tegge
In collaboration with:	pho
MFC after:	 1 month

Revision 1.271.2.14: download - view: text, markup, annotated - select for diffs
Sun Aug 31 20:03:46 2008 UTC (3 years, 5 months ago) by kib
Branches: RELENG_6
Diff to: previous 1.271.2.13: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.13: +25 -0 lines
SVN rev 182567 on 2008-08-31 20:03:46Z by kib

MFC r182111:
Revert the r167541: "Remove unneeded getinoquota() call in the
ufs_access()." The call to getinoquota in ufs_access() serves the
purpose of instantiating inode dquot from the vn_open(). Since quotas
are accounted only for the inodes with already attached dquot, removal
of the call prevented opened inodes from participation in the quota
calculations.

Since ufs_access() may be called with the vnode being only shared
locked, upgrade (and then downgrade) vnode lock if calling
getinoquota().

MFC r182115:
Put the relocked variable from  the r182111 into the #ifdef QUOTA braces
to prevent warning about unused var on the !QUOTA kernels.

Revision 1.291.2.4: download - view: text, markup, annotated - select for diffs
Sun Aug 31 09:45:04 2008 UTC (3 years, 5 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.291.2.3: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.3: +25 -0 lines
SVN rev 182525 on 2008-08-31 09:45:04Z by kib

MFC r182111:
Revert the r167541: "Remove unneeded getinoquota() call in the
ufs_access()." The call to getinoquota in ufs_access() serves the
purpose of instantiating inode dquot from the vn_open(). Since quotas
are accounted only for the inodes with already attached dquot, removal
of the call prevented opened inodes from participation in the quota
calculations.

Since ufs_access() may be called with the vnode being only shared
locked, upgrade (and then downgrade) vnode lock if calling
getinoquota().

MFC r182115:
Put the relocked variable from  the r182111 into the #ifdef QUOTA braces
to prevent warning about unused var on the !QUOTA kernels.

Revision 1.300: download - view: text, markup, annotated - select for diffs
Thu Aug 28 15:23:18 2008 UTC (3 years, 5 months ago) by attilio
Branches: MAIN
Diff to: previous 1.299: preferred, colored
Changes since revision 1.299: +1 -3 lines
SVN rev 182371 on 2008-08-28 15:23:18Z by attilio

Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed thread
was always curthread and totally unuseful.

Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>

Revision 1.299: download - view: text, markup, annotated - select for diffs
Sun Aug 24 19:06:19 2008 UTC (3 years, 5 months ago) by kib
Branches: MAIN
Diff to: previous 1.298: preferred, colored
Changes since revision 1.298: +4 -1 lines
SVN rev 182115 on 2008-08-24 19:06:19Z by kib

Put the relocked variable from  the r182111 into the #ifdef QUOTA braces
to prevent warning about unused var on the !QUOTA kernels.

Reported by:	ed
MFC after:	1 week

Revision 1.298: download - view: text, markup, annotated - select for diffs
Sun Aug 24 17:24:22 2008 UTC (3 years, 5 months ago) by kib
Branches: MAIN
Diff to: previous 1.297: preferred, colored
Changes since revision 1.297: +23 -1 lines
SVN rev 182111 on 2008-08-24 17:24:22Z by kib

Revert the r167541: "Remove unneeded getinoquota() call in the
ufs_access()." The call to getinoquota in ufs_access() serves the
purpose of instantiating inode dquot from the vn_open(). Since quotas
are accounted only for the inodes with already attached dquot, removal
of the call prevented opened inodes from participation in the quota
calculations.

Since ufs_access() may be called with the vnode being only shared
locked, upgrade (and then downgrade) vnode lock if calling
getinoquota().

Reported by:	simon at optinet com
In collaboration with:	pho
MFC after:	1 week

Revision 1.291.2.3: download - view: text, markup, annotated - select for diffs
Fri Aug 1 09:46:19 2008 UTC (3 years, 6 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.291.2.2: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.2: +0 -41 lines
SVN rev 181119 on 2008-08-01 09:46:19Z by kib

MFC r178243:
Move the head of byte-level advisory lock list from the
filesystem-specific vnode data to the struct vnode. Provide the
default implementation for the vop_advlock and vop_advlockasync.
Purge the locks on the vnode reclaim by using the lf_purgelocks().
The default implementation is augmented for the nfs and smbfs.
In the nfs_advlock, push the Giant inside the nfs_dolock.

Before the change, the vop_advlock and vop_advlockasync have taken the
unlocked vnode and dereferenced the fs-private inode data, racing with
with the vnode reclamation due to forced unmount. Now, the vop_getattr
under the shared vnode lock is used to obtain the inode size, and
later, in the lf_advlockasync, after locking the vnode interlock, the
VI_DOOMED flag is checked to prevent an operation on the doomed vnode.

MFC r178247:
Fix compilation with LOCKF_DEBUG.

As was announced on the stable@, the MFC changes the VFS KBI on RELENG_7.

Approved by:	re (kensmith)

Revision 1.271.2.13: download - view: text, markup, annotated - select for diffs
Sat May 17 12:46:24 2008 UTC (3 years, 8 months ago) by kib
Branches: RELENG_6
Diff to: previous 1.271.2.12: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.12: +0 -4 lines
MFC the MPSAFE quotas.

kern/vfs_syscalls.c rev. 1.433:
Busy filesystem around call of VFS_QUOTACTL() vfs op.

ufs/ffs/ffs_softdep.c remaining parts of the rev. 1.206 after 1.181.2.24:
Replace unconditional acquision of Giant when QUOTAS are defined with
VFS_LOCK_GIANT(NULL) call.

ufs/ffs/ffs_vfsops.c rev. 1.327, 1.328
rev. 1.327: Implement fine-grained locking for UFS quotas.
rev. 1.328: Mark UFS as being MP-Safe in "options QUOTA" case too.

ufs/ufs/quota.h remaining parts of the rev. 1.30 after 1.27.2.3:
Implement fine-grained locking for UFS quotas.

ufs/ufs/ufs_lookup.c rev. 1.83:
Call getinoquota() before allocating new block for the directory to properly
account for block allocation.

ufs/ufs/ufs_quota.c rev. 1.93:
Implement fine-grained locking for UFS quotas.

ufs/ufs/ufs_vnops.c rev. 1.289:
Remove unneeded getinoquota() call in the ufs_access().

Revision 1.271.2.12: download - view: text, markup, annotated - select for diffs
Thu Apr 24 10:46:23 2008 UTC (3 years, 9 months ago) by dfr
Branches: RELENG_6
Diff to: previous 1.271.2.11: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.11: +21 -0 lines
MFC: kernel-mode NFS lock manager.

Revision 1.297: download - view: text, markup, annotated - select for diffs
Wed Apr 16 11:33:32 2008 UTC (3 years, 9 months ago) by kib
Branches: MAIN
Diff to: previous 1.296: preferred, colored
Changes since revision 1.296: +0 -41 lines
Move the head of byte-level advisory lock list from the
filesystem-specific vnode data to the struct vnode. Provide the
default implementation for the vop_advlock and vop_advlockasync.
Purge the locks on the vnode reclaim by using the lf_purgelocks().
The default implementation is augmented for the nfs and smbfs.
In the nfs_advlock, push the Giant inside the nfs_dolock.

Before the change, the vop_advlock and vop_advlockasync have taken the
unlocked vnode and dereferenced the fs-private inode data, racing with
with the vnode reclamation due to forced unmount. Now, the vop_getattr
under the shared vnode lock is used to obtain the inode size, and
later, in the lf_advlockasync, after locking the vnode interlock, the
VI_DOOMED flag is checked to prevent an operation on the doomed vnode.

The implementation of the lf_purgelocks() is submitted by dfr.

Reported by:	kris
Tested by:	kris, pho
Discussed with:	jeff, dfr
MFC after:	2 weeks

Revision 1.291.2.2: download - view: text, markup, annotated - select for diffs
Thu Apr 10 09:39:28 2008 UTC (3 years, 10 months ago) by dfr
Branches: RELENG_7
Diff to: previous 1.291.2.1: preferred, colored; branchpoint 1.291: preferred, colored
Changes since revision 1.291.2.1: +21 -0 lines
MFC: Kernel mode Network Lock Manager.

Revision 1.296: download - view: text, markup, annotated - select for diffs
Wed Mar 26 15:23:11 2008 UTC (3 years, 10 months ago) by dfr
Branches: MAIN
Diff to: previous 1.295: preferred, colored
Changes since revision 1.295: +21 -0 lines
Add the new kernel-mode NFS Lock Manager. To use it instead of the
user-mode lock manager, build a kernel with the NFSLOCKD option and
add '-k' to 'rpc_lockd_flags' in rc.conf.

Highlights include:

* Thread-safe kernel RPC client - many threads can use the same RPC
  client handle safely with replies being de-multiplexed at the socket
  upcall (typically driven directly by the NIC interrupt) and handed
  off to whichever thread matches the reply. For UDP sockets, many RPC
  clients can share the same socket. This allows the use of a single
  privileged UDP port number to talk to an arbitrary number of remote
  hosts.

* Single-threaded kernel RPC server. Adding support for multi-threaded
  server would be relatively straightforward and would follow
  approximately the Solaris KPI. A single thread should be sufficient
  for the NLM since it should rarely block in normal operation.

* Kernel mode NLM server supporting cancel requests and granted
  callbacks. I've tested the NLM server reasonably extensively - it
  passes both my own tests and the NFS Connectathon locking tests
  running on Solaris, Mac OS X and Ubuntu Linux.

* Userland NLM client supported. While the NLM server doesn't have
  support for the local NFS client's locking needs, it does have to
  field async replies and granted callbacks from remote NLMs that the
  local client has contacted. We relay these replies to the userland
  rpc.lockd over a local domain RPC socket.

* Robust deadlock detection for the local lock manager. In particular
  it will detect deadlocks caused by a lock request that covers more
  than one blocking request. As required by the NLM protocol, all
  deadlock detection happens synchronously - a user is guaranteed that
  if a lock request isn't rejected immediately, the lock will
  eventually be granted. The old system allowed for a 'deferred
  deadlock' condition where a blocked lock request could wake up and
  find that some other deadlock-causing lock owner had beaten them to
  the lock.

* Since both local and remote locks are managed by the same kernel
  locking code, local and remote processes can safely use file locks
  for mutual exclusion. Local processes have no fairness advantage
  compared to remote processes when contending to lock a region that
  has just been unlocked - the local lock manager enforces a strict
  first-come first-served model for both local and remote lockers.

Sponsored by:	Isilon Systems
PR:		95247 107555 115524 116679
MFC after:	2 weeks

Revision 1.271.2.11: download - view: text, markup, annotated - select for diffs
Sun Mar 2 01:35:37 2008 UTC (3 years, 11 months ago) by obrien
Branches: RELENG_6
Diff to: previous 1.271.2.10: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.10: +7 -7 lines
MFC: rev 1.278: correct typo in comment.
Also sync comment layout changes and spelling fixes.

Revision 1.271.2.10: download - view: text, markup, annotated - select for diffs
Mon Feb 25 06:30:24 2008 UTC (3 years, 11 months ago) by obrien
Branches: RELENG_6
Diff to: previous 1.271.2.9: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.9: +6 -6 lines
MFC: Turn most ffs 'DIAGNOSTIC's into INVARIANTS.

Revision 1.291.2.1: download - view: text, markup, annotated - select for diffs
Fri Feb 15 16:43:03 2008 UTC (3 years, 11 months ago) by obrien
Branches: RELENG_7
Diff to: previous 1.291: preferred, colored
Changes since revision 1.291: +6 -6 lines
MFC: Turn most ffs 'DIAGNOSTIC's into INVARIANTS.

Revision 1.295: download - view: text, markup, annotated - select for diffs
Sun Jan 13 14:44:14 2008 UTC (4 years ago) by attilio
Branches: MAIN
Diff to: previous 1.294: preferred, colored
Changes since revision 1.294: +6 -6 lines
VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in
conjuction with 'thread' argument passing which is always curthread.
Remove the unuseful extra-argument and pass explicitly curthread to lower
layer functions, when necessary.

KPI results broken by this change, which should affect several ports, so
version bumping and manpage update will be further committed.

Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>

Revision 1.294: download - view: text, markup, annotated - select for diffs
Thu Jan 10 01:10:57 2008 UTC (4 years, 1 month ago) by attilio
Branches: MAIN
Diff to: previous 1.293: preferred, colored
Changes since revision 1.293: +3 -3 lines
vn_lock() is currently only used with the 'curthread' passed as argument.
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.

Manpage and FreeBSD_version will be updated through further commits.

As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.

Tested by:	Diego Sardina <siarodx at gmail dot com>,
		Andrea Di Pasquale <whyx dot it at gmail dot com>

Revision 1.293: download - view: text, markup, annotated - select for diffs
Thu Nov 8 17:21:51 2007 UTC (4 years, 3 months ago) by obrien
Branches: MAIN
Diff to: previous 1.292: preferred, colored
Changes since revision 1.292: +6 -6 lines
Turn most ffs 'DIAGNOSTIC's into INVARIANTS.

Revision 1.292: download - view: text, markup, annotated - select for diffs
Wed Oct 24 19:04:04 2007 UTC (4 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.291: preferred, colored
Changes since revision 1.291: +2 -2 lines
Merge first in a series of TrustedBSD MAC Framework KPI changes
from Mac OS X Leopard--rationalize naming for entry points to
the following general forms:

  mac_<object>_<method/action>
  mac_<object>_check_<method/action>

The previous naming scheme was inconsistent and mostly
reversed from the new scheme.  Also, make object types more
consistent and remove spaces from object types that contain
multiple parts ("posix_sem" -> "posixsem") to make mechanical
parsing easier.  Introduce a new "netinet" object type for
certain IPv4/IPv6-related methods.  Also simplify, slightly,
some entry point names.

All MAC policy modules will need to be recompiled, and modules
not updates as part of this commit will need to be modified to
conform to the new KPI.

Sponsored by:	SPARTA (original patches against Mac OS X)
Obtained from:	TrustedBSD Project, Apple Computer

Revision 1.291: download - view: text, markup, annotated - select for diffs
Tue Jun 12 00:12:01 2007 UTC (4 years, 8 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7
Diff to: previous 1.290: preferred, colored
Changes since revision 1.290: +6 -14 lines
Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); in
some cases, move to priv_check() if it was an operation on a thread and
no other flags were present.

Eliminate caller-side jail exception checking (also now-unused); jail
privilege exception code now goes solely in kern_jail.c.

We can't yet eliminate suser() due to some cases in the KAME code where
a privilege check is performed and then used in many different deferred
paths.  Do, however, move those prototypes to priv.h.

Reviewed by:	csjp
Obtained from:	TrustedBSD Project

Revision 1.290: download - view: text, markup, annotated - select for diffs
Wed May 23 11:06:09 2007 UTC (4 years, 8 months ago) by pjd
Branches: MAIN
Diff to: previous 1.289: preferred, colored
Changes since revision 1.289: +27 -20 lines
Eliminate VI_LOCK()/VI_UNLOCK() pair from getattr and close code paths.
It's hard to measure performance improvement on my test machine, but the
change won't degrade performance for sure. I can measure slight improvement
for debugging kernel and it can also be a win for machines where atomic
operation is more expensive.

Reviewed by:	kib

Revision 1.289: download - view: text, markup, annotated - select for diffs
Wed Mar 14 08:48:57 2007 UTC (4 years, 10 months ago) by kib
Branches: MAIN
Diff to: previous 1.288: preferred, colored
Changes since revision 1.288: +0 -4 lines
Remove unneeded getinoquota() call in the ufs_access().

Tested by:	Peter Holm
Reviewed by:	tegge
Approved by:	re (kensmith)

Revision 1.271.2.9: download - view: text, markup, annotated - select for diffs
Fri Mar 9 13:54:26 2007 UTC (4 years, 11 months ago) by kib
Branches: RELENG_6
CVS tags: RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3
Diff to: previous 1.271.2.8: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.8: +3 -2 lines
MFC
rev. 1.201 src/sys/kern/kern_prot.c
rev. 1.334 src/sys/kern/vfs_export.c
rev. 1.95  src/sys/nfsserver/nfs_srvsock.c
rev. 1.137 src/sys/nfsserver/nfs_srvsubs.c
rev. 1.53  src/sys/sys/ucred.h
rev. 1.273 src/sys/ufs/ufs/ufs_vnops.c

Use the refcount API to manage the reference count for user credentials
rather than using pool mutexes.

MFC changes:
The cr_mtxp field of struct ucred is preserved as padding to keep structure
size intact. nfs_srvsock.c change is nullified by rev. 1.96, that was MFCed
as rev. 1.94.2.2.

OKed by:	jhb
LOR:		187

Revision 1.288: download - view: text, markup, annotated - select for diffs
Thu Mar 1 21:44:08 2007 UTC (4 years, 11 months ago) by pjd
Branches: MAIN
Diff to: previous 1.287: preferred, colored
Changes since revision 1.287: +1 -1 lines
Change:
"... try to use VADMIN in preference to VADMIN ..."
To:
"... try to use VADMIN in preference to VWRITE ..."

Revision 1.287: download - view: text, markup, annotated - select for diffs
Thu Mar 1 20:47:41 2007 UTC (4 years, 11 months ago) by pjd
Branches: MAIN
Diff to: previous 1.286: preferred, colored
Changes since revision 1.286: +2 -1 lines
Rename PRIV_VFS_CLEARSUGID to PRIV_VFS_RETAINSUGID, which seems to better
describe the privilege.

OK'ed by:	rwatson

Revision 1.286: download - view: text, markup, annotated - select for diffs
Thu Mar 1 20:38:24 2007 UTC (4 years, 11 months ago) by pjd
Branches: MAIN
Diff to: previous 1.285: preferred, colored
Changes since revision 1.285: +5 -4 lines
Avoid checking for privileges if there is no need to.

Discussed with:	rwatson

Revision 1.271.2.8: download - view: text, markup, annotated - select for diffs
Fri Feb 23 12:27:23 2007 UTC (4 years, 11 months ago) by kib
Branches: RELENG_6
Diff to: previous 1.271.2.7: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.7: +5 -12 lines
MFC rev. 1.285:
Remove not needed acquision of the mount interlock aroung reading of
mnt_kern_flags in ufs_itimes().

Revision 1.285: download - view: text, markup, annotated - select for diffs
Thu Feb 8 09:47:19 2007 UTC (5 years ago) by kib
Branches: MAIN
Diff to: previous 1.284: preferred, colored
Changes since revision 1.284: +5 -12 lines
Remove not needed acquision of the mount interlock aroung reading of
mnt_kern_flags in ufs_itimes().

Suggested by:	ssouhlal
Confirmed by:	tegge
MFC after:	2 weeks

Revision 1.284: download - view: text, markup, annotated - select for diffs
Tue Jan 16 19:40:25 2007 UTC (5 years ago) by mpp
Branches: MAIN
Diff to: previous 1.283: preferred, colored
Changes since revision 1.283: +1 -1 lines
Fix a spelling error.  heirarchy -> hierarchy.

Obtained from:	OpenBSD

Revision 1.271.2.7: download - view: text, markup, annotated - select for diffs
Tue Nov 7 16:56:11 2006 UTC (5 years, 3 months ago) by kib
Branches: RELENG_6
CVS tags: RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2
Diff to: previous 1.271.2.6: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.6: +47 -21 lines
MFC
sys/ufs/ffs/ffs_inode.c rev. 1.107
sys/ufs/ffs/ffs_snapshot.c rev. 1.131
sys/ufs/ffs/ffs_vnops.c rev. 1.161
sys/ufs/ufs/inode.h rev. 1.51
sys/ufs/ufs/ufs_vnops.c rev. 1.280

Do not translate the IN_ACCESS inode flag into the IN_MODIFIED while filesystem
is suspending/suspended. Doing so may result in deadlock. Instead, set the
(new) IN_LAZYACCESS flag, that becomes IN_MODIFIED when suspend is lifted.

Change the locking protocol in order to set the IN_ACCESS and timestamps
without upgrading shared vnode lock to exclusive (see comments in the
inode.h). Before that, inode was modified while holding only shared
lock.

Tested on RELENG_6 by:	Peter Holm
Approved by:	re (kensmith)

Revision 1.283: download - view: text, markup, annotated - select for diffs
Mon Nov 6 13:42:09 2006 UTC (5 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.282: preferred, colored
Changes since revision 1.282: +31 -14 lines
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges.  These may
require some future tweaking.

Sponsored by:           nCircle Network Security, Inc.
Obtained from:          TrustedBSD Project
Discussed on:           arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
                        Alex Lyashkov <umka at sevcity dot net>,
                        Skip Ford <skip dot ford at verizon dot net>,
                        Antoine Brodin <antoine dot brodin at laposte dot net>

Revision 1.282: download - view: text, markup, annotated - select for diffs
Tue Oct 31 21:48:54 2006 UTC (5 years, 3 months ago) by pjd
Branches: MAIN
Diff to: previous 1.281: preferred, colored
Changes since revision 1.281: +9 -0 lines
Add gjournal specific code to the UFS file system:
- Add FS_GJOURNAL flag which enables gjournal support on a file system.
- Add cg_unrefs field to the cylinder group structure which holds
  number of unreferenced (orphaned) inodes in the given cylinder group.
- Add fs_unrefs field to the super block structure which holds
  total number of unreferenced (orphaned) inodes.
- When file or a directory is orphaned (last reference is removed, but
  object is still open), increase fs_unrefs and cg_unrefs fields,
  which is a hint for fsck in which cylinder groups looks for such
  (orphaned) objects.
- When file is last closed, decrease {fs,cg}_unrefs fields.
- Add VV_DELETED vnode flag which points at orphaned objects.

Sponsored by:	home.pl

Revision 1.281: download - view: text, markup, annotated - select for diffs
Sun Oct 22 11:52:19 2006 UTC (5 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.280: preferred, colored
Changes since revision 1.280: +2 -1 lines
Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h
begun with a repo-copy of mac.h to mac_framework.h.  sys/mac.h now
contains the userspace and user<->kernel API and definitions, with all
in-kernel interfaces moved to mac_framework.h, which is now included
across most of the kernel instead.

This change is the first step in a larger cleanup and sweep of MAC
Framework interfaces in the kernel, and will not be MFC'd.

Obtained from:	TrustedBSD Project
Sponsored by:	SPARTA

Revision 1.280: download - view: text, markup, annotated - select for diffs
Tue Oct 10 09:20:54 2006 UTC (5 years, 4 months ago) by kib
Branches: MAIN
Diff to: previous 1.279: preferred, colored
Changes since revision 1.279: +47 -21 lines
Do not translate the IN_ACCESS inode flag into the IN_MODIFIED while filesystem
is suspending/suspended. Doing so may result in deadlock. Instead, set the
(new) IN_LAZYACCESS flag, that becomes IN_MODIFIED when suspend is lifted.

Change the locking protocol in order to set the IN_ACCESS and timestamps
without upgrading shared vnode lock to exclusive (see comments in the
inode.h). Before that, inode was modified while holding only shared
lock.

Tested by:	Peter Holm
Reviewed by:	tegge, bde
Approved by:	pjd (mentor)
MFC after:	3 weeks

Revision 1.271.2.6: download - view: text, markup, annotated - select for diffs
Mon Oct 9 20:09:36 2006 UTC (5 years, 4 months ago) by tegge
Branches: RELENG_6
Diff to: previous 1.271.2.5: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.5: +2 -2 lines
MFC: Correct check for when IO_SYNC should be set for filesystem
     not using softupdates when truncating a directory to zero length.

Approved by:	re (kensmith)

Revision 1.279: download - view: text, markup, annotated - select for diffs
Mon Oct 2 02:08:31 2006 UTC (5 years, 4 months ago) by tegge
Branches: MAIN
Diff to: previous 1.278: preferred, colored
Changes since revision 1.278: +2 -2 lines
Correct check for when IO_SYNC should be set for filesystem
not using softupdates when truncating a directory to zero length.

Discussed with:	bde

Revision 1.278: download - view: text, markup, annotated - select for diffs
Sun Aug 20 10:52:44 2006 UTC (5 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +1 -1 lines
Correct typo in comment.

Revision 1.271.2.5: download - view: text, markup, annotated - select for diffs
Wed Jun 14 08:41:14 2006 UTC (5 years, 7 months ago) by maxim
Branches: RELENG_6
Diff to: previous 1.271.2.4: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.4: +17 -4 lines
MFC revs. 1.276 and 1.277 ufs_vnops.c and rev. 1.18 truncate.2:
silently ignore truncate requests for all but VREG, VLNK and VDIR.

Revision 1.277: download - view: text, markup, annotated - select for diffs
Wed May 31 15:55:52 2006 UTC (5 years, 8 months ago) by maxim
Branches: MAIN
Diff to: previous 1.276: preferred, colored
Changes since revision 1.276: +3 -8 lines
o Rearrange and remove incorrect comments.

Requested by:	bde

Revision 1.276: download - view: text, markup, annotated - select for diffs
Wed May 31 13:15:29 2006 UTC (5 years, 8 months ago) by maxim
Branches: MAIN
Diff to: previous 1.275: preferred, colored
Changes since revision 1.275: +22 -4 lines
o According to POSIX, the result of ftruncate(2) is unspecified
for file types other than VREG, VDIR and shared memory objects.
We already handle VREG, VLNK and VDIR cases.  Silently ignore
truncate requests for all the rest.  Adjust comments.

PR:		kern/98064
Submitted by:	bde
Security:	local DoS
Regress. test:	regression/fifo/fifo_misc
MFC after:	2 weeks

Revision 1.271.2.4: download - view: text, markup, annotated - select for diffs
Wed Mar 22 17:46:50 2006 UTC (5 years, 10 months ago) by tegge
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Diff to: previous 1.271.2.3: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.3: +16 -0 lines
MFC: Add kludge to avoid deadlock when unlinking snapshot.

Approved by:	re (kensmith)

Revision 1.275: download - view: text, markup, annotated - select for diffs
Sun Mar 19 21:29:20 2006 UTC (5 years, 10 months ago) by tegge
Branches: MAIN
Diff to: previous 1.274: preferred, colored
Changes since revision 1.274: +16 -0 lines
Add kludge to avoid deadlock when unlinking snapshot.

Revision 1.271.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 20 00:53:15 2006 UTC (5 years, 11 months ago) by yar
Branches: RELENG_6
Diff to: previous 1.271.2.2: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.2: +1 -1 lines
Work around the shortness of the size argument to
vnode_create_vobject() while preserving the binary ABI
to filesystem modules in RELENG_6: introduce a new function
vnode_create_vobject_off() that takes the size argument
as off_t; move all stock file systems to it; re-implement
the old vnode_create_vobject() using vnode_create_vobject_off()
so that old or binary-only FS modules can work w/o hitting the
bug.  The trick is to pass a size of 0 to vnode_create_vobject_off()
so that it will call VOP_GETATTR() and thus get the actual,
untruncated file size even if the calling module still uses
the old vnode_create_vobject().

PR:		kern/92243
Approved by:	re (scottl)

Revision 1.271.2.2: download - view: text, markup, annotated - select for diffs
Mon Dec 26 13:47:20 2005 UTC (6 years, 1 month ago) by dds
Branches: RELENG_6
Diff to: previous 1.271.2.1: preferred, colored; branchpoint 1.271: preferred, colored
Changes since revision 1.271.2.1: +3 -3 lines
MFC changes from 2005.10.26:
Move execve's access time update functionality into a
new vfs_mark_atime() function, and use the new function
for performing efficient atime updates in mmap().

Revision 1.271.2.1: download - view: text, markup, annotated - select for diffs
Sat Nov 12 20:55:59 2005 UTC (6 years, 2 months ago) by csjp
Branches: RELENG_6
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +19 -19 lines
MFC  Log:
  Convert the primary ACL allocator from malloc(9) to using a UMA zone instead.
  Also introduce an aclinit function which will be used to create the UMA zone
  for use by file systems at system start up.

Revision 1.274: download - view: text, markup, annotated - select for diffs
Wed Oct 12 06:56:00 2005 UTC (6 years, 3 months ago) by dds
Branches: MAIN
Diff to: previous 1.273: preferred, colored
Changes since revision 1.273: +3 -3 lines
Move execve's access time update functionality into a new
vfs_mark_atime() function, and use the new function for
performing efficient atime updates in mmap().

Reviewed by:	bde
MFC after:	2 weeks

Revision 1.273: download - view: text, markup, annotated - select for diffs
Tue Sep 27 18:09:42 2005 UTC (6 years, 4 months ago) by jhb
Branches: MAIN
Diff to: previous 1.272: preferred, colored
Changes since revision 1.272: +3 -2 lines
Use the refcount API to manage the reference count for user credentials
rather than using pool mutexes.

Tested on:	i386, alpha, sparc64

Revision 1.242.2.6: download - view: text, markup, annotated - select for diffs
Fri Sep 16 09:11:50 2005 UTC (6 years, 4 months ago) by rwatson
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.242.2.5: preferred, colored; branchpoint 1.242: preferred, colored; next MAIN 1.243: preferred, colored
Changes since revision 1.242.2.5: +1 -1 lines
Merge vfs_subr.c:1.646 (in spirit) from HEAD to RELENG_5:

    In vfs_kqfilter(), return EINVAL instead of 1 (EPERM) when an
    unsupported kqueue filter type is requested on a vnode.

Revision 1.242.2.5: download - view: text, markup, annotated - select for diffs
Wed Sep 7 16:23:06 2005 UTC (6 years, 5 months ago) by rwatson
Branches: RELENG_5
Diff to: previous 1.242.2.4: preferred, colored; branchpoint 1.242: preferred, colored
Changes since revision 1.242.2.4: +2 -3 lines
Merge ufs_vnops.c:1.269 from HEAD to RELENG_5:

  Allow removal of empty directories with high link counts. These can
  occur on a filesystem running with soft updates after a crash and
  before a background fsck has been run. To prevent discrepancies
  from arising in a background fsck that may already be running,
  the directory is removed but its inode is not freed and is left
  with the residual reference count. When encountered by the
  background fsck it will be reclaimed.

This change was present at the time of the RELENG_6 branch point, so
does not need to be merged to RELENG_6.

Approved by:	mckusick
Bumped into by:	Mikhail Teterin <mi plus mx at aldan dot algebra dot com>

Revision 1.272: download - view: text, markup, annotated - select for diffs
Tue Sep 6 00:06:30 2005 UTC (6 years, 5 months ago) by csjp
Branches: MAIN
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +19 -19 lines
Convert the primary ACL allocator from malloc(9) to using a UMA zone instead.
Also introduce an aclinit function which will be used to create the UMA zone
for use by file systems at system start up.

MFC after:	1 month
Discussed with:	rwatson

Revision 1.271: download - view: text, markup, annotated - select for diffs
Thu Jun 9 20:20:31 2005 UTC (6 years, 8 months ago) by ssouhlal
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Branch point for: RELENG_6
Diff to: previous 1.270: preferred, colored
Changes since revision 1.270: +1 -124 lines
Allow EVFILT_VNODE events to work on every filesystem type, not just
UFS by:
- Making the pre and post hooks for the VOP functions work even when
DEBUG_VFS_LOCKS is not defined.
- Moving the KNOTE activations into the corresponding VOP hooks.
- Creating a MNTK_NOKNOTE flag for the mnt_kern_flag field of struct
mount that permits filesystems to disable the new behavior.
- Creating a default VOP_KQFILTER function: vfs_kqfilter()

My benchmarks have not revealed any performance degradation.

Reviewed by:	jeff, bde
Approved by:	rwatson, jmg (kqueue changes), grehan (mentor)

Revision 1.270: download - view: text, markup, annotated - select for diffs
Tue May 31 19:39:52 2005 UTC (6 years, 8 months ago) by kensmith
Branches: MAIN
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +11 -0 lines
This patch addresses a standards violation issue.  The standards say a
file's access time should be updated when it gets executed.  A while
ago the mechanism used to exec was changed to use a more mmap based
mechanism and this behavior was broken as a side-effect of that.

A new vnode flag is added that gets set when the file gets executed,
and the VOP_SETATTR() vnode operation gets called.  The underlying
filesystem is expected to handle it based on its own semantics, some
filesystems don't support access time at all.  Those that do should
handle it in a way that does not block, does not generate I/O if possible,
etc.  In particular vn_start_write() has not been called.  The UFS code
handles it the same way as it would normally handle the access time if
a file was read - the IN_ACCESS flag gets set in the inode but no other
action happens at this point.  The actual time update will happen later
during a sync (which handles all the necessary locking).

Got me into this:	cperciva
Discussed with:		a lot with bde, a little with kan
Showed patches to:	phk, jeffr, standards@, arch@
Minor discussion on:	arch@

Revision 1.269: download - view: text, markup, annotated - select for diffs
Wed May 18 22:18:21 2005 UTC (6 years, 8 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.268: preferred, colored
Changes since revision 1.268: +2 -3 lines
Allow removal of empty directories with high link counts. These can
occur on a filesystem running with soft updates after a crash and
before a background fsck has been run. To prevent discrepancies
from arising in a background fsck that may already be running,
the directory is removed but its inode is not freed and is left
with the residual reference count. When encountered by the
background fsck it will be reclaimed.

Revision 1.242.2.4: download - view: text, markup, annotated - select for diffs
Sat Apr 23 12:29:22 2005 UTC (6 years, 9 months ago) by pjd
Branches: RELENG_5
Diff to: previous 1.242.2.3: preferred, colored; branchpoint 1.242: preferred, colored
Changes since revision 1.242.2.3: +10 -3 lines
MFC:	ufs_vnops.c	1.268

- Plug memory leak.
- Fix two style nits.

Found by:	Coverity Prevent analysis tool
Reviewed by:	rwatson

Revision 1.268: download - view: text, markup, annotated - select for diffs
Sat Apr 16 10:57:49 2005 UTC (6 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.267: preferred, colored
Changes since revision 1.267: +10 -3 lines
- Plug memory leak.
- Fix two style nits.

Found by:	Coverity Prevent analysis tool
Reviewed by:	rwatson
MFC after:	1 week

Revision 1.267: download - view: text, markup, annotated - select for diffs
Sun Mar 13 11:59:14 2005 UTC (6 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.266: preferred, colored
Changes since revision 1.266: +4 -24 lines
 - In ufs_mknod(), hold the lock across the call to vgone() as that is now
   required.
 - In ufs_close(), don't do the EAGAIN vrele hack, the top layer now calls
   vn_start_write before the lock is acquired as it should.

Sponsored by:	Isilon Systems, Inc.

Revision 1.266: download - view: text, markup, annotated - select for diffs
Sun Feb 27 21:14:27 2005 UTC (6 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.265: preferred, colored
Changes since revision 1.265: +2 -2 lines
Remove debug printout of major/minor numbers, print name instead.

Revision 1.265: download - view: text, markup, annotated - select for diffs
Sun Feb 27 18:58:31 2005 UTC (6 years, 11 months ago) by sam
Branches: MAIN
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +1 -2 lines
use uiomove return value instead of always returning 0 when doing a
readlink of a fast link

Noticed by:	Coverity Prevent analysis tool
Reviewed by:	phk

Revision 1.242.2.3: download - view: text, markup, annotated - select for diffs
Tue Feb 22 15:49:22 2005 UTC (6 years, 11 months ago) by cperciva
Branches: RELENG_5
CVS tags: RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.242.2.2: preferred, colored; branchpoint 1.242: preferred, colored
Changes since revision 1.242.2.2: +9 -4 lines
MFC revision 1.46 of sys/kern/kern_jail.c, revision 1.24 of
sys/sys/jail.h, 1.264 of sys/ufs/ufs/ufs_vnops.c, and revision 1.61 of
usr.sbin/jail/jail.8:

  Add a new sysctl, "security.jail.chflags_allowed", which controls the
  behaviour of chflags within a jail. [...]

The default behaviour (security.jail.chflags_allowed = 0) is unchanged.

Revision 1.264: download - view: text, markup, annotated - select for diffs
Tue Feb 8 21:31:10 2005 UTC (7 years ago) by cperciva
Branches: MAIN
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +9 -4 lines
Add a new sysctl, "security.jail.chflags_allowed", which controls the
behaviour of chflags within a jail.  If set to 0 (the default), then a
jailed root user is treated as an unprivileged user; if set to 1, then
a jailed root user is treated the same as an unjailed root user.

This is necessary to allow "make installworld" to work inside a jail,
since it attempts to manipulate the system immutable flag on certain
files.

Discussed with:	csjp, rwatson
MFC after:	2 weeks

Revision 1.263: download - view: text, markup, annotated - select for diffs
Tue Feb 8 15:54:30 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +0 -29 lines
For snapshots we need all VOP_LOCKs to be exclusive.

The "business class upgrade" was implemented in UFS's VOP_LOCK
implementation ufs_lock() which is the wrong layer, so move it to
ffs_lock().

Also, as long as we have not abandonned advanced vfs-stacking we
should not preclude it from happening: instead of implementing a
copy locally, use the VOP_LOCK_APV(&ufs) to correctly arrive at
vop_stdlock() at the bottom.

Revision 1.262: download - view: text, markup, annotated - select for diffs
Wed Feb 2 14:21:01 2005 UTC (7 years ago) by kensmith
Branches: MAIN
Diff to: previous 1.261: preferred, colored
Changes since revision 1.261: +0 -6 lines
Back out previous commit, bde@ provided an example of something this
breaks.

Revision 1.261: download - view: text, markup, annotated - select for diffs
Wed Feb 2 00:21:38 2005 UTC (7 years ago) by kensmith
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +6 -0 lines
It was noticed that we do not change a file's access time when it gets
executed.  This appears to violate most of the UNIX-ish standards.
One example quote from:

  http://www.opengroup.org/onlinepubs/009695399/functions/exec.html

    Upon successful completion, the exec functions shall mark for update
    the st_atime field of the file. If an exec function failed but was
    able to locate the process image file, whether the st_atime field is
    marked for update is unspecified. Should the exec function succeed,
    the process image file shall be considered to have been opened with
    open().

This appears to take care of it for ufs filesystems, doing the necessary
sanity checks (read-only filesystem, etc) without violating any other
standards (setting atime for any open appears to be allowed in any standards
I could find).

Noticed by:	cperciva
Reviewed by:	kan, rwatson

Revision 1.242.2.2: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:27:01 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.242.2.1: preferred, colored; branchpoint 1.242: preferred, colored
Changes since revision 1.242.2.1: +1 -1 lines
MFC: /*- and related license changes

Revision 1.260: download - view: text, markup, annotated - select for diffs
Sat Jan 29 14:23:09 2005 UTC (7 years ago) by peadar
Branches: MAIN
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +4 -5 lines
Tell vnode_create_vobject() how big an object to create, rather
than having it work it out via the more expensive VOP_GETATTR

Reviewed by: phk@

Revision 1.259: download - view: text, markup, annotated - select for diffs
Mon Jan 24 23:04:33 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +2 -0 lines
Create a vnode object when the file is opened.  Trust that we did so.

Revision 1.258: download - view: text, markup, annotated - select for diffs
Mon Jan 24 12:19:28 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +4 -9 lines
Polish style.

Revision 1.257: download - view: text, markup, annotated - select for diffs
Tue Jan 11 09:10:46 2005 UTC (7 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +1 -1 lines
Wrap the bufobj operations in macros: BO_STRATEGY() and BO_WRITE()

Revision 1.256: download - view: text, markup, annotated - select for diffs
Fri Jan 7 02:29:26 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +1 -1 lines
/* -> /*- for license, minor formatting changes

Revision 1.255: download - view: text, markup, annotated - select for diffs
Tue Dec 14 21:30:45 2004 UTC (7 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +8 -61 lines
Implement simpler panics for VOP_{read,write} on fifos.

Revision 1.254: download - view: text, markup, annotated - select for diffs
Sat Dec 11 23:05:30 2004 UTC (7 years, 2 months ago) by marcel
Branches: MAIN
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +4 -4 lines
Revert previous commit. The null-pointer function call (a dereference
on ia64) was not the result of a change in the vector operations. It
was caused by the NFS locking code using a FIFO and those bypassing
the vnode. This indirectly caused the panic. The NFS locking code has
been changed.

Requested by: phk

Revision 1.253: download - view: text, markup, annotated - select for diffs
Sun Dec 5 22:30:28 2004 UTC (7 years, 2 months ago) by marcel
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +4 -4 lines
Fix null-pointer indirect function calls introduced in the previous
commit. In the new world order, the transitive closure on the vector
operations is not precomputed. As such, it's unsafe to actually use
any of the function pointers in an indirect function call. They can
be null, and we need to use the default vector in that case.
This is mostly a quick fix for the four function pointers that are
ed explicitly. A more generic or scalable solution is likely to see
the light of day.

No pathos on: current@

Revision 1.252: download - view: text, markup, annotated - select for diffs
Wed Dec 1 23:16:38 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +66 -95 lines
Back when VOP_* was introduced, we did not have new-style struct
initializations but we did have lofty goals and big ideals.

Adjust to more contemporary circumstances and gain type checking.

	Replace the entire vop_t frobbing thing with properly typed
	structures.  The only casualty is that we can not add a new
	VOP_ method with a loadable module.  History has not given
	us reason to belive this would ever be feasible in the the
	first place.

	Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc.

	Give coda correct prototypes and function definitions for
	all vop_()s.

	Generate a bit more data from the vnode_if.src file:  a
	struct vop_vector and protype typedefs for all vop methods.

	Add a new vop_bypass() and make vop_default be a pointer
	to another struct vop_vector.

	Remove a lot of vfs_init since vop_vector is ready to use
	from the compiler.

	Cast various vop_mumble() to void * with uppercase name,
	for instance VOP_PANIC, VOP_NULL etc.

	Implement VCALL() by making vdesc_offset the offsetof() the
	relevant function pointer in vop_vector.  This is disgusting
	but since the code is generated by a script comparatively
	safe.  The alternative for nullfs etc. would be much worse.

	Fix up all vnode method vectors to remove casts so they
	become typesafe.  (The bulk of this is generated by scripts)

Revision 1.251: download - view: text, markup, annotated - select for diffs
Wed Dec 1 12:24:41 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +25 -25 lines
Mechanically change prototypes for vnode operations to use the new typedefs.

Revision 1.250: download - view: text, markup, annotated - select for diffs
Sat Nov 6 11:41:22 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +0 -1 lines
Properly implement a default version of VOP_GETWRITEMOUNT.

Remove improper access to vop_stdgetwritemount() which should and
will instead rely on the VOP default path.

Revision 1.249: download - view: text, markup, annotated - select for diffs
Fri Oct 29 10:15:56 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +3 -7 lines
Move UFS from DEVFS backing to GEOM backing.

This eliminates a bunch of vnode overhead (approx 1-2 % speed
improvement) and gives us more control over the access to the storage
device.

Access counts on the underlying device are not correctly tracked and
therefore it is possible to read-only mount the same disk device multiple
times:
	syv# mount -p
	/dev/md0        /var    ufs rw  2 2
	/dev/ad0        /mnt    ufs ro  1 1
	/dev/ad0        /mnt2   ufs ro  1 1
	/dev/ad0        /mnt3   ufs ro  1 1

Since UFS/FFS is not a synchrousely consistent filesystem (ie: it caches
things in RAM) this is not possible with read-write mounts, and the system
will correctly reject this.

Details:

	Add a geom consumer and a bufobj pointer to ufsmount.

	Eliminate the vnode argument from softdep_disk_prewrite().
	Pick the vnode out of bp->b_vp for now.  Eventually we
	should find it through bp->b_bufobj->b_private.

	In the mountcode, use g_vfs_open() once we have used
	VOP_ACCESS() to check permissions.

	When upgrading and downgrading between r/o and r/w do the
	right thing with GEOM access counts.  Remove all the
	workarounds for not being able to do this with VOP_OPEN().

	If we are the root mount, drop the exclusive access count
	until we upgrade to r/w.  This allows fsck of the root
	filesystem and the MNT_RELOAD to work correctly.

	Set bo_private to the GEOM consumer on the device bufobj.

	Change the ffs_ops->strategy function to call g_vfs_strategy()

	In ufs_strategy() directly call the strategy on the disk
	bufobj.  Same in rawread.

	In ffs_fsync() we will no longer see VCHR device nodes, so
	remove code which synced the filesystem mounted on it, in
	case we came there.  I'm not sure this code made sense in
	the first place since we would have taken the specfs route
	on such a vnode.

	Redo the highly bogus readblock() function in the snapshot
	code to something slightly less bogus: Constructing an uio
	and using physio was really quite a detour.  Instead just
	fill in a bio and ship it down.

Revision 1.248: download - view: text, markup, annotated - select for diffs
Wed Oct 27 06:45:06 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +0 -2 lines
Eliminate unnecessary KASSERTS.

Revision 1.247: download - view: text, markup, annotated - select for diffs
Tue Oct 26 20:12:25 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +2 -8 lines
Replace single case switch() with if().

Revision 1.246: download - view: text, markup, annotated - select for diffs
Tue Oct 26 10:44:10 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +8 -2 lines
The island council met and voted buf_prewrite() home.

Give ffs it's own bufobj->bo_ops vector and create a private strategy
routine, (currently misnamed for forwards compatibility), which is
just a copy of the generic bufstrategy routine except we call
softdep_disk_prewrite() directly instead of through the buf_prewrite()
indirection.

Teach UFS about the need for softdep_disk_prewrite() and call the
function directly in FFS.

Remove buf_prewrite() from the default bufstrategy() and from the
global bio_ops method vector.

Revision 1.245: download - view: text, markup, annotated - select for diffs
Tue Sep 28 13:30:58 2004 UTC (7 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +4 -128 lines
Remove support for accessing device nodes in UFS/FFS.

Device nodes can still be created and exported with NFS.

Revision 1.244: download - view: text, markup, annotated - select for diffs
Tue Sep 7 09:17:05 2004 UTC (7 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +1 -24 lines
Create simple function init_va_filerev() for initializing a va_filerev
field.

Replace three instances of longhaired initialization va_filerev fields.

Added XXX comment wondering why we don't use random bits instead of
uptime of the system for this purpose.

Revision 1.242.2.1: download - view: text, markup, annotated - select for diffs
Thu Sep 2 01:12:20 2004 UTC (7 years, 5 months ago) by csjp
Branches: RELENG_5
CVS tags: RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +1 -1 lines
MFC v1.243:

Currently, if the secure level is low enough, system flags can
be manipulated by prison root. In 4.x prison root can not manipulate
system flags, regardless of the security level. This behavior
should remain consistent to avoid any surprises which could lead
to security problems for system administrators which give out
privileged access to jails.

This commit changes suser_cred's flag argument from SUSER_ALLOWJAIL
to 0. This will prevent prison root from being able to manipulate
system flags on files.

Approved by:	re (kensmith)

Revision 1.243: download - view: text, markup, annotated - select for diffs
Sun Aug 22 02:03:41 2004 UTC (7 years, 5 months ago) by csjp
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +1 -1 lines
Currently, if the secure level is low enough, system flags can
be manipulated by prison root. In 4.x prison root can not manipulate
system flags, regardless of the security level. This behavior
should remain consistent to avoid any surprises which could lead
to security problems for system administrators which give out
privileged access to jails.

This commit changes suser_cred's flag argument from SUSER_ALLOWJAIL
to 0. This will prevent prison root from being able to manipulate
system flags on files.

This may be a MFC candidate for RELENG_5.

Discussed with:	cperciva
Reviewed by:	rwatson
Approved by:	bmilekic (mentor)
PR:		kern/70298

Revision 1.242: download - view: text, markup, annotated - select for diffs
Sun Aug 15 06:24:42 2004 UTC (7 years, 5 months ago) by jmg
Branches: MAIN
CVS tags: RELENG_5_BP
Branch point for: RELENG_5
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +20 -23 lines
Add locking to the kqueue subsystem.  This also makes the kqueue subsystem
a more complete subsystem, and removes the knowlege of how things are
implemented from the drivers.  Include locking around filter ops, so a
module like aio will know when not to be unloaded if there are outstanding
knotes using it's filter ops.

Currently, it uses the MTX_DUPOK even though it is not always safe to
aquire duplicate locks.  Witness currently doesn't support the ability
to discover if a dup lock is ok (in some cases).

Reviewed by:	green, rwatson (both earlier versions)

Revision 1.241: download - view: text, markup, annotated - select for diffs
Wed Jul 28 06:41:27 2004 UTC (7 years, 6 months ago) by kan
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +54 -54 lines
Avoid using casts as lvalues. Introduce DIP_SET macro which sets proper
inode field based on UFS version. Use DIP ro read values and DIP_SET
to modify them throughout FFS code base.

Revision 1.240: download - view: text, markup, annotated - select for diffs
Mon Jul 26 07:24:04 2004 UTC (7 years, 6 months ago) by cperciva
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +6 -6 lines
Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL.  This is
somewhat clearer, but more importantly allows for a consistent naming
scheme for suser_cred flags.

The old name is still defined, but will be removed in a few days (unless I
hear any complaints...)

Discussed with:	rwatson, scottl
Requested by:	jhb

Revision 1.239: download - view: text, markup, annotated - select for diffs
Wed Apr 7 03:47:20 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +0 -4 lines
Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and irc message from Robert
Watson saying that clause 3 can be removed from those files with an
NAI copyright that also have only a University of California
copyrights.

Approved by: core, rwatson

Revision 1.238: download - view: text, markup, annotated - select for diffs
Thu Mar 11 18:50:33 2004 UTC (7 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +2 -1 lines
When I was a kid my work table was one cluttered mess an cleaning it up
were a rather overwhelming task.  I soon learned that if you don't know
where you're going to store something, at least try to pile it next to
something slightly related in the hope that a pattern emerges.

Apply the same principle to the ffs/snapshot/softupdates code which have
leaked into specfs:  Add yet a buf-quasi-method and call it from the
only two places I can see it can make a difference and implement the
magic in ffs_softdep.c where it belongs.

It's not pretty, but at least it's one less layer violated.

Revision 1.237: download - view: text, markup, annotated - select for diffs
Thu Mar 11 18:02:36 2004 UTC (7 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +2 -2 lines
Properly vector all bwrite() and BUF_WRITE() calls through the same path
and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().

Revision 1.236: download - view: text, markup, annotated - select for diffs
Mon Feb 23 19:05:05 2004 UTC (7 years, 11 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +3 -2 lines
A more accurate test in the new ufs_lock than that in 1.235.

Revision 1.235: download - view: text, markup, annotated - select for diffs
Mon Feb 23 06:40:17 2004 UTC (7 years, 11 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +28 -0 lines
Change UFS from using vop_stdlock to using its own ufs_lock.
In ufs_lock, check for attempts to acquire shared locks on
snapshot files and change them to be exclusive locks. This
change eliminates deadlocks and machine lockups reported in
-current since most read requests started using shared lock
requests.

Submitted by:	Jun Kuriyama <kuriyama@imgsrc.co.jp>

Revision 1.234: download - view: text, markup, annotated - select for diffs
Sat Oct 18 14:10:27 2003 UTC (8 years, 3 months ago) by phk
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +1 -1 lines
DuH!

bp->b_iooffset (the spot on the disk), not bp->b_offset (the offset in
the file)

Revision 1.233: download - view: text, markup, annotated - select for diffs
Sat Oct 18 11:16:33 2003 UTC (8 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +1 -0 lines
Initialize bp->b_offset before calling VOP_[SPEC]STRATEGY()

Revision 1.232: download - view: text, markup, annotated - select for diffs
Mon Aug 4 03:29:13 2003 UTC (8 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +4 -8 lines
Now that the central POSIX.1e ACL code implements functions to
generate the inode mode from a default ACL and creation mask,
implement ufs_sync_inode_from_acl() using acl_posix1e_newfilemode().

Since ACL_OVERRIDE_MASK/ACL_PRESERVE_MASK are defined, we no
longer need to explicitly pass in a "preserve_mask" field: this
is implicit in the use of POSIX.1e semantics.

Note: this change contains a semantic bugfix for new file creation:
we now intersect the ACL-generated mode and the cmode requested by
the user process.  This means permissions on newly created file
objects will now be more conservative.  In the future, we may want
to provide alternative semantics (similar to Solaris and Linux) in
which the ACL mask overrides the umask, permitting ACLs to broaden
the rights beyond the requested umask.

PR:		50148
Reported by:	Ritz, Bruno <bruno_ritz@gmx.ch>
Obtained from:	TrustedBSD Project

Revision 1.231: download - view: text, markup, annotated - select for diffs
Mon Aug 4 00:31:01 2003 UTC (8 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +9 -5 lines
In ufs_chmod(), use privilege only when required in the following
cases:

- Setting sticky bit on non-directory
- Setting setgid on a file with a group that isn't in the effective
  or extended groups of the authorizing credential

I.e., test the requirement first, then do the privilege test,
rather than doing the privilege test regardless of the need for
privilege.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.230: download - view: text, markup, annotated - select for diffs
Mon Jul 28 18:53:29 2003 UTC (8 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +3 -0 lines
Rename VOP_RMEXTATTR() to VOP_DELETEEXTATTR() for consistency with the
kernel ACL interfaces and system call names.

Break out UFS2 and FFS extattr delete and list vnode operations from
setextattr and getextattr to deleteextattr and listextattr, which
cleans up the implementations, and makes the results more readable,
and makes the APIs more clear.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.229: download - view: text, markup, annotated - select for diffs
Fri Jul 4 12:16:33 2003 UTC (8 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +2 -2 lines
We just cached the inode pointer, no need to call VTOI() again.

Revision 1.228: download - view: text, markup, annotated - select for diffs
Sun Jun 15 18:53:00 2003 UTC (8 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +2 -0 lines
Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementations
to check that the buffer points to the correct vnode.

Revision 1.227: download - view: text, markup, annotated - select for diffs
Wed Jun 11 06:34:30 2003 UTC (8 years, 8 months ago) by obrien
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +3 -1 lines
Use __FBSDID().

Revision 1.226: download - view: text, markup, annotated - select for diffs
Sat May 31 19:53:04 2003 UTC (8 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +0 -2 lines
Remove unused variable.

Found by:       FlexeLint

Revision 1.225: download - view: text, markup, annotated - select for diffs
Mon Mar 3 19:15:40 2003 UTC (8 years, 11 months ago) by njl
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +1 -1 lines
Finish cleanup of vprint() which was begun with changing v_tag to a string.
Remove extraneous uses of vop_null, instead defering to the default op.
Rename vnode type "vfs" to the more descriptive "syncer".
Fix formatting for various filesystems that use vop_print.

Revision 1.224: download - view: text, markup, annotated - select for diffs
Wed Feb 19 05:47:46 2003 UTC (8 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +6 -6 lines
Back out M_* changes, per decision of the TRB.

Approved by: trb

Revision 1.223: download - view: text, markup, annotated - select for diffs
Tue Jan 21 08:56:15 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +6 -6 lines
Remove M_TRYWAIT/M_WAITOK/M_WAIT.  Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.

Revision 1.222: download - view: text, markup, annotated - select for diffs
Sat Jan 4 22:10:36 2003 UTC (9 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +1 -1 lines
Temporarily introduce a new VOP_SPECSTRATEGY operation while I try
to sort out disk-io from file-io in the vm/buffer/filesystem space.

The intent is to sort VOP_STRATEGY calls into those which operate
on "real" vnodes and those which operate on VCHR vnodes.  For
the latter kind, the call will be changed to VOP_SPECSTRATEGY,
possibly conditionally for those places where dual-use happens.

Add a default VOP_SPECSTRATEGY method which will call the normal
VOP_STRATEGY.  First time it is called it will print debugging
information.  This will only happen if a normal vnode is passed
to VOP_SPECSTRATEGY by mistake.

Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY
does on a VCHR vnode today.

Add a new VOP_STRATEGY method in specfs to catch instances where
the conversion to VOP_SPECSTRATEGY has not yet happened.  Handle
the request just like we always did, but first time called print
debugging information.

Apart up to two instances of console messages per boot, this amounts
to a glorified no-op commit.

If you get any of the messages on your console I would very much
like a copy of them mailed to phk@freebsd.org

Revision 1.221: download - view: text, markup, annotated - select for diffs
Sat Jan 4 08:47:19 2003 UTC (9 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +0 -9 lines
Since Jeffr made the std* functions the default in rev 1.63 of
kern/vfs_defaults.c it is wrong for the individual filesystems to use
the std* functions as that prevents override of the default.

Found by:       src/tools/tools/vop_table

Revision 1.131.2.8: download - view: text, markup, annotated - select for diffs
Thu Jan 2 17:26:19 2003 UTC (9 years, 1 month ago) by bde
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.131.2.7: preferred, colored; branchpoint 1.131: preferred, colored; next MAIN 1.132: preferred, colored
Changes since revision 1.131.2.7: +6 -52 lines
MFC: vfs_syscalls.c 1.286:
Changed rename(2) to do nothing if its args resolve to the same existing
file, as seems to be required by POSIX.

MFC: ext2fs_vnops.c 1.69, ufs_vnops.c 1.205:
Replaced the resulting dead dead code by a check that it is not reached.

PR:             42617

Revision 1.220: download - view: text, markup, annotated - select for diffs
Sun Oct 27 18:09:49 2002 UTC (9 years, 3 months ago) by wollman
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +47 -11 lines
Implement the new 1003.1-2001 pathconf() keys, including the Advisory
Information option.  Other filesystem implementations should do something
similar.

With advice from:	mckusick, phk

Revision 1.219: download - view: text, markup, annotated - select for diffs
Sat Oct 26 14:38:24 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +12 -15 lines
Slightly change the semantics of vnode labels for MAC: rather than
"refreshing" the label on the vnode before use, just get the label
right from inception.  For single-label file systems, set the label
in the generic VFS getnewvnode() code; for multi-label file systems,
leave the labeling up to the file system.  With UFS1/2, this means
reading the extended attribute during vfs_vget() as the inode is
pulled off disk, rather than hitting the extended attributes
frequently during operations later, improving performance.  This
also corrects sematics for shared vnode locks, which were not
previously present in the system.  This chances the cache
coherrency properties WRT out-of-band access to label data, but in
an acceptable form.  With UFS1, there is a small race condition
during automatic extended attribute start -- this is not present
with UFS2, and occurs because EAs aren't available at vnode
inception.  We'll introduce a work around for this shortly.

Approved by:	re
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.218: download - view: text, markup, annotated - select for diffs
Sun Oct 20 22:11:13 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +3 -3 lines
Rename _POSIX_FOO_PRESENT and friends from POSIX.1e to _PC_FOO_PRESENT
and related friends.  This would have been corrected had POSIX.1e
progressed to a standard.

Pointed out by:	wollman

Revision 1.217: download - view: text, markup, annotated - select for diffs
Sun Oct 20 22:08:26 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +10 -0 lines
Implement _POSIX_ACL_PATH_MAX, which returns the maximum number of ACL
entries for a file system node using pathconf().

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.216: download - view: text, markup, annotated - select for diffs
Sun Oct 20 21:49:41 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +20 -0 lines
Teach UFS to respond to pathconf() tests for _POSIX_ACL_EXTENDED and
_POSIX_MAC_PRESENT based on available mount flags, if the services are
available.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.215: download - view: text, markup, annotated - select for diffs
Fri Oct 18 21:03:30 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +1 -1 lines
Use 'size_t' instead of 'int' for the result of sizeof().

Revision 1.214: download - view: text, markup, annotated - select for diffs
Tue Oct 15 21:28:24 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +117 -101 lines
Push most UFS ACL behavior behind a check for MNT_ACLS, permitting ACLs
to be administratively disabled as needed on UFS/UFS2 file systems.  This
also has the effect of preventing the slightly more expensive ACL code
from running on non-ACL file systems, avoiding storage allocation for
ACLs that may be read from disk.  MNT_ACLS may be set at mount-time
using mount -o acls, or implicitly by setting the FS_ACLS flag using
tunefs.  On UFS1, you may also have to configure ACL store.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.213: download - view: text, markup, annotated - select for diffs
Mon Oct 14 23:18:08 2002 UTC (9 years, 3 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +0 -2 lines
When reading or writing the extended attributes of a special device
or fifo in UFS2, the normal ufs_strategy routine needs to be used
rather than the spec_strategy or fifo_strategy routine. Thus the
ffsext_strategy routine is interposed in the ffs_vnops vectors for
special devices and fifo's to pick off this special case. Otherwise
it simply falls through to the usual spec_strategy or fifo_strategy
routine.

Submitted by:	Robert Watson <rwatson@FreeBSD.org>
Sponsored by:	DARPA & NAI Labs.

Revision 1.212: download - view: text, markup, annotated - select for diffs
Mon Oct 14 19:55:49 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +4 -0 lines
Fix two memory leaks in error conditions involving the UFS ACL code:
if failures occur, make sure that we release both the default ACL
and access ACL storage during new object creation.

Spotted by:	phk and his pet flexelint
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.211: download - view: text, markup, annotated - select for diffs
Fri Oct 11 14:58:33 2002 UTC (9 years, 4 months ago) by mike
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +1 -1 lines
Change iov_base's type from `char *' to the standard `void *'.  All
uses of iov_base which assume its type is `char *' (in order to do
pointer arithmetic) have been updated to cast iov_base to `char *'.

Revision 1.210: download - view: text, markup, annotated - select for diffs
Sat Sep 28 17:15:31 2002 UTC (9 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +27 -27 lines
Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512

Revision 1.209: download - view: text, markup, annotated - select for diffs
Wed Sep 25 02:45:50 2002 UTC (9 years, 4 months ago) by jeff
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +7 -7 lines
 - Lock accesses to v_usecount.
 - Convert interlock locks to use standard macros.

Revision 1.208: download - view: text, markup, annotated - select for diffs
Thu Sep 19 13:32:45 2002 UTC (9 years, 4 months ago) by truckman
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +4 -11 lines
VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link()
wasn't doing.  Rather than just lock and unlock the vnode around the call
to VOP_FSYNC(), implement rwatson's suggestion to lock the file vnode
in kern_link() before calling VOP_LINK(), since the other filesystems
also locked the file vnode right away in their link methods.  Remove the
locking and and unlocking from the leaf filesystem link methods.

Reviewed by:	rwatson, bde  (except for the unionfs_link() changes)

Revision 1.207: download - view: text, markup, annotated - select for diffs
Wed Sep 18 20:42:04 2002 UTC (9 years, 4 months ago) by njl
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +2 -4 lines
Remove any VOP_PRINT that redundantly prints the tag.
Move lockmgr_printinfo() into vprint() for everyone's benefit.

Suggested by: bde

Revision 1.206: download - view: text, markup, annotated - select for diffs
Sat Sep 14 09:02:28 2002 UTC (9 years, 4 months ago) by njl
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +3 -3 lines
Remove all use of vnode->v_tag, replacing with appropriate substitutes.
v_tag is now const char * and should only be used for debugging.

Additionally:
1. All users of VT_NTS now check vfsconf->vf_type VFCF_NETWORK
2. The user of VT_PROCFS now checks for the new flag VV_PROCDEP, which
is propagated by pseudofs to all child vnodes if the fs sets PFS_PROCDEP.

Suggested by:   phk
Reviewed by:    bde, rwatson (earlier version)

Revision 1.205: download - view: text, markup, annotated - select for diffs
Tue Sep 10 11:09:13 2002 UTC (9 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +6 -52 lines
vfs_syscalls.c:
Changed rename(2) to follow the letter of the POSIX spec.  POSIX
requires rename() to have no effect if its args "resolve to the same
existing file".  I think "file" can only reasonably be read as referring
to the inode, although the rationale and "resolve" seem to say that
sameness is at the level of (resolved) directory entries.

ext2fs_vnops.c, ufs_vnops.c:
Replaced code that gave the historical BSD behaviour of removing one
link name by checks that this code is now unreachable.  This fixes
some races.  All vnodes needed to be unlocked for the removal, and
locking at another level using something like IN_RENAME was not even
attempted, so it was possible for rename(x, y) to return with both x
and y removed even without any unlink(2) syscalls (one process can
remove x using rename(x, y) and another process can remove y using
rename(y, x)).

Prodded by:	alfred
MFC after:	8 weeks
PR:		42617

Revision 1.204: download - view: text, markup, annotated - select for diffs
Thu Aug 15 20:55:08 2002 UTC (9 years, 5 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +1 -1 lines
In order to better support flexible and extensible access control,
make a series of modifications to the credential arguments relating
to file read and write operations to cliarfy which credential is
used for what:

- Change fo_read() and fo_write() to accept "active_cred" instead of
  "cred", and change the semantics of consumers of fo_read() and
  fo_write() to pass the active credential of the thread requesting
  an operation rather than the cached file cred.  The cached file
  cred is still available in fo_read() and fo_write() consumers
  via fp->f_cred.  These changes largely in sys_generic.c.

For each implementation of fo_read() and fo_write(), update cred
usage to reflect this change and maintain current semantics:

- badfo_readwrite() unchanged
- kqueue_read/write() unchanged
  pipe_read/write() now authorize MAC using active_cred rather
  than td->td_ucred
- soo_read/write() unchanged
- vn_read/write() now authorize MAC using active_cred but
  VOP_READ/WRITE() with fp->f_cred

Modify vn_rdwr() to accept two credential arguments instead of a
single credential: active_cred and file_cred.  Use active_cred
for MAC authorization, and select a credential for use in
VOP_READ/WRITE() based on whether file_cred is NULL or not.  If
file_cred is provided, authorize the VOP using that cred,
otherwise the active credential, matching current semantics.

Modify current vn_rdwr() consumers to pass a file_cred if used
in the context of a struct file, and to always pass active_cred.
When vn_rdwr() is used without a file_cred, pass NOCRED.

These changes should maintain current semantics for read/write,
but avoid a redundant passing of fp->f_cred, as well as making
it more clear what the origin of each credential is in file
descriptor read/write operations.

Follow-up commits will make similar changes to other file descriptor
operations, and modify the MAC framework to pass both credentials
to MAC policy modules so they can implement either semantic for
revocation.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs

Revision 1.203: download - view: text, markup, annotated - select for diffs
Mon Aug 12 16:43:04 2002 UTC (9 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +2 -2 lines
Pass IO_NOMACCHECK to vn_rdwr() in the following checks to prevent
enforcement of MAC policy on the read or write operations:

- In ext2fs, don't enforce MAC on loop-back reads and writes supporting
  directory read operations in lookup(), directory modifications in
  rename(), directory write operations in mkdir(), symlink write
  operations in symlink().

- In the NFS client locking code, perform vn_rdwr() on the NFS locking
  socket without enforcing MAC, since the write is done on behalf of
  the kernel NFS implementation rather than the user process.

- In UFS, don't enforce MAC on loop-back reads and writes supporting
  directory read operations in lookup(), and symlink write operations
  in symlink().

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs

Revision 1.202: download - view: text, markup, annotated - select for diffs
Sun Aug 4 10:29:35 2002 UTC (9 years, 6 months ago) by jeff
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +3 -2 lines
 - Replace v_flag with v_iflag and v_vflag
 - v_vflag is protected by the vnode lock and is used when synchronization
   with VOP calls is needed.
 - v_iflag is protected by interlock and is used for dealing with vnode
   management issues.  These flags include X/O LOCK, FREE, DOOMED, etc.
 - All accesses to v_iflag and v_vflag have either been locked or marked with
   mp_fixme's.
 - Many ASSERT_VOP_LOCKED calls have been added where the locking was not
   clear.
 - Many functions in vfs_subr.c were restructured to provide for stronger
   locking.

Idea stolen from:	BSD/OS

Revision 1.201: download - view: text, markup, annotated - select for diffs
Wed Jul 31 16:05:30 2002 UTC (9 years, 6 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +31 -1 lines
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument UFS to support per-inode MAC labels.  In particular,
invoke MAC framework entry points for generically supporting the
backing of MAC labels into extended attributes.  This ends up
introducing new vnode operation vector entries point at the MAC
framework entry points, as well as some explicit entry point
invocations for file and directory creation events so that the
MAC framework can push labels to disk before the directory names
become persistent (this will work better once EAs in UFS2 are
hooked into soft updates).  The generic EA MAC entry points
support executing with the file system in either single label
or multilabel operation, and will fall back to the mount label
if multilabel is not specified at mount-time.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs

Revision 1.200: download - view: text, markup, annotated - select for diffs
Fri Jul 19 07:29:39 2002 UTC (9 years, 6 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +9 -4 lines
Add support to UFS2 to provide storage for extended attributes.
As this code is not actually used by any of the existing
interfaces, it seems unlikely to break anything (famous
last words).

The internal kernel interface to manipulate these attributes
is invoked using two new IO_ flags: IO_NORMAL and IO_EXT.
These flags may be specified in the ioflags word of VOP_READ,
VOP_WRITE, and VOP_TRUNCATE. Specifying IO_NORMAL means that
you want to do I/O to the normal data part of the file and
IO_EXT means that you want to do I/O to the extended attributes
part of the file. IO_NORMAL and IO_EXT are mutually exclusive
for VOP_READ and VOP_WRITE, but may be specified individually
or together in the case of VOP_TRUNCATE. For example, when
removing a file, VOP_TRUNCATE is called with both IO_NORMAL
and IO_EXT set. For backward compatibility, if neither IO_NORMAL
nor IO_EXT is set, then IO_NORMAL is assumed.

Note that the BA_ and IO_ flags have been `merged' so that they
may both be used in the same flags word. This merger is possible
by assigning the IO_ flags to the low sixteen bits and the BA_
flags the high sixteen bits. This works because the high sixteen
bits of the IO_ word is reserved for read-ahead and help with
write clustering so will never be used for flags. This merge
lets us get away from code of the form:

        if (ioflags & IO_SYNC)
                flags |= BA_SYNC;

For the future, I have considered adding a new field to the
vattr structure, va_extsize. This addition could then be
exported through the stat structure to allow applications to
find out the size of the extended attribute storage and also
would provide a more standard interface for truncating them
(via VOP_SETATTR rather than VOP_TRUNCATE).

I am also contemplating adding a pathconf parameter (for
concreteness, lets call it _PC_MAX_EXTSIZE) which would
let an application determine the maximum size of the extended
atribute storage.

Sponsored by:	DARPA & NAI Labs.

Revision 1.199: download - view: text, markup, annotated - select for diffs
Wed Jul 17 02:03:17 2002 UTC (9 years, 6 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +11 -1 lines
Change utimes to set the file creation time (for filesystems that
support creation times such as UFS2) to the value of the
modification time if the value of the modification time is older
than the current creation time. See utimes(2) for further details.

Sponsored by:	DARPA & NAI Labs.

Revision 1.198: download - view: text, markup, annotated - select for diffs
Tue Jul 16 22:36:00 2002 UTC (9 years, 6 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +4 -4 lines
Change the name of st_createtime to st_birthtime. This change is
made to reduce confusion between st_ctime and st_createtime.

Submitted by:	Eric Allman <eric@sendmail.org>
Sponsored by:	DARPA & NAI Labs.

Revision 1.197: download - view: text, markup, annotated - select for diffs
Sun Jun 23 06:12:22 2002 UTC (9 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +1 -1 lines
Rename the BALLOC flags from B_* to BA_* to avoid confusion with the
struct buf B_ flags.

Approved by:	mckusick

Revision 1.196: download - view: text, markup, annotated - select for diffs
Fri Jun 21 06:18:04 2002 UTC (9 years, 7 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +99 -34 lines
This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by:	Poul-Henning Kamp <phk@freebsd.org>

Revision 1.195: download - view: text, markup, annotated - select for diffs
Sat May 18 18:51:14 2002 UTC (9 years, 8 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +2 -5 lines
Remove um_i_effnlink_valid, i_spare[] and the ufsmount_u and inode_u
unions, since these were only necessary when ext2fs used ufs code.

Reviewed by:	mckusick

Revision 1.194: download - view: text, markup, annotated - select for diffs
Fri May 17 18:53:29 2002 UTC (9 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +1 -1 lines
Call ufs_bmaparray() with right parameter type.

Sponsored by: DARPA & NAI Labs.

Revision 1.193: download - view: text, markup, annotated - select for diffs
Thu May 16 21:28:30 2002 UTC (9 years, 8 months ago) by trhodes
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +4 -4 lines
More s/file system/filesystem/g

Revision 1.192: download - view: text, markup, annotated - select for diffs
Mon May 13 09:22:31 2002 UTC (9 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +27 -27 lines
Remove register keyword.

Sponsored by:	DARPA & NAI Labs.
Submitted by:	mckusick

Revision 1.191: download - view: text, markup, annotated - select for diffs
Fri May 3 08:40:33 2002 UTC (9 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +12 -0 lines
Name ufs_vop_[gs]etextattr() consistently with the rest of our VOPs and
put then in the ufs_vnops where they belong, rather than in the ffs_vnops.

Ok'ed by:	rwatson
Sponsored by:	DARPA & NAI Labs.

Revision 1.190: download - view: text, markup, annotated - select for diffs
Thu May 2 19:15:52 2002 UTC (9 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +6 -16 lines
Use vop_panic() instead of our home-rolled version.

Revision 1.189: download - view: text, markup, annotated - select for diffs
Mon Apr 1 21:31:12 2002 UTC (9 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +5 -5 lines
Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@

Revision 1.188: download - view: text, markup, annotated - select for diffs
Tue Mar 19 22:40:48 2002 UTC (9 years, 10 months ago) by alfred
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +35 -35 lines
Remove __P.

Revision 1.187: download - view: text, markup, annotated - select for diffs
Sun Mar 17 01:25:47 2002 UTC (9 years, 10 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +1 -1 lines
Add a flags parameter to VFS_VGET to pass through the desired
locking flags when acquiring a vnode. The immediate purpose is
to allow polling lock requests (LK_NOWAIT) needed by soft updates
to avoid deadlock when enlisting other processes to help with
the background cleanup. For the future it will allow the use of
shared locks for read access to vnodes. This change touches a
lot of files as it affects most filesystems within the system.
It has been well tested on FFS, loopback, and CD-ROM filesystems.
only lightly on the others, so if you find a problem there, please
let me (mckusick@mckusick.com) know.

Revision 1.186: download - view: text, markup, annotated - select for diffs
Fri Mar 15 18:49:47 2002 UTC (9 years, 10 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +3 -1 lines
Introduce the new 64-bit size disk block, daddr64_t. Change
the bio and buffer structures to have daddr64_t bio_pblkno,
b_blkno, and b_lblkno fields which allows access to disks
larger than a Terabyte in size. This change also requires
that the VOP_BMAP vnode operation accept and return daddr64_t
blocks. This delta should not affect system operation in
any way. It merely sets up the necessary interfaces to allow
the development of disk drivers that work with these larger
disk block addresses. It also allows for the development of
UFS2 which will use 64-bit block addresses.

Revision 1.185: download - view: text, markup, annotated - select for diffs
Mon Feb 18 16:18:02 2002 UTC (9 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +2 -5 lines
Make v_addpollinfo() visible and non-inline.
Have callers only call it as needed.
Add necessary call in ufs_kqfilter().

Test-case found by:	Andrew Gallatin <gallatin@cs.duke.edu>

Revision 1.184: download - view: text, markup, annotated - select for diffs
Sun Feb 17 21:15:36 2002 UTC (9 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +12 -6 lines
Move the stuff related to select and poll out of struct vnode.
The use of the zone allocator may or may not be overkill.
There is an XXX: over in ufs/ufs/ufs_vnops.c that jlemon may need
to revisit.

This shaves about 60 bytes of struct vnode which on my laptop means
600k less RAM used for vnodes.

Revision 1.183: download - view: text, markup, annotated - select for diffs
Sun Feb 17 21:07:57 2002 UTC (9 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +0 -2 lines
Collect the VN_KNOTE() macro definitions on vnode.h

Revision 1.131.2.7: download - view: text, markup, annotated - select for diffs
Tue Feb 5 18:35:04 2002 UTC (10 years ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7, RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6
Diff to: previous 1.131.2.6: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.6: +4 -5 lines
MFC vfs_subr 1.338 and friends.  When downgrading a filesystem to read-only,
operatings involving file removal and file update were not always being
fully comitted to disk, resulting in corruption.
Approved by:		mckusick

Revision 1.182: download - view: text, markup, annotated - select for diffs
Tue Jan 15 07:17:12 2002 UTC (10 years ago) by mckusick
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +4 -5 lines
When downgrading a filesystem from read-write to read-only, operations
involving file removal or file update were not always being fully
committed to disk. The result was lost files or corrupted file data.
This change ensures that the filesystem is properly synced to disk
before the filesystem is down-graded.

This delta also fixes a long standing bug in which a file open for
reading has been unlinked. When the last open reference to the file
is closed, the inode is reclaimed by the filesystem. Previously,
if the filesystem had been down-graded to read-only, the inode could
not be reclaimed, and thus was lost and had to be later recovered
by fsck.  With this change, such files are found at the time of the
down-grade.  Normally they will result in the filesystem down-grade
failing with `device busy'. If a forcible down-grade is done, then
the affected files will be revoked causing the inode to be released
and the open file descriptors to begin failing on attempts to read.

Submitted by:	"Sam Leffler" <sam@errno.com>

Revision 1.131.2.6: download - view: text, markup, annotated - select for diffs
Fri Dec 14 20:28:52 2001 UTC (10 years, 1 month ago) by jlemon
Branches: RELENG_4
CVS tags: RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5
Diff to: previous 1.131.2.5: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.5: +41 -0 lines
MFC: r1.168,r1.169; kqueue filter updates for ufs.

Revision 1.131.2.5: download - view: text, markup, annotated - select for diffs
Mon Nov 26 20:49:27 2001 UTC (10 years, 2 months ago) by guido
Branches: RELENG_4
Diff to: previous 1.131.2.4: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.4: +2 -2 lines
MFC: When mkdir()-ing, the parent dir gets is linkcount increased.
Fix VN_KNOTE to reflect that.

Revision 1.181: download - view: text, markup, annotated - select for diffs
Thu Nov 22 15:33:12 2001 UTC (10 years, 2 months ago) by guido
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +2 -2 lines
When mkdir()-ing, the parent dir gets is linkcount increased.
Fix VN_KNOTE to reflect that.

Found by: tobez@freebsd.org
MFC after:	2 days

Revision 1.180: download - view: text, markup, annotated - select for diffs
Mon Oct 8 00:37:54 2001 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +17 -2 lines
Remove panics for rename() race conditions.  The panics are inappropriate
because the IN_RENAME flag only fixes a few of the huge number of race
conditions that can result in the source path becoming invalid even
prior to the VOP_RENAME() call.  The panics created a serious security
issue whereby an attacker could fairly easily cause the panic to
occur, crashing the machine.

The correct solution requires a great deal of work in the namei
path cache code.

MFC after:	0 days

Revision 1.179: download - view: text, markup, annotated - select for diffs
Tue Oct 2 04:26:58 2001 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +4 -9 lines
Backout the last commit.  The problem is actually much worse then I
first thought and may require serious work to the VOP_RENAME() api itself.
Basically, by the time the VOP_RENAME() function is called, it's already
too late.

Revision 1.178: download - view: text, markup, annotated - select for diffs
Tue Oct 2 02:58:48 2001 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +9 -4 lines
IN_RENAME should only be cleared by the routine that set it.  This fixes
a rename/rmdir race that has been shown to cause a panic.

Bug reported by: Yevgeniy Aleynikov <eugenea@infospace.com>
MFC after:	3 days

Revision 1.177: download - view: text, markup, annotated - select for diffs
Wed Sep 26 20:44:41 2001 UTC (10 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +2 -2 lines
o Re-enable support of system file flags in jail() by adding back the
  PRISON_ROOT to the suser_xxx() check.  Since securelevels may now
  be raised in specific jails, use of system flags can still be
  restricted in jail(), but in a more configurable way.
o Users of jail() expecting system flags (such as schg) to restrict
  jail()'s should be sure to set the securelevel appropriately in
  jail()'s.
o This fixes activities involving automated system flag removal in
  jail(), including installkernel and friends.

Obtained from:	TrustedBSD Project

Revision 1.176: download - view: text, markup, annotated - select for diffs
Wed Sep 26 20:31:37 2001 UTC (10 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +7 -5 lines
o Modify ufs_setattr() so that it uses securelevel_gt() instead of
  direct variable access.

Obtained from:	TrustedBSD Project

Revision 1.175: download - view: text, markup, annotated - select for diffs
Tue Sep 25 12:02:44 2001 UTC (10 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +5 -4 lines
o Further clarify comment: ad Udo's request, re-insert the 'if'
  refering to securelevels; also, update the unprivileged process text
  to better indicate the scope of actions permittable when any system
  flags are already set (limited).

Submitted by:	Udo Schweigert <udo.schweigert@siemens.com>

Revision 1.174: download - view: text, markup, annotated - select for diffs
Tue Sep 25 02:26:10 2001 UTC (10 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +3 -3 lines
o Parallelize the comment on the relationship between privileged un-jailed
  processes and the actual securelevel check: make the comment use '> 0'
  instead of inverted '<= 0'.

Revision 1.173: download - view: text, markup, annotated - select for diffs
Wed Sep 12 08:38:10 2001 UTC (10 years, 5 months ago) by julian
Branches: MAIN
CVS tags: KSE_MILESTONE_2
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +47 -47 lines
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha

Revision 1.131.2.4: download - view: text, markup, annotated - select for diffs
Tue Aug 28 17:28:49 2001 UTC (10 years, 5 months ago) by iedowse
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4
Diff to: previous 1.131.2.3: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.3: +10 -1 lines
MFC: Ensure that we don't use dirhash on directories that have been
removed.

Approved by:	jkh

Revision 1.172: download - view: text, markup, annotated - select for diffs
Mon Aug 27 06:09:56 2001 UTC (10 years, 5 months ago) by peter
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +3 -1 lines
If a file has been completely unlinked, stop automatically syncing the
file.  ffs will discard any pending dirty pages when it is closed,
so we may as well not waste time trying to clean them.  This doesn't
stop other things from writing it out, eg: pageout, fsync(2) etc.

Revision 1.171: download - view: text, markup, annotated - select for diffs
Sun Aug 26 20:47:19 2001 UTC (10 years, 5 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +9 -1 lines
Stop using dirhash when a directory is removed, and ensure that we
never attempt to hash directories once they are deleted. This fixes
a problem where operations on a deleted directory could trigger
dirhash sanity panics.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Sun Jul 29 22:26:01 2001 UTC (10 years, 6 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +4 -2 lines
Two recent commits in sys/ufs/ufs interacted badly with ext2fs
because it shares ufs code. In ufs_fhtovp(), the test on i_effnlink
is invalid because ext2fs does not maintain this field. In ufs_close(),
i_effnlink is also tested, to determines whether or not to call
vn_start_write(). The ufs_fhtovp issue breaks NFS exporting of
ext2fs filesystems; I believe the other is harmless.

Fix both cases by checking um_i_effnlink_valid in the ufsmount
struct, and use i_nlink if necessary.

Noticed by:	bde
Reviewed by:	mckusick, bde

Revision 1.169: download - view: text, markup, annotated - select for diffs
Wed Jun 6 17:40:57 2001 UTC (10 years, 8 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +20 -1 lines
Add a wrapper for the fifo kqfilter which falls through to the ufs routine.
This permits the fifo to inherit the ufs VNODE kqfilter.

Revision 1.168: download - view: text, markup, annotated - select for diffs
Tue Jun 5 13:52:37 2001 UTC (10 years, 8 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +23 -1 lines
Add a kqueue filter for writing to ufs filesystems which always returns
true.  This permits better interoperability with programs which register
filters on their stdin/stdout handles.

Submitted by: Niels Provos <provos@citi.umich.edu>

Revision 1.167: download - view: text, markup, annotated - select for diffs
Wed May 23 09:42:06 2001 UTC (10 years, 8 months ago) by ru
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +2 -2 lines
- FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION file
  systems were repo-copied from sys/miscfs to sys/fs.

- Renamed the following file systems and their modules:
  fdesc -> fdescfs, portal -> portalfs, union -> unionfs.

- Renamed corresponding kernel options:
  FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS.

- Install header files for the above file systems.

- Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland
  Makefiles.

Revision 1.166: download - view: text, markup, annotated - select for diffs
Tue May 1 09:12:39 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +3 -3 lines
Use ufs_bmaparray() rather than VOP_BMAP() on our own vnodes.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Sun Apr 29 12:36:52 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +2 -2 lines
VOP_BALLOC was never really a VOP in the first place, so convert it
to UFS_BALLOC like the other "between UFS and FFS function interfaces".

Revision 1.164: download - view: text, markup, annotated - select for diffs
Sun Apr 29 02:45:28 2001 UTC (10 years, 9 months ago) by grog
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +1 -3 lines
Revert consequences of changes to mount.h, part 2.

Requested by:	bde

Revision 1.163: download - view: text, markup, annotated - select for diffs
Wed Apr 25 08:11:18 2001 UTC (10 years, 9 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +24 -4 lines
When closing the last reference to an unlinked file, it is freed
by the inactive routine. Because the freeing causes the filesystem
to be modified, the close must be held up during periods when the
filesystem is suspended.

For snapshots to be consistent across crashes, they must write
blocks that they copy and claim those written blocks in their
on-disk block pointers before the old blocks that they referenced
can be allowed to be written.

Close a loophole that allowed unwritten blocks to be skipped when
doing ffs_sync with a request to wait for all I/O activity to be
completed.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Mon Apr 23 09:03:33 2001 UTC (10 years, 9 months ago) by grog
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +3 -1 lines
Correct #includes to work with fixed sys/mount.h.

Revision 1.161: download - view: text, markup, annotated - select for diffs
Tue Apr 17 04:33:34 2001 UTC (10 years, 9 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +3 -3 lines
In my first reading of POSIX.1e, I misinterpreted handling of the
ACL_USER_OBJ and ACL_GROUP_OBJ fields, believing that modification of the
access ACL could be used by privileged processes to change file/directory
ownership.  In fact, this is incorrect; ACL_*_OBJ (+ ACL_MASK and
ACL_OTHER) should have undefined ae_id fields; this commit attempts
to correct that misunderstanding.

o Modify arguments to vaccess_acl_posix1e() to accept the uid and gid
  associated with the vnode, as those can no longer be extracted from
  the ACL passed as an argument.  Perform all comparisons against
  the passed arguments.  This actually has the effect of simplifying
  a number of components of this call, as well as reducing the indent
  level, but now seperates handling of ACL_GROUP_OBJ from ACL_GROUP.

o Modify acl_posix1e_check() to return EINVAL if the ae_id field of
  any of the ACL_{USER_OBJ,GROUP_OBJ,MASK,OTHER} entries is a value
  other than ACL_UNDEFINED_ID.  As a temporary work-around to allow
  clean upgrades, set the ae_id field to ACL_UNDEFINED_ID before
  each check so that this cannot cause a failure in the short term
  (this work-around will be removed when the userland libraries and
  utilities are updated to take this change into account).

o Modify ufs_sync_acl_from_inode() so that it forces
  ACL_{USER_OBJ,GROUP_OBJ,MASK,OTHER} ae_id fields to ACL_UNDEFINED_ID
  when synchronizing the ACL from the inode.

o Modify ufs_sync_inode_from_acl to not propagate uid and gid
  information to the inode from the ACL during ACL update.  Also
  modify the masking of permission bits that may be set from
  ALLPERMS to (S_IRWXU|S_IRWXG|S_IRWXO), as ACLs currently do not
  carry none-ACCESSPERMS (S_ISUID, S_ISGID, S_ISTXT).

o Modify ufs_getacl() so that when it emulates an access ACL from
  the inode, it initializes the ae_id fields to ACL_UNDEFINED_ID.

o Clean up ufs_setacl() substantially since it is no longer possible
  to perform chown/chgrp operations using vop_setacl(), so all the
  access control for that can be eliminated.

o Modify ufs_access() so that it passes owner uid and gid information
  into vaccess_acl_posix1e().

Pointed out by:	jedger
Obtained from:	TrustedBSD Project

Revision 1.160: download - view: text, markup, annotated - select for diffs
Mon Mar 26 17:53:19 2001 UTC (10 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +214 -6 lines
Introduce support for POSIX.1e ACLs on UFS-based file systems.  This
implementation is still experimental, and while fairly broadly tested,
is not yet intended for production use.  Support for POSIX.1e ACLs on
UFS will not be MFC'd to RELENG_4.

This implementation works by providing implementations of VOP_[GS]ETACL()
for FFS, as well as modifying the appropriate access control and file
creation routines.  In this implementation, ACLs are backed into extended
attributes; the base ACL (owner, group, other) permissions remain in the
inode for performance and compatibility reasons, so only the extended and
default ACLs are placed in extended attributes.  The logic for ACL
evaluation is provided by the fs-independent kern/kern_acl.c.

o Introduce UFS_ACL, a compile-time configuration option that enables
  support for ACLs on FFS (and potentially other UFS-based file systems).
o Introduce ufs_getacl(), ufs_setacl(), ufs_aclcheck(), which
  respectively get, set, and check the ACLs on the passed vnode.
o Introduce ufs_sync_acl_from_inode(), ufs_sync_inode_from_acl() to
  maintain access control information between inode permissions and
  extended attribute data.
o Modify ufs_access() to load a file access ACL and invoke
  vaccess_acl_posix1e() if ACLs are available on the file system
o Modify ufs_mkdir() and ufs_makeinode() to associate ACLs with newly
  created directories and files, inheriting from the parent directory's
  default ACL.
o Enable these new vnode operations and conditionally compiled code
  paths if UFS_ACL is defined.

A few notes:

o This implementation is fairly widely tested, but still should be
  considered experimental.
o Currently, ACLs are not exported via NFS, instead, the summarizing
  file mode/etc from the inode is.  This results in conservative
  protection behavior, similar to the behavior of ACL-nonaware programs
  acting locally.
o It is possible that underlying binary data formats associated with
  this implementation may change.  Consumers of the implementation
  should expect to find their local configuration obsoleted in the
  next few months, resulting in possible loss of ACL data during an
  upgrade.
o The extended attributes interface and implementation is still
  undergoing modification to address portable interface concerns, as
  well as performance.
o Many applications do not yet correctly handle ACLs.  In general,
  due to the POSIX.1e ACL model, behavior of ACL-unaware applications
  will be conservative with respects to file protection; some caution
  is recommended.
o Instructions for configuring and maintaining ACLs on UFS will be
  committed in the near future; in the mean time it is possible to
  reference the README included in the last UFS ACL distribution
  placed in the TrustedBSD web site:

      http://www.TrustedBSD.org/downloads/

Substantial debugging, hardware, travel, or connectivity support for this
project was provided by: BSDi, Safeport Network Services, and NAI Labs.
Significant coding contributions were made by Chris Faulhaber.  Additional
support was provided by Brian Feldman, Thomas Moestl, and Ilmar Habibulin.

Reviewed by:	jedgar, keichii, mckusick, trustedbsd-discuss, freebsd-fs
Obtained from:	TrustedBSD Project

Revision 1.159: download - view: text, markup, annotated - select for diffs
Wed Mar 14 18:27:04 2001 UTC (10 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +1 -2 lines
o In my merge, missed the one-line patch to ufs_vnops.c that removed
  the static prototype for ufs_readdir().  Note that ufs_readdir() was
  actually already non-static, the prototype was incorrect.

Submitted by:	jedgar

Revision 1.131.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 04:23:21 2001 UTC (10 years, 11 months ago) by jlemon
Branches: RELENG_4
CVS tags: RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3
Diff to: previous 1.131.2.2: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.2: +87 -1 lines
MFC: sync kq up to current (extend to device layer, plus other fixes)

Revision 1.158: download - view: text, markup, annotated - select for diffs
Fri Feb 23 20:06:01 2001 UTC (10 years, 11 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +14 -1 lines
Add a NOTE_REVOKE flag for vnodes, which is triggered from within vclean().
Use this to tell a filter attached to a vnode that the underlying vnode is
no longer valid, by returning EV_EOF.

PR: kern/25309, kern/25206

Revision 1.157: download - view: text, markup, annotated - select for diffs
Fri Feb 23 19:20:21 2001 UTC (10 years, 11 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +3 -2 lines
Use correct list pointer when detaching knote from list.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Thu Feb 15 16:34:11 2001 UTC (10 years, 11 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +73 -1 lines
Extend kqueue down to the device layer.

Backwards compatible approach suggested by: peter

Revision 1.155: download - view: text, markup, annotated - select for diffs
Fri Feb 9 06:11:40 2001 UTC (11 years ago) by bmilekic
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +7 -7 lines
Change and clean the mutex lock interface.

mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)

Revision 1.131.2.2: download - view: text, markup, annotated - select for diffs
Tue Nov 7 03:09:52 2000 UTC (11 years, 3 months ago) by bde
Branches: RELENG_4
CVS tags: RELENG_4_2_0_RELEASE
Diff to: previous 1.131.2.1: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.2.1: +4 -2 lines
MFC (pass the correct inode number to VFS_VGET() for mknod()).

Approved by:	jkh

Revision 1.154: download - view: text, markup, annotated - select for diffs
Sat Nov 4 08:10:56 2000 UTC (11 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +4 -2 lines
Fixed breakage of mknod() in rev.1.48 of ext2_vnops.c and rev.1.126 of
ufs_vnops.c:

1) i_ino was confused with i_number, so the inode number passed to
   VFS_VGET() was usually wrong (usually 0U).
2) ip was dereferenced after vgone() freed it, so the inode number
   passed to VFS_VGET() was sometimes not even wrong.

Bug (1) was usually fatal in ext2_mknod(), since ext2fs doesn't have
space for inode 0 on the disk; ino_to_fsba() subtracts 1 from the
inode number, so inode number 0U gives a way out of bounds array
index.  Bug(1) was usually harmless in ufs_mknod(); ino_to_fsba()
doesn't subtract 1, and VFS_VGET() reads suitable garbage (all 0's?)
from the disk for the invalid inode number 0U; ufs_mknod() returns
a wrong vnode, but most callers just vput() it; the correct vnode is
eventually obtained by an implicit VFS_VGET() just like it used to be.

Bug (2) usually doesn't happen.

Revision 1.153: download - view: text, markup, annotated - select for diffs
Wed Nov 1 17:57:24 2000 UTC (11 years, 3 months ago) by eivind
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +1 -22 lines
Give vop_mmap an untimely death.  The opportunity to give it a timely
death timed out in 1996.

Revision 1.152: download - view: text, markup, annotated - select for diffs
Sun Oct 29 16:06:56 2000 UTC (11 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +1 -2 lines
Move suser() and suser_xxx() prototypes and a related #define from
<sys/proc.h> to <sys/systm.h>.

Correctly document the #includes needed in the manpage.

Add one now needed #include of <sys/systm.h>.
Remove the consequent 48 unused #includes of <sys/proc.h>.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Thu Oct 19 07:53:59 2000 UTC (11 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +47 -24 lines
o Introduce new VOP_ACCESS() flag VADMIN, allowing file systems to perform
  "administrative" authorization checks.  In most cases, the VADMIN test
  checks to make sure the credential effective uid is the same as the file
  owner.
o Modify vaccess() to set VADMIN as an available right if the uid is
  appropriate.
o Modify references to uid-based access control operations such that they
  now always invoke VOP_ACCESS() instead of using hard-coded policy checks.
o This allows alternative UFS policies to be implemented by replacing only
  ufs_access() (such as mandatory system policies).
o VOP_ACCESS() requires the caller to hold an exclusive vnode lock on the
  vnode: I believe that new invocations of VOP_ACCESS() are always called
  with the lock held.
o Some direct checks of the uid remain, largely associated with the QUOTA
  and SUIDDIR code.

Reviewed by:	eivind
Obtained from:	TrustedBSD Project

Revision 1.150: download - view: text, markup, annotated - select for diffs
Wed Oct 4 01:29:17 2000 UTC (11 years, 4 months ago) by jasone
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +9 -7 lines
Convert lockmgr locks from using simple locks to using mutexes.

Add lockdestroy() and appropriate invocations, which corresponds to
lockinit() and must be called to clean up after a lockmgr lock is no
longer needed.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Mon Sep 25 15:24:04 2000 UTC (11 years, 4 months ago) by bp
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +2 -2 lines
Add a lock structure to vnode structure. Previously it was either allocated
separately (nfs, cd9660 etc) or keept as a first element of structure
referenced by v_data pointer(ffs). Such organization leads to known problems
with stacked filesystems.

From this point vop_no*lock*() functions maintain only interlock lock.
vop_std*lock*() functions maintain built-in v_lock structure using lockmgr().
vop_sharedlock() is compatible with vop_stdunlock(), but maintains a shared
lock on vnode.

If filesystem wishes to export lockmgr compatible lock, it can put an address
of this lock to v_vnlock field. This indicates that the upper filesystem
can take advantage of it and use single lock structure for entire (or part)
of stack of vnodes. This field shouldn't be examined or modified by VFS code
except for initialization purposes.

Reviewed in general by:	mckusick

Revision 1.148: download - view: text, markup, annotated - select for diffs
Mon Sep 18 18:03:49 2000 UTC (11 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +3 -3 lines
o Allow privileged processes in jail() to override sticky bit behavior
  on directories.
o Allow privileged processes in jail() to create inodes with the
  setgid bit set even if they are not a member of the group denoted
  by the file creation gid.  This occurs due to inherited gid's from
  parent directories on file creation, allowing a user to create a
  file with a gid that is not in the creating process's credentials.

Obtained from:	TrustedBSD Project

Revision 1.147: download - view: text, markup, annotated - select for diffs
Mon Sep 18 17:58:15 2000 UTC (11 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +6 -1 lines
o Add a comment clarifying interaction between jail(), privileged processes,
  and UFS file flags.  Here's what the comment says, for reference:

	Privileged processes in jail() are permitted to modify
	arbitrary user flags on files, but are not permitted
	to modify system flags.

  In other words, privilege does allow a process in jail to modify user
  flags for objects that the process does not own, but privilege will
  not permit the setting of system flags on the file.

Obtained from:	TrustedBSD Project

Revision 1.146: download - view: text, markup, annotated - select for diffs
Mon Sep 18 17:53:22 2000 UTC (11 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +2 -2 lines
o Add missing PRISON_ROOT allowing a privileged process in a jail() to not
  remove the setuid/setgid bits by virtue of a change to a file with those
  bits set, even if the process doesn't own the file, or isn't a group
  member of the file's gid.

Obtained from:	TrustedBSD Project

Revision 1.145: download - view: text, markup, annotated - select for diffs
Mon Sep 18 16:13:02 2000 UTC (11 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +6 -5 lines
o Substitute suser() calls for direct credential checks, which is now
  safe as suser() no longer sets ASU.
o Note that in some cases, the PRISON_ROOT flag is used even though no
  process structure is passed, to indicate that if a process structure
  (and hence jail) was available, it would be ok.  In the long run,
  the jail identifier should probably be moved to ucred, as the uidinfo
  information was.
o Some uid 0 checks remain relating to the quota code, which I'll leave
  for another day.

Reviewed by:	phk, eivind
Obtained from:	TrustedBSD Project

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sat Sep 16 18:20:27 2000 UTC (11 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +2 -2 lines
Remove a pointless casting of a gid_t to a gid_t.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Tue Aug 29 14:45:49 2000 UTC (11 years, 5 months ago) by rwatson
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +2 -2 lines
o Restructure vaccess() so as to check for DAC permission to modify the
  object before falling back on privilege.  Make vaccess() accept an
  additional optional argument, privused, to determine whether
  privilege was required for vaccess() to return 0.  Add commented
  out capability checks for reference.  Rename some variables to make
  it more clear which modes/uids/etc are associated with the object,
  and which with the access mode.
o Update file system use of vaccess() to pass NULL as the optional
  privused argument.  Once additional patches are applied, suser()
  will no longer set ASU, so privused will permit passing of
  privilege information up the stack to the caller.

Reviewed by:	bde, green, phk, -security, others
Obtained from:	TrustedBSD Project

Revision 1.142: download - view: text, markup, annotated - select for diffs
Sun Aug 20 08:36:22 2000 UTC (11 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +4 -42 lines
Centralize the canonical vop_access user/group/other check in vaccess().

Discussed with: bde

Revision 1.141: download - view: text, markup, annotated - select for diffs
Wed Jul 26 23:06:57 2000 UTC (11 years, 6 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +15 -5 lines
Clean up the snapshot code so that it no longer depends on the use of
the SF_IMMUTABLE flag to prevent writing. Instead put in explicit
checking for the SF_SNAPSHOT flag in the appropriate places. With
this change, it is now possible to rename and link to snapshot files.
It is also possible to set or clear any of the owner, group, or
other read bits on the file, though none of the write or execute
bits can be set. There is also an explicit test to prevent the
setting or clearing of the SF_SNAPSHOT flag via chflags() or
fchflags(). Note also that the modify time cannot be changed as
it needs to accurately reflect the time that the snapshot was taken.

Submitted by:	Robert Watson <rwatson@FreeBSD.org>

Revision 1.140: download - view: text, markup, annotated - select for diffs
Mon Jul 24 05:28:33 2000 UTC (11 years, 6 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +3 -2 lines
This patch corrects the first round of panics and hangs reported
with the new snapshot code.

Update addaliasu to correctly implement the semantics of the old
checkalias function. When a device vnode first comes into existence,
check to see if an anonymous vnode for the same device was created
at boot time by bdevvp(). If so, adopt the bdevvp vnode rather than
creating a new vnode for the device. This corrects a problem which
caused the kernel to panic when taking a snapshot of the root
filesystem.

Change the calling convention of vn_write_suspend_wait() to be the
same as vn_start_write().

Split out softdep_flushworklist() from softdep_flushfiles() so that
it can be used to clear the work queue when suspending filesystem
operations.

Access to buffers becomes recursive so that snapshots can recursively
traverse their indirect blocks using ffs_copyonwrite() when checking
for the need for copy on write when flushing one of their own indirect
blocks. This eliminates a deadlock between the syncer daemon and a
process taking a snapshot.

Ensure that softdep_process_worklist() can never block because of a
snapshot being taken. This eliminates a problem with buffer starvation.

Cleanup change in ffs_sync() which did not synchronously wait when
MNT_WAIT was specified. The result was an unclean filesystem panic
when doing forcible unmount with heavy filesystem I/O in progress.

Return a zero'ed block when reading a block that was not in use at
the time that a snapshot was taken. Normally, these blocks should
never be read. However, the readahead code will occationally read
them which can cause unexpected behavior.

Clean up the debugging code that ensures that no blocks be written
on a filesystem while it is suspended. Snapshots must explicitly
label the blocks that they are writing during the suspension so that
they do not cause a `write on suspended filesystem' panic.

Reorganize ffs_copyonwrite() to eliminate a deadlock and also to
prevent a race condition that would permit the same block to be
copied twice. This change eliminates an unexpected soft updates
inconsistency in fsck caused by the double allocation.

Use bqrelse rather than brelse for buffers that will be needed
soon again by the snapshot code. This improves snapshot performance.

Revision 1.139: download - view: text, markup, annotated - select for diffs
Tue Jul 11 22:07:56 2000 UTC (11 years, 7 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +4 -1 lines
Add snapshots to the fast filesystem. Most of the changes support
the gating of system calls that cause modifications to the underlying
filesystem. The gating can be enabled by any filesystem that needs
to consistently suspend operations by adding the vop_stdgetwritemount
to their set of vnops. Once gating is enabled, the function
vfs_write_suspend stops all new write operations to a filesystem,
allows any filesystem modifying system calls already in progress
to complete, then sync's the filesystem to disk and returns. The
function vfs_write_resume allows the suspended write operations to
begin again. Gating is not added by default for all filesystems as
for SMP systems it adds two extra locks to such critical kernel
paths as the write system call. Thus, gating should only be added
as needed.

Details on the use and current status of snapshots in FFS can be
found in /sys/ufs/ffs/README.snapshot so for brevity and timelyness
is not included here. Unless and until you create a snapshot file,
these changes should have no effect on your system (famous last words).

Revision 1.138: download - view: text, markup, annotated - select for diffs
Fri May 5 09:59:10 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +2 -1 lines
Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by:    peter

Revision 1.131.2.1: download - view: text, markup, annotated - select for diffs
Fri May 5 03:50:07 2000 UTC (11 years, 9 months ago) by jlemon
Branches: RELENG_4
CVS tags: RELENG_4_1_1_RELEASE, RELENG_4_1_0_RELEASE
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +24 -24 lines
MFC: kqueue() and kevent()

Revision 1.137: download - view: text, markup, annotated - select for diffs
Sun Apr 30 18:52:09 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +1 -2 lines
Remove unneeded #include <vm/vm_zone.h>

Generated by:	src/tools/tools/kerninclude

Revision 1.136: download - view: text, markup, annotated - select for diffs
Sun Apr 16 18:55:20 2000 UTC (11 years, 9 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +24 -23 lines
Replace the POLLEXTEND extensions with the kqueue() mechanism.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Sat Apr 15 05:54:01 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +3 -3 lines
Complete the bio/buf divorce for all code below devfs::strategy

Exceptions:
        Vinum untouched.  This means that it cannot be compiled.
        Greg Lehey is on the case.

        CCD not converted yet, casts to struct buf (still safe)

        atapi-cd casts to struct buf to examine B_PHYS

Revision 1.134: download - view: text, markup, annotated - select for diffs
Sat Apr 15 03:34:26 2000 UTC (11 years, 9 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +2 -1 lines
Introduce extended attribute support for FFS, allowing arbitrary
(name, value) pairs to be associated with inodes.  This support is
used for ACLs, MAC labels, and Capabilities in the TrustedBSD
security extensions, which are currently under development.

In this implementation, attributes are backed to data vnodes in the
style of the quota support in FFS.  Support for FFS extended
attributes may be enabled using the FFS_EXTATTR kernel option
(disabled by default).  Userland utilities and man pages will be
committed in the next batch.  VFS interfaces and man pages have
been in the repo since 4.0-RELEASE and are unchanged.

o ufs/ufs/extattr.h: UFS-specific extattr defines
o ufs/ufs/ufs_extattr.c: bulk of support routines
o ufs/{ufs,ffs,mfs}/*.[ch]: hooks and extattr.h includes
o contrib/softupdates/ffs_softdep.c: extattr.h includes
o conf/options, conf/files, i386/conf/LINT: added FFS_EXTATTR

o coda/coda_vfsops.c: XXX required extattr.h due to ufsmount.h
(This should not be the case, and will be fixed in a future commit)

Currently attributes are not supported in MFS.  This will be fixed.

Reviewed by:	adrian, bp, freebsd-fs, other unthanked souls
Obtained from:	TrustedBSD Project

Revision 1.133: download - view: text, markup, annotated - select for diffs
Sun Apr 2 15:24:53 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +2 -2 lines
Move B_ERROR flag to b_ioflags and call it BIO_ERROR.

(Much of this done by script)

Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.

Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.

Add bio_queue field for struct bio aware disksort.

Address a lot of stylistic issues brought up by bde.

Revision 1.132: download - view: text, markup, annotated - select for diffs
Mon Mar 20 11:29:07 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +3 -3 lines
Rename the existing BUF_STRATEGY() to DEV_STRATEGY()

substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo)

substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo)

This patch is machine generated except for the ccd.c and buf.h parts.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Tue Feb 22 03:56:58 2000 UTC (11 years, 11 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +3 -3 lines
After much consulting with bde, concluded that this fix was the best fix
to the current jail/chflags interactions.  This fix conditionalizes ``root
behavior'' in the chflags() case on not being in jail, so attempts to
perform a chflags in a jail are limited to what a normal user could do.
For example, this does allow setting of user flags as appropriate, but
prohibits changing of system flags.

Reviewed by:	bde

Revision 1.130: download - view: text, markup, annotated - select for diffs
Sun Feb 20 01:10:36 2000 UTC (11 years, 11 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +2 -2 lines
Disable chflags() from within jail() so that root within jail can't make
a mess in securelevel environments.  Results in one warning during
/etc/rc as it attempts to remove file flags, but this is harmless.

Approved by:	High Lord Hubbard

Revision 1.129: download - view: text, markup, annotated - select for diffs
Mon Jan 10 00:24:24 2000 UTC (12 years, 1 month ago) by mckusick
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +46 -22 lines
Several performance improvements for soft updates have been added:
1) Fastpath deletions. When a file is being deleted, check to see if it
   was so recently created that its inode has not yet been written to
   disk. If so, the delete can proceed to immediately free the inode.
2) Background writes: No file or block allocations can be done while the
   bitmap is being written to disk. To avoid these stalls, the bitmap is
   copied to another buffer which is written thus leaving the original
   available for futher allocations.
3) Link count tracking. Constantly track the difference in i_effnlink and
   i_nlink so that inodes that have had no change other than i_effnlink
   need not be written.
4) Identify buffers with rollback dependencies so that the buffer flushing
   daemon can choose to skip over them.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Wed Dec 15 23:02:32 1999 UTC (12 years, 1 month ago) by eivind
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +2 -44 lines
Introduce NDFREE (and remove VOP_ABORTOP)

Revision 1.104.2.3: download - view: text, markup, annotated - select for diffs
Sun Nov 21 16:58:50 1999 UTC (12 years, 2 months ago) by bde
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE, RELENG_3_4_0_RELEASE
Diff to: previous 1.104.2.2: preferred, colored; branchpoint 1.104: preferred, colored; next MAIN 1.105: preferred, colored
Changes since revision 1.104.2.2: +3 -2 lines
MFC (ufs_vnops.c rev.1.125, etc.: fix ext2fs link counts).

Revision 1.127: download - view: text, markup, annotated - select for diffs
Sat Nov 13 20:58:17 1999 UTC (12 years, 2 months ago) by eivind
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +3 -2 lines
Remove WILLRELE from VOP_SYMLINK

Note: Previous commit to these files (except coda_vnops and devfs_vnops)
that claimed to remove WILLRELE from VOP_RENAME actually removed it from
VOP_MKNOD.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Fri Nov 12 03:34:28 1999 UTC (12 years, 3 months ago) by eivind
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +7 -3 lines
Remove WILLRELE from VOP_RENAME

Revision 1.125: download - view: text, markup, annotated - select for diffs
Wed Nov 3 12:05:38 1999 UTC (12 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +3 -2 lines
Quick fix for breakage of ext2fs link counts as reported by stat(2) by
the soft updates changes: only report the link count to be i_effnlink
in ufs_getattr() for file systems that maintain i_effnlink.

Tested by:	Mike Dracopoulos <mdraco@math.uoa.gr>

Revision 1.24.4.6: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:38:56 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_1_0
Diff to: previous 1.24.4.5: preferred, colored; branchpoint 1.24: preferred, colored; next MAIN 1.25: preferred, colored
Changes since revision 1.24.4.5: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.41.2.6: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:24:10 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_2
Diff to: previous 1.41.2.5: preferred, colored; branchpoint 1.41: preferred, colored; next MAIN 1.42: preferred, colored
Changes since revision 1.41.2.5: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.104.2.2: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:33:23 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_3_0_RELEASE
Diff to: previous 1.104.2.1: preferred, colored; branchpoint 1.104: preferred, colored
Changes since revision 1.104.2.1: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sat Aug 28 19:20:56 1999 UTC (12 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +2 -2 lines
remove unused variables.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:52:31 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.122: download - view: text, markup, annotated - select for diffs
Thu Aug 26 14:53:30 1999 UTC (12 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +2 -19 lines
Simplify the handling of VCHR and VBLK vnodes using the new dev_t:

        Make the alias list a SLIST.

        Drop the "fast recycling" optimization of vnodes (including
        the returning of a prexisting but stale vnode from checkalias).
        It doesn't buy us anything now that we don't hardlimit
        vnodes anymore.

        Rename checkalias2() and checkalias() to addalias() and
        addaliasu() - which takes dev_t and udev_t arg respectively.

        Make the revoke syscalls use vcount() instead of VALIASED.

        Remove VALIASED flag, we don't need it now and it is faster
        to traverse the much shorter lists than to maintain the
        flag.

        vfs_mountedon() can check the dev_t directly, all the vnodes
        point to the same one.

Print the devicename in specfs/vprint().

Remove a couple of stale LFS vnode flags.

Remove unimplemented/unused LK_DRAINED;

Revision 1.121: download - view: text, markup, annotated - select for diffs
Mon Aug 23 20:35:21 1999 UTC (12 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +3 -3 lines
Use devtoname() to print dev_t's instead of casting them to long or u_long
for misprinting in %lx format.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sun Aug 22 00:15:16 1999 UTC (12 years, 5 months ago) by jdp
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +19 -10 lines
Support full-precision file timestamps.  Until now, only the seconds
have been maintained, and that is still the default.  A new sysctl
variable "vfs.timestamp_precision" can be used to enable higher
levels of precision:

      0 = seconds only; nanoseconds zeroed (default).
      1 = seconds and nanoseconds, accurate within 1/HZ.
      2 = seconds and nanoseconds, truncated to microseconds.
    >=3 = seconds and nanoseconds, maximum precision.

Level 1 uses getnanotime(), which is fast but can be wrong by up
to 1/HZ.  Level 2 uses microtime().  It might be desirable for
consistency with utimes() and friends, which take timeval structures
rather than timespecs.  Level 3 uses nanotime() for the higest
precision.

I benchmarked levels 0, 1, and 3 by copying a 550 MB tree with
"cpio -pdu".  There was almost negligible difference in the system
times -- much less than 1%, and less than the variation among
multiple runs at the same level.  Bruce Evans dreamed up a torture
test involving 1-byte reads with intervening fstat() calls, but
the cpio test seems more realistic to me.

This feature is currently implemented only for the UFS (FFS and
MFS) filesystems.  But I think it should be easy to support it in
the others as well.

An earlier version of this was reviewed by Bruce.  He's not to
blame for any breakage I've introduced since then.

Reviewed by:	bde (an earlier version of the code)

Revision 1.119: download - view: text, markup, annotated - select for diffs
Fri Aug 13 10:56:02 1999 UTC (12 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +2 -15 lines
Move the special-casing of stat(2)->st_blksize for device files
from UFS to the generic level.  For chr/blk devices we don't care
about the blocksize of the filesystem, we want what the device
asked for.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Fri Aug 13 10:10:12 1999 UTC (12 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +4 -4 lines
s/v_specinfo/v_rdev/

Revision 1.117: download - view: text, markup, annotated - select for diffs
Sun Aug 8 18:43:04 1999 UTC (12 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +2 -2 lines
Decommision miscfs/specfs/specdev.h.  Most of it goes into <sys/conf.h>,
a few lines into <sys/vnode.h>.

Add a few fields to struct specinfo, paving the way for the fun part.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Tue Jul 13 18:20:13 1999 UTC (12 years, 7 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +19 -12 lines
Create the macro DOINGASYNC to check whether the MNT_ASYNC flag has
been set for a mount point. Insert missing checks to ensure that all
write operations are done asynchronously when the MNT_ASYNC option
has been requested.

Submitted by:	Craig A Soules <soules+@andrew.cmu.edu>
Reviewed by:	Kirk McKusick <mckusick@mckusick.com>

Revision 1.115: download - view: text, markup, annotated - select for diffs
Wed Jun 16 23:27:53 1999 UTC (12 years, 7 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +3 -3 lines
Add a vnode argument to VOP_BWRITE to get rid of the last vnode
operator special case. Delete special case code from vnode_if.sh,
vnode_if.src, umap_vnops.c, and null_vnops.c.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Tue May 11 19:55:05 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +3 -3 lines
Divorce "dev_t" from the "major|minor" bitmap, which is now called
udev_t in the kernel but still called dev_t in userland.

Provide functions to manipulate both types:
        major()         umajor()
        minor()         uminor()
        makedev()       umakedev()
        dev2udev()      udev2dev()

For now they're functions, they will become in-line functions
after one of the next two steps in this process.

Return major/minor/makedev to macro-hood for userland.

Register a name in cdevsw[] for the "filedescriptor" driver.

In the kernel the udev_t appears in places where we have the
major/minor number combination, (ie: a potential device: we
may not have the driver nor the device), like in inodes, vattr,
cdevsw registration and so on, whereas the dev_t appears where
we carry around a reference to a actual device.

In the future the cdevsw and the aliased-from vnode will be hung
directly from the dev_t, along with up to two softc pointers for
the device driver and a few houskeeping bits.  This will essentially
replace the current "alias" check code (same buck, bigger bang).

A little stunt has been provided to try to catch places where the
wrong type is being used (dev_t vs udev_t), if you see something
not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if
it makes a difference.  If it does, please try to track it down
(many hands make light work) or at least try to reproduce it
as simply as possible, and describe how to do that.

Without DEVT_FASCIST I belive this patch is a no-op.

Stylistic/posixoid comments about the userland view of the <sys/*.h>
files welcome now, from userland they now contain the end result.

Next planned step: make all dev_t's refer to the same devsw[] which
means convert BLK's to CHR's at the perimeter of the vnodes and
other places where they enter the game (bootdev, mknod, sysctl).

Revision 1.113: download - view: text, markup, annotated - select for diffs
Wed Apr 28 11:38:20 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
CVS tags: PRE_VFS_BIO_NFS_PATCH, POST_VFS_BIO_NFS_PATCH
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +6 -6 lines
This Implements the mumbled about "Jail" feature.

This is a seriously beefed up chroot kind of thing.  The process
is jailed along the same lines as a chroot does it, but with
additional tough restrictions imposed on what the superuser can do.

For all I know, it is safe to hand over the root bit inside a
prison to the customer living in that prison, this is what
it was developed for in fact:  "real virtual servers".

Each prison has an ip number associated with it, which all IP
communications will be coerced to use and each prison has its own
hostname.

Needless to say, you need more RAM this way, but the advantage is
that each customer can run their own particular version of apache
and not stomp on the toes of their neighbors.

It generally does what one would expect, but setting up a jail
still takes a little knowledge.

A few notes:

   I have no scripts for setting up a jail, don't ask me for them.

   The IP number should be an alias on one of the interfaces.

   mount a /proc in each jail, it will make ps more useable.

   /proc/<pid>/status tells the hostname of the prison for
   jailed processes.

   Quotas are only sensible if you have a mountpoint per prison.

   There are no privisions for stopping resource-hogging.

   Some "#ifdef INET" and similar may be missing (send patches!)

If somebody wants to take it from here and develop it into
more of a "virtual machine" they should be most welcome!

Tools, comments, patches & documentation most welcome.

Have fun...

Sponsored by:   http://www.rndassociates.com/
Run for almost a year by:       http://www.servetheweb.com/

Revision 1.112: download - view: text, markup, annotated - select for diffs
Tue Apr 27 11:18:44 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
CVS tags: PRE_SMP_VMSHARE, POST_SMP_VMSHARE
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +6 -6 lines
Suser() simplification:

1:
  s/suser/suser_xxx/

2:
  Add new function: suser(struct proc *), prototyped in <sys/proc.h>.

3:
  s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/

The remaining suser_xxx() calls will be scrutinized and dealt with
later.

There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.

More changes to the suser() API will come along with the "jail" code.

Revision 1.41.2.5: download - view: text, markup, annotated - select for diffs
Wed Mar 10 17:08:27 1999 UTC (12 years, 11 months ago) by imp
Branches: RELENG_2_2
Diff to: previous 1.41.2.4: preferred, colored; branchpoint 1.41: preferred, colored
Changes since revision 1.41.2.4: +6 -1 lines
MFC: Fix link count problems
	ufs_vnops 1.109, 1.110, 1.111
	(also implicitly ext2_vnops.c 1.44)

Revision 1.104.2.1: download - view: text, markup, annotated - select for diffs
Wed Mar 10 16:57:53 1999 UTC (12 years, 11 months ago) by imp
Branches: RELENG_3
CVS tags: RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +6 -1 lines
MFC: Fix link count overflow problems.
	ext2_vnops.c 1.44
	ufs_vnopfs.c 1.109, 1.110, 1.111

Revision 1.111: download - view: text, markup, annotated - select for diffs
Tue Mar 2 05:31:47 1999 UTC (12 years, 11 months ago) by imp
Branches: MAIN
CVS tags: PRE_NEWBUS, POST_NEWBUS
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +2 -2 lines
Merge patch to ufs_vnops.c's ufs_rename to the copy of ufs_rename that
lives in ext2_vnops.c for ext2fs.  Also remove cast from comparision.
Bruce pointed out that it was bogus since we'd force a signed
comparision when we really wanted an unsigned comparison.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Fri Feb 26 05:34:16 1999 UTC (12 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +6 -5 lines
Fix last commit based on feedback from Guido, Bruce and Terry.

Specifically, the test was in the wrong place, lacked a cast, didn't
unlock the node, and exited to bad rather than abortit.  Now we don't
allow renaming of a file with LINK_MAX references.  Move the test to
earlier in the code as it is closer to where ip is obtained, as that
is the style of the rest of the function.

Didn't fix the problems bruce pointed out in the rename man page to
include EMLINK, nor address his complaints about how the whole idea of
incrementing the link count during a rename is potentially asking for
trouble.

Also didn't try to correct potential problem Terry pointed out with
decrements not being similarly protected against underflow.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Thu Feb 25 09:52:46 1999 UTC (12 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +5 -1 lines
Add missing check for LINK_MAX in ufs_rename.  Since ip->i_effnlink and
ip->nlink were different types, there was a masked overflow.

Reported by: Mark Slemco <marcs@znep.com>

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Feb 25 05:35:53 1999 UTC (12 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +14 -7 lines
    Update ufs_vnops code to use new specinfo fields rather then guess.
    This is part of general specinfo / d_parms() commit.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Sat Feb 13 08:38:28 1999 UTC (12 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +3 -3 lines
    Remove XXX comment in regarsd to why NFS doesn't use VOP_ABORT().  NFS
    is being fixed now.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Thu Jan 28 00:57:56 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +11 -11 lines
    Fix warnings in preparation for adding -Wall -Wcast-qual to the
    kernel compile

Revision 1.105: download - view: text, markup, annotated - select for diffs
Thu Jan 21 08:29:09 1999 UTC (13 years ago) by dillon
Branches: MAIN
CVS tags: POST_MATT_SWAPPER
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +4 -1 lines
    This is a rather large commit that encompasses the new swapper,
    changes to the VM system to support the new swapper, VM bug
    fixes, several VM optimizations, and some additional revamping of the
    VM code.  The specific bug fixes will be documented with additional
    forced commits.  This commit is somewhat rough in regards to code
    cleanup issues.

Reviewed by:	"John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>

Revision 1.104: download - view: text, markup, annotated - select for diffs
Thu Jan 7 16:14:19 1999 UTC (13 years, 1 month ago) by bde
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_1_0_RELEASE, PRE_MATT_SWAPPER
Branch point for: RELENG_3
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +9 -18 lines
Don't pass unused unused timestamp args to UFS_UPDATE() or waste
time initializing them.  This almost finishes centralizing (in-core)
timestamp updates in ufs_itimes().

Revision 1.103: download - view: text, markup, annotated - select for diffs
Thu Dec 24 09:45:10 1998 UTC (13 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +19 -7 lines
Fixed null pointer panics which I introduced in rev.1.86.  Vnodes
may be revoked, so vnop routines must be careful about accessing
the vnode if they may have blocked.

Fixed marking for update after successfully reading or writing 0
bytes.  In this case, POSIX.1 specifies marking if and only if the
requested count is nonzero, but rev.1.86 never marked.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sun Dec 20 12:36:01 1998 UTC (13 years, 1 month ago) by dfr
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +3 -3 lines
In ufs_setattr(), if only one of va_atime or va_mtime are != VNOVAL, then
the code set the other field in the inode to VNOVAL.  This can happen
sometimes on an NFS server.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Wed Dec 9 02:06:27 1998 UTC (13 years, 2 months ago) by eivind
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +3 -3 lines
Make compare correct with unsigned types.  (Problem introduced by Lite/2).

Revision 1.41.2.4: download - view: text, markup, annotated - select for diffs
Fri Oct 30 03:47:37 1998 UTC (13 years, 3 months ago) by jkoshy
Branches: RELENG_2_2
CVS tags: RELENG_2_2_8_RELEASE
Diff to: previous 1.41.2.3: preferred, colored; branchpoint 1.41: preferred, colored
Changes since revision 1.41.2.3: +9 -1 lines
MFC: {rev 1.100} Do not allow a mounted on directory to be rmdir'ed.

Requested by:	Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Tested by:	<jkoshy@freebsd>,  <andre.albsmeier@mchp.siemens.de>

Revision 1.100: download - view: text, markup, annotated - select for diffs
Wed Sep 30 00:53:40 1998 UTC (13 years, 4 months ago) by mckusick
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +8 -2 lines
Do not allow a mounted on directory to be rmdir'ed. This removal can
happen when an NFS exported filesystem tries to remove a locally
mounted on directory.
PR:		kern/7272
Submitted by:	Andre Albsmeier <andre.albsmeier@mchp.siemens.de>

Revision 1.99: download - view: text, markup, annotated - select for diffs
Wed Aug 12 21:42:54 1998 UTC (13 years, 6 months ago) by msmith
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +1 -2 lines
"The releaseing of the reference and lock is not temporary and belongs
 where it is.  The reference and lock(s) are acquired just above the
 code in VREF() and relookup()."

Submitted by:	Michael Hancock <michaelh@cet.co.jp>

Revision 1.98: download - view: text, markup, annotated - select for diffs
Wed Aug 12 20:46:47 1998 UTC (13 years, 6 months ago) by julian
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +4 -3 lines
Handle the case of moving a directory onto the top of a sibling's
child of the same name.

Submitted by:	Kirk Mckusick with fixes from luoqi Chen
Obtained from:   Whistle test tree.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Mon Jul 27 15:37:00 1998 UTC (13 years, 6 months ago) by bde
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +1 -3 lines
Made lazy syncing of timestamps for special files non-optional.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Sat Jul 11 07:46:08 1998 UTC (13 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +4 -3 lines
Fixed printf format errors.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Fri Jul 10 00:10:20 1998 UTC (13 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +16 -1 lines
Add code missed in the initial Soft updates integration.
Make the unallocated parts of a directry have a know state
in case we need it later.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sat Jul 4 20:45:40 1998 UTC (13 years, 7 months ago) by julian
Branches: MAIN
CVS tags: PRE_NOBDEV
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +4 -3 lines
VOP_STRATEGY grows an (struct vnode *) argument
as the value in b_vp is often not really what you want.
(and needs to be frobbed). more cleanups will follow this.
Reviewed by: Bruce Evans <bde@freebsd.org>

Revision 1.93: download - view: text, markup, annotated - select for diffs
Fri Jul 3 22:37:43 1998 UTC (13 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +4 -4 lines
Restored revs.1.89-1.90 which I somehow clobbered in rev.1.91.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Fri Jul 3 22:17:03 1998 UTC (13 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +8 -2 lines
Sync timestamp changes for inodes of special files to disk as late
as possible (when the inode is reclaimed).  Temporarily only do
this if option UFS_LAZYMOD configured and softupdates aren't enabled.
UFS_LAZYMOD is intentionally left out of /sys/conf/options.

This is mainly to avoid almost useless disk i/o on battery powered
machines.  It's silly to write to disk (on the next sync or when the
inode becomes inactive) just because someone hit a key or something
wrote to the screen or /dev/null.

PR:		5577
Previous version reviewed by:	phk

Revision 1.91: download - view: text, markup, annotated - select for diffs
Fri Jul 3 18:46:49 1998 UTC (13 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +17 -17 lines
Centralized in-core inode update.  Update the in-core inode directly
in ufs_setattr() so that there is no need to pass timestamps to
UFS_UPDATE() (everything else just needs the current time).  Ignore
the passed-in timestamps in UFS_UPDATE() and always call ufs_itimes()
(was: itimes()) to do the update.  The timestamps are still passed
so that all the callers don't need to be changed yet.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Sat Jun 27 07:28:49 1998 UTC (13 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +3 -3 lines
Make vprint() print dev_t in hex also.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sat Jun 27 06:45:04 1998 UTC (13 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +2 -2 lines
Report the type from the inode, not the vnode.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Mon Jun 8 23:55:33 1998 UTC (13 years, 8 months ago) by julian
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +7 -4 lines
The version of the softdep changes in FreeBSD broke the
(doingdirectory && !newparent) case of ufs_rename().
rename("D1/X/", "D2/Y/") gives a wrong link count for D2.

Submitted by: Bruce Evans <bde@zeta.org.au>
Reviewed by: Kirk McKusick <mckusick@McKusick.COM>

Revision 1.87: download - view: text, markup, annotated - select for diffs
Sun Jun 7 11:04:26 1998 UTC (13 years, 8 months ago) by bde
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +1 -1 lines
Null change.  Forgot to mention in previous log message that MNT_NOATIME
is now ignored for special files, so that mounting root with option
noatime doesn't break reporting of idle times in programs like `w'.
The problem of execessive disk updates just to stamp atimes will be
handled for special files by only writing atimes to disk when inodes
become active.  This works well because special files are relatively
uncommon and their atimes are even more disposable at panic time than
regular files' atimes.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Sun Jun 7 10:49:18 1998 UTC (13 years, 8 months ago) by bde
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +70 -57 lines
Fixed some longstanding timestamp bugs:
1. mark atimes and mtimes of special files and fifos for update upon
   successful completion of non-null i/o, not at the beginning of the
   syscall.
2. never update file times for readonly filesystems.  They were updated
   for stats and closes but not for syncs.  The updates were of course
   only in-core and were thrown away when the inode was uncached, so
   the times sometimes appeared to go backwards.

Improved comments in code related to (1) (mostly by removing them).

Unmacroized ITIMES().  The test in (2) bloated it even more.  Don't
call getmicrotime() in the function version of it when we only need
the time in seconds.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sun May 17 11:53:46 1998 UTC (13 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +2 -2 lines
s/nanoruntime/nanouptime/g
s/microruntime/microuptime/g

Reviewed by:	bde

Revision 1.84: download - view: text, markup, annotated - select for diffs
Thu May 7 04:58:58 1998 UTC (13 years, 9 months ago) by msmith
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +9 -18 lines
In the words of the submitter:

---------
Make callers of namei() responsible for releasing references or locks
instead of having the underlying filesystems do it.  This eliminates
redundancy in all terminal filesystems and makes it possible for stacked
transport layers such as umapfs or nullfs to operate correctly.

Quality testing was done with testvn, and lat_fs from the lmbench suite.

Some NFS client testing courtesy of Patrik Kudo.

vop_mknod and vop_symlink still release the returned vpp.  vop_rename
still releases 4 vnode arguments before it returns.  These remaining cases
will be corrected in the next set of patches.
---------

Submitted by:	Michael Hancock <michaelh@cet.co.jp>

Revision 1.83: download - view: text, markup, annotated - select for diffs
Fri Apr 17 22:37:19 1998 UTC (13 years, 9 months ago) by des
Branches: MAIN
CVS tags: PRE_DEVFS_SLICE, POST_DEVFS_SLICE
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +2 -2 lines
Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Sat Apr 4 13:26:20 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +5 -3 lines
Time changes mark 2:

    * Figure out UTC relative to boottime.  Four new functions provide
      time relative to boottime.

    * move "runtime" into struct proc.  This helps fix the calcru()
      problem in SMP.

    * kill mono_time.

    * add timespec{add|sub|cmp} macros to time.h.  (XXX: These may change!)

    * nanosleep, select & poll takes long sleeps one day at a time

Reviewed by:    bde
Tested by:      ache and others

Revision 1.81: download - view: text, markup, annotated - select for diffs
Mon Mar 30 09:56:37 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +5 -5 lines
Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.

Most uses of time.tv_sec now uses the new variable time_second instead.

gettime() changed to getmicrotime(0.

Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).

A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.

Add a new nfs_curusec() function.

Mark a couple of bogosities involving the now disappeard time variable.

Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.

Change profiling in ncr.c to use ticks instead of time.  Resolution is
the same.

Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.

Reviewed by:	bde

Revision 1.80: download - view: text, markup, annotated - select for diffs
Thu Mar 26 20:54:05 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +26 -5 lines
Add two new functions, get{micro|nano}time.

They are atomic, but return in essence what is in the "time" variable.
gettime() is now a macro front for getmicrotime().

Various patches to use the two new functions instead of the various
hacks used in their absence.

Some puntuation and grammer patches from Bruce.

A couple of XXX comments.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Mar 8 09:59:44 1998 UTC (13 years, 11 months ago) by julian
Branches: MAIN
CVS tags: POST_SOFTUPDATE
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +176 -166 lines
Reviewed by:	dyson@freebsd.org (john Dyson), dg@root.com (david greenman)
Submitted by:	Kirk McKusick (mcKusick@mckusick.com)
Obtained from:  WHistle development tree

Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon Feb 9 06:11:14 1998 UTC (14 years ago) by eivind
Branches: MAIN
CVS tags: PRE_SOFTUPDATE
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +4 -4 lines
Staticize.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Fri Feb 6 12:14:19 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +1 -2 lines
Back out DIAGNOSTIC changes.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Wed Feb 4 22:33:37 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +2 -1 lines
Turn DIAGNOSTIC into a new-style option.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Sat Jan 31 19:28:28 1998 UTC (14 years ago) by julian
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +9 -9 lines
Serves me right for not puting SUIDDIR in LINT.  it got bitrot.
This should stop complaints about it not working for people.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Sat Dec 27 02:56:39 1997 UTC (14 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +3 -1 lines
Unspammed nested include of <vm/vm_zone.h>.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Mon Dec 15 21:51:45 1997 UTC (14 years, 1 month ago) by eivind
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +2 -1 lines
Convert SUIDDIR fully to a new-style option.

Forgotten by: julian

Revision 1.72: download - view: text, markup, annotated - select for diffs
Mon Dec 15 03:09:59 1997 UTC (14 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +18 -1 lines
Add support for poll(2) on files.   vop_nopoll() now returns POLLNVAL
if one of the new poll types is requested; hopefully this will not break
any existing code.  (This is done so that programs have a dependable
way of determining whether a filesystem supports the extended poll types
or not.)

The new poll types added are:

	POLLWRITE - file contents may have been modified
	POLLNLINK - file was linked, unlinked, or renamed
	POLLATTRIB - file's attributes may have been changed
	POLLEXTEND - file was extended

Note that the internal operation of poll() means that it is impossible
for two processes to reliably poll for the same event (this could
be fixed but may not be worth it), so it is not possible to rewrite
`tail -f' to use poll at this time.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Sat Dec 13 12:30:34 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +41 -2 lines
Restored ufs_pathconf() from rev.1.61.  vop_stdpathconf() is too
general to be of much use.  Using it here broke the _PC_NAME_MAX,
_PC_NO_TRUNC and _PC_PATH_MAX cases, and weakened the _PC_MAX_CANON,
_PC_MAX_INPUT and _PC_VDISABLE cases.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Fri Dec 12 14:14:44 1997 UTC (14 years, 2 months ago) by peter
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +22 -25 lines
Fix(?) some style consistancy breakage and do some other nit-picking on
the SUIDDIR changes.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Thu Nov 20 16:08:56 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +9 -8 lines
Fixed marking of access time for special files and fifos (don't do
it if the file system is mounted noatime).  Not fixed: the access
time is marked at the start of a read() and not marked on successful
completion.  I think this should be handled at the vfs level.

Print a better panic message for missing vops.  Don't use printf()
before panic(), since the printf()ed part isn't shown by gdb.
This actually loses a little with the current gdb, since gdb just
prints the fmt arg to panic, so %'s aren't expanded.  gdb should
fetch the full message from the message buffer if possible.

Fixed default vop function for vop_getpages_desc.  It needs to
just return EOPNOTSUPP so that the vnode pager can get the pages
in using a general method.  Panicing broke exec'ing of files on
ext2fs file systems.  ffs works because it doesn't use the default.

Fixed nearby style bugs.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Tue Nov 18 14:20:09 1997 UTC (14 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +1 -110 lines
unifdef -UEXT2FS

Revision 1.67: download - view: text, markup, annotated - select for diffs
Thu Nov 13 01:48:30 1997 UTC (14 years, 3 months ago) by julian
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +7 -7 lines
oops, fix left out semicolon in code I patched by hand.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Thu Nov 13 00:28:51 1997 UTC (14 years, 3 months ago) by julian
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +102 -2 lines
Reviewed by:	hackers@freebsd.org in general
Obtained from: Whistle Communications tree

Add an option to the way UFS works dependent on the SUID bit of directories
This changes makes things a whole lot simpler on systems running as
fileservers for PCs and MACS. to enable the new code you must
1/ enable option SUIDDIR on the kernel.
2/ mount the filesystem with option suiddir.
hopefully this makes it difficult enough for people to
do this accidentally.
see the new chmod(2) man page for detailed info.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Mon Oct 27 13:33:47 1997 UTC (14 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +1 -2 lines
Removed unused #includes.  The need for most of them went away with
recent changes (docluster* and vfs improvements).

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sun Oct 26 20:55:39 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +2 -2 lines
VFS interior redecoration.

Rename vn_default_error to vop_defaultop all over the place.
Move vn_bwrite from vfs_bio.c to vfs_default.c and call it vop_stdbwrite.
Use vop_null instead of nullop.
Move vop_nopoll from vfs_subr.c to vfs_default.c
Move vop_sharedlock from vfs_subr.c to vfs_default.c
Move vop_nolock from vfs_subr.c to vfs_default.c
Move vop_nounlock from vfs_subr.c to vfs_default.c
Move vop_noislocked from vfs_subr.c to vfs_default.c
Use vop_ebadf instead of *_ebadf.
Add vop_defaultop for getpages on master vnode in MFS.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Fri Oct 17 12:36:19 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +10 -60 lines
Make a set of VOP standard lock, unlock & islocked VOP operators, which
depend on the lock being located at vp->v_data.  Saves 3x3 identical
vop procs, more as the other filesystems becomes lock aware.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Thu Oct 16 20:32:39 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +10 -90 lines
Another VFS cleanup "kilo commit"

1.  Remove VOP_UPDATE, it is (also) an UFS/{FFS,LFS,EXT2FS,MFS}
    intereface function, and now lives in the ufsmount structure.

2.  Remove VOP_SEEK, it was unused.

3.  Add mode default vops:

    VOP_ADVLOCK          vop_einval
    VOP_CLOSE            vop_null
    VOP_FSYNC            vop_null
    VOP_IOCTL            vop_enotty
    VOP_MMAP             vop_einval
    VOP_OPEN             vop_null
    VOP_PATHCONF         vop_einval
    VOP_READLINK         vop_einval
    VOP_REALLOCBLKS      vop_eopnotsupp

    And remove identical functionality from filesystems

4.   Add vop_stdpathconf, which returns the canonical stuff.  Use
     it in the filesystems.  (XXX: It's probably wrong that specfs
     and fifofs sets this vop, shouldn't it come from the "host"
     filesystem, for instance ufs or cd9660 ?)

5.   Try to make system wide VOP functions have vop_* names.

6.   Initialize the um_* vectors in LFS.

(Recompile your LKMS!!!)

Revision 1.61: download - view: text, markup, annotated - select for diffs
Thu Oct 16 11:59:09 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +36 -3 lines
Staticize the ufs vnops member functions.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Thu Oct 16 10:50:24 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +8 -26 lines
VFS mega cleanup commit (x/N)

1.  Add new file "sys/kern/vfs_default.c" where default actions for
    VOPs go. Implement proper defaults for ABORTOP, BWRITE, LEASE,
    POLL, REVOKE and STRATEGY.  Various stuff spread over the entire
    tree belongs here.

2.  Change VOP_BLKATOFF to a normal function in cd9660.

3.  Kill VOP_BLKATOFF, VOP_TRUNCATE, VOP_VFREE, VOP_VALLOC.  These
    are private interface functions between UFS and the underlying
    storage manager layer (FFS/LFS/MFS/EXT2FS).  The functions now
    live in struct ufsmount instead.

4.  Remove a kludge of VOP_ functions in all filesystems, that did
    nothing but obscure the simplicity and break the expandability.
    If a filesystem doesn't implement VOP_FOO, it shouldn't have an
    entry for it in its vnops table.  The system will try to DTRT
    if it is not implemented.  There are still some cruft left, but
    the bulk of it is done.

5.  Fix another VCALL in vfs_cache.c (thanks Bruce!)

Revision 1.59: download - view: text, markup, annotated - select for diffs
Wed Oct 15 13:24:07 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +154 -1 lines
vnops megacommit

1.  Use the default function to access all the specfs operations.
2.  Use the default function to access all the fifofs operations.
3.  Use the default function to access all the ufs operations.
4.  Fix VCALL usage in vfs_cache.c
5.  Use VOCALL to access specfs functions in devfs_vnops.c
6.  Staticize most of the spec and fifofs vnops functions.
7.  Make UFS panic if it lacks bits of the underlying storage handling.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sun Sep 21 04:24:14 1997 UTC (14 years, 4 months ago) by dyson
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +10 -10 lines
Change the M_NAMEI allocations to use the zone allocator.  This change
plus the previous changes to use the zone allocator decrease the useage
of malloc by half.  The Zone allocator will be upgradeable to be able
to use per CPU-pools, and has more intelligent usage of SPLs.  Additionally,
it has reasonable stats gathering capabilities, while making most calls
inline.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sun Sep 14 02:58:12 1997 UTC (14 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +1 -19 lines
Convert select -> poll.
Delete 'always succeed' select/poll handlers, replaced with generic call.
Flag missing vnode op table entries.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Tue Sep 2 20:06:59 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +1 -6 lines
Removed unused #includes.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Tue Aug 26 04:36:27 1997 UTC (14 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +1 -9 lines
Back out some incorrect changes that was worse than the original bug.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Fri Aug 22 15:37:23 1997 UTC (14 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +3 -1 lines
Fix the "remove optimization" by removing it.  Sorry for the trouble.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Thu Aug 21 01:42:47 1997 UTC (14 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +7 -1 lines
Performance improvment to minimize delayed write output of files
that have been deleted.
Submitted by:	Peter M. Chen <pmchen@eecs.umich.edu>

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sun Jul 13 16:26:40 1997 UTC (14 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +4 -7 lines
Always mark st_ctime for update upon successful completion of
chown().  Previously, it wasn't marked for null chown()'s.  We
permit null chown()s as a special case of "appropriate privilege"
- everyone has enough priviilege to not change ids (this is a better
argument than the one I gave for rev.1.13, that null changes aren't
really changes).  However, POSIX.1 requires the update independently
of whether anything has changed.

Clear both the setuid and the setgid bits upon successful completion
of non-null chown()s by non-root.  Previously, the setuid bit was
only changed for non-null changes of the uid, etc.  POSIX.1 requires
clearing both unless the call was made by a process with "appropriate
privilege", in which case altering the bits is implementation-defined.
We define appropriate privilege as `process is root, or the change
is null', and the implementation-defined behaviour as not altering
the bits.   There is no interpretation that permits clearing only
one of the bits.

Reviewed by:	jdp

Revision 1.41.2.3: download - view: text, markup, annotated - select for diffs
Sun Jun 29 08:48:50 1997 UTC (14 years, 7 months ago) by julian
Branches: RELENG_2_2
CVS tags: RELENG_2_2_7_RELEASE, RELENG_2_2_6_RELEASE, RELENG_2_2_5_RELEASE
Diff to: previous 1.41.2.2: preferred, colored; branchpoint 1.41: preferred, colored
Changes since revision 1.41.2.2: +11 -7 lines
YAMFC
a flag that is not quite as draconian as IMMUTABLE.
if you never use this, you'll never see it.

Submitted by:	Whistle Communications

Revision 1.51: download - view: text, markup, annotated - select for diffs
Mon Jun 2 06:24:51 1997 UTC (14 years, 8 months ago) by julian
Branches: MAIN
CVS tags: WOLLMAN_MBUF, BP_WOLLMAN_MBUF
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +11 -7 lines
Submitted by:	Whistle Communications (archie Cobbs)

These changes add the ability to specify that a UFS file/directory
cannot be unlinked. This is basically a scaled back version
of the IMMUTABLE flag. The reason is to allow an administrator
to create a directory hierarchy that a group of users
can arbitrarily add/delete files from, but that the hierarchy
itself is safe from removal by them.
If the NOUNLINK definition is set to 0
then this results in no change to what happens normally.
(and results in identical binary (in the kernel)).
It can be proven that if this bit is never set by the admin,
no new behaviour is introduced..
Several "good idea" comments from reviewers plus one grumble
about creeping featurism.

This code is in production in 2.2 based systems

Revision 1.50: download - view: text, markup, annotated - select for diffs
Sat May 17 18:32:53 1997 UTC (14 years, 8 months ago) by phk
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +2 -9 lines
Remove redundant check for vp == dvp (done in VFS before calling).

Revision 1.41.2.2: download - view: text, markup, annotated - select for diffs
Sat May 3 11:06:48 1997 UTC (14 years, 9 months ago) by peter
Branches: RELENG_2_2
CVS tags: RELENG_2_2_2_RELEASE
Diff to: previous 1.41.2.1: preferred, colored; branchpoint 1.41: preferred, colored
Changes since revision 1.41.2.1: +2 -5 lines
Disable overwriting the real owner of symlinks with the directory's owner.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Mon Mar 31 12:02:53 1997 UTC (14 years, 10 months ago) by peter
Branches: MAIN
CVS tags: pre_smp_merge, post_smp_merge
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +2 -5 lines
Treat symlinks as first class citizens with their own uid/gid rather than
as shadows of their containing directory.  This should solve the problem
of users not being able to delete their symlinks from /tmp once and for
all.

Symlinks do not have modes though, they are accessable to everything that
can read the directory (as before).  They are made to show this fact at
lstat time (they appear as mode 0777 always, since that's how the the
lookup routines in the kernel treat them).

More commits will follow, eg: add a real lchown() syscall and man pages.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sat Mar 22 06:53:45 1997 UTC (14 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +5 -5 lines
Fixed some invalid (non-atomic) accesses to `time', mostly ones of the
form `tv = time'.  Use a new function gettime().  The current version
just forces atomicicity without fixing precision or efficiency bugs.
Simplified some related valid accesses by using the central function.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sun Mar 9 06:10:36 1997 UTC (14 years, 11 months ago) by mpp
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +8 -8 lines
Update a number of routines to reflect the actual name
of the routine that caused the panic.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sat Feb 22 09:47:53 1997 UTC (14 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +1 -1 lines
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$.  We are not
ready for it yet.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Thu Feb 13 00:42:10 1997 UTC (14 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +0 -2 lines
Removed FIFO ifdef again (see rev.1.5).

Revision 1.44: download - view: text, markup, annotated - select for diffs
Mon Feb 10 02:21:54 1997 UTC (15 years ago) by dyson
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +136 -130 lines
This is the kernel Lite/2 commit.  There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.

The system boots and can mount UFS filesystems.

Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
		Mount_std mounts will not work until the getfsent
		library routine is changed.

Reviewed by:	various people
Submitted by:	Jeffery Hsu <hsu@freebsd.org>

Revision 1.43: download - view: text, markup, annotated - select for diffs
Tue Jan 14 06:57:11 1997 UTC (15 years ago) by jkh
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +1 -1 lines
Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.

Revision 1.41.2.1: download - view: text, markup, annotated - select for diffs
Wed Nov 6 10:14:01 1996 UTC (15 years, 3 months ago) by phk
Branches: RELENG_2_2
CVS tags: RELENG_2_2_1_RELEASE, RELENG_2_2_0_RELEASE
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +30 -6 lines
Merge from -current

Revision 1.24.4.5: download - view: text, markup, annotated - select for diffs
Mon Nov 4 18:26:47 1996 UTC (15 years, 3 months ago) by jkh
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_7_RELEASE, RELENG_2_1_6_RELEASE, RELENG_2_1_6_1_RELEASE
Diff to: previous 1.24.4.4: preferred, colored; branchpoint 1.24: preferred, colored
Changes since revision 1.24.4.4: +30 -6 lines
As requested by bde:
 These fixes should be in 2.1.6 and 2.2.

  Revision  Changes    Path
  1.42      +30 -6     src/sys/ufs/ufs/ufs_vnops.c

Revision 1.42: download - view: text, markup, annotated - select for diffs
Mon Nov 4 16:05:51 1996 UTC (15 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +30 -6 lines
Fixed some races and misleading comments in ufs_rename().

1. When a directory is renamed to an existing (empty) directory,
it is possible for the target vnode to become the source vnode
underneath you (because another process may complete the same
rename).  It was assumed that this can't happen, and the bogus
errno EINVAL was returned.  This was fairly harmless.

Fix: return ENOENT instead, as if the source directory was renamed
a little earlier.

2. The same metamorphosis is possible for non-directories.  It was
assumed that this can't happen, and the code for handling "just
removing a link name" happened to be used.  This would have worked
except for fatal bugs in the link name removal - the link name was
assumed to still be there, and a null pointer was followed.

Fix: check the result of relookup().  This fixes PR 1930.

Notes:

(a) POSIX seems to say that removing link names shall have no effect.
BSD (4.4Lite2 at least) does something reasonable instead.

(b) The relookup() may find a file unrelated to the original.
Removing this isn't correct.  Consider 3 existing files A, B and
C, and concurrent renames: AB = rename(A, B), another AB, and
CA = rename("c", "a").  If rename() is atomic, then only the
following results are possible:

	AB, AB (fails), CA: A = original C, B = original A, C = gone
	AB, CA, AB:         A = gone,       B = original C, C = gone
	CA, AB, AB (fails): A = gone,       B = original C, C = gone

but ufs_rename() can give:

	A,AB,CA,B (sorta):  A = gone,       B = original A, C = gone

This usually doesn't matter, since getting into a race is usually
an error.
---

These fixes should be in 2.1.6 and 2.2.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Thu Sep 19 18:21:32 1996 UTC (15 years, 4 months ago) by nate
Branches: MAIN
CVS tags: RELENG_2_2_BP
Branch point for: RELENG_2_2
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +8 -8 lines
        In sys/time.h, struct timespec is defined as:

        /*
         * Structure defined by POSIX.4 to be like a timeval.
         */
        struct timespec {
                time_t  ts_sec;         /* seconds */
                long    ts_nsec;        /* and nanoseconds */
        };

        The correct names of the fields are tv_sec and tv_nsec.

Reminded by:	James Drobina <jdrobina@infinet.com>

Revision 1.40: download - view: text, markup, annotated - select for diffs
Tue Sep 3 14:25:27 1996 UTC (15 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +3 -2 lines
Eliminated nested include of <sys/unistd.h> in <sys/file.h> in the kernel.
Include it directly in the few places where it is used.

Reduced some #includes of <sys/file.h> to #includes of <sys/fcntl.h> or
nothing.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Tue Jul 9 16:51:18 1996 UTC (15 years, 7 months ago) by wollman
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +5 -2 lines
Quiet a couple of -Wunused warnings.

Revision 1.24.4.4: download - view: text, markup, annotated - select for diffs
Sat Jun 8 02:06:08 1996 UTC (15 years, 8 months ago) by davidg
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_5_RELEASE
Diff to: previous 1.24.4.3: preferred, colored; branchpoint 1.24: preferred, colored
Changes since revision 1.24.4.3: +11 -3 lines
Brought in fix from rev 1.38: reference count fix for relookup().

Revision 1.38: download - view: text, markup, annotated - select for diffs
Fri Mar 29 12:30:30 1996 UTC (15 years, 10 months ago) by bde
Branches: MAIN
CVS tags: wollman_polling
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +11 -3 lines
Fixed reference counting related to relookup().  relookup() must
be called with the directory referenced, and this reference will
be dropped iff relookup() fails, so the value returned must not be
ignored.

Reviewed by:	davidg

Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Mon Mar 11 19:47:21 1996 UTC (15 years, 11 months ago) by peter
Branches: CSRG
CVS tags: bsd_44_lite_2
Diff to: previous 1.1.1.1: preferred, colored
Changes since revision 1.1.1.1: +233 -293 lines
Import 4.4BSD-Lite2 onto the vendor branch, note that in the kernel, all
files are off the vendor branch, so this should not change anything.

A "U" marker generally means that the file was not changed in between
the 4.4Lite and Lite-2 releases, and does not need a merge.  "C" generally
means that there was a change.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Fri Jan 19 03:59:28 1996 UTC (16 years ago) by dyson
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +2 -1 lines
Eliminated many redundant vm_map_lookup operations for vm_mmap.
Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish
	overhead for merged cache.
Efficiency improvement for vfs_cluster.  It used to do alot of redundant
	calls to cluster_rbuild.
Correct the ordering for vrele of .text and release of credentials.
Use the selective tlb update for 486/586/P6.
Numerous fixes to the size of objects allocated for files.  Additionally,
	fixes in the various pagers.
Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs.
Fixes in the swap pager for exhausted resources.  The pageout code
	will not as readily thrash.
Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into
	page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE),
	thereby improving efficiency of several routines.
Eliminate even more unnecessary vm_page_protect operations.
Significantly speed up process forks.
Make vm_object_page_clean more efficient, thereby eliminating the pause
	that happens every 30seconds.
Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the
	case of filesystems mounted async.
Fix a panic with busy pages when write clustering is done for non-VMIO
	buffers.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Fri Jan 5 18:31:58 1996 UTC (16 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +3 -1 lines
Convert QUOTA to new-style option.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Mon Dec 11 04:57:49 1995 UTC (16 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +2 -6 lines
Changes to support 1Tb filesizes.  Pages are now named by an
(object,index) pair instead of (object,offset) pair.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Nov 19 19:46:23 1995 UTC (16 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +17 -17 lines
Change incorrect '#if EXT2FS' to '#ifdef EXT2FS'

Revision 1.33: download - view: text, markup, annotated - select for diffs
Thu Nov 9 08:14:37 1995 UTC (16 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +3 -3 lines
Introduced a type `vop_t' for vnode operation functions and used
it 1138 times (:-() in casts and a few more times in declarations.
This change is null for the i386.

The type has to be `typedef int vop_t(void *)' and not `typedef
int vop_t()' because `gcc -Wstrict-prototypes' warns about the
latter.  Since vnode op functions are called with args of different
(struct pointer) types, neither of these function types is any use
for type checking of the arg, so it would be preferable not to use
the complete function type, especially since using the complete
type requires adding 1138 casts to avoid compiler warnings and
another 40+ casts to reverse the function pointer conversions before
calling the functions.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sun Nov 5 23:35:58 1995 UTC (16 years, 3 months ago) by dyson
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +121 -5 lines
Changes to existing files for ext2fs support.  The UFS mods need rework
in the future as they are a bit crufty -- but at least the stuff is in the
tree now.

Revision 1.24.4.3: download - view: text, markup, annotated - select for diffs
Thu Oct 26 09:17:50 1995 UTC (16 years, 3 months ago) by davidg
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_0_RELEASE
Diff to: previous 1.24.4.2: preferred, colored; branchpoint 1.24: preferred, colored
Changes since revision 1.24.4.2: +62 -42 lines
Brought in changes from main branch: move FS readonly checks into the
filesystem layer to fix related panics from vgone()'d vnodes.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sun Oct 22 09:32:48 1995 UTC (16 years, 3 months ago) by davidg
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +62 -42 lines
Moved the filesystem read-only check out of the syscalls and into the
filesystem layer, as was done in lite-2. Merged in some other cosmetic
changes while I was at it. Rewrote most of msdosfs_access() to be more
like ufs_access() and to include the FS read-only check.

Obtained from: partially from 4.4BSD-lite2

Revision 1.24.4.2: download - view: text, markup, annotated - select for diffs
Mon Oct 9 07:42:46 1995 UTC (16 years, 4 months ago) by davidg
Branches: RELENG_2_1_0
Diff to: previous 1.24.4.1: preferred, colored; branchpoint 1.24: preferred, colored
Changes since revision 1.24.4.1: +2 -2 lines
Brought in changes from rev 1.30: fix panic with rename("foo/","../../").

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sat Oct 7 10:13:41 1995 UTC (16 years, 4 months ago) by bde
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +2 -2 lines
Return EINVAL instead of panicing for rename("dir1", "dir2/..").

Fixes part of PR 760.

This bug seems to be very old.

Revision 1.24.4.1: download - view: text, markup, annotated - select for diffs
Tue Sep 26 04:08:15 1995 UTC (16 years, 4 months ago) by davidg
Branches: RELENG_2_1_0
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +14 -10 lines
Brought in changes from rev 1.29: fix for rename bug.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat Sep 9 01:43:49 1995 UTC (16 years, 5 months ago) by julian
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +14 -10 lines
Obtained from:4.4lite2
fix a change where a shortcut resulted in teh wrong answer..

e.g.
touch a
touch b
mv a b
resulted in b being removed and a being moved to b

in the shortcut..
touch a
ln a b
mv a b
the wrong link was removed..
leaving a instead of b, giving a different result to when
both files were separate.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Sep 4 00:21:11 1995 UTC (16 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +2 -2 lines
Added VOP_GETPAGES/VOP_PUTPAGES and also the "backwards" block count
for VOP_BMAP.  Updated affected filesystems...

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Aug 28 09:19:17 1995 UTC (16 years, 5 months ago) by julian
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +5 -5 lines
Reviewed by:	julian with quick glances by bruce and others
Submitted by:	terry (terry lambert)
This is  a composite of 3 patch sets submitted by terry.
they are:
New low-level init code that supports loadbal modules better
some cleanups in the namei code to help terry in 16-bit character support
some changes to the mount-root code to make it a little more
modular..

NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able
to test those cases..

certainly mounting root of disk still works just fine..
mfs should work but is untested. (tomorrows task)

The low level init stuff includes a total rewrite of init_main.c
to make it possible for new modules to have an init phase by simply
adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can
be added to the kernel without editing any other files other than the
'files' file.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Tue Aug 1 18:51:02 1995 UTC (16 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +2 -2 lines
Removed my special-case hack for VOP_LINK and fixed the problem with the
wrong vp's ops vector being used by changing the VOP_LINK's argument order.
The special-case hack doesn't go far enough and breaks the generic
bypass routine used in some non-leaf filesystems. Pointed out by Kirk
McKusick.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Jun 28 07:06:55 1995 UTC (16 years, 7 months ago) by davidg
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +11 -11 lines
Fixed VOP_LINK argument order botch.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Tue May 30 08:15:39 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: RELENG_2_1_0_BP, RELENG_2_0_5_RELEASE, RELENG_2_0_5_BP, RELENG_2_0_5
Branch point for: RELENG_2_1_0
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +9 -9 lines
Remove trailing whitespace.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon May 15 07:31:09 1995 UTC (16 years, 9 months ago) by davidg
Branches: MAIN
CVS tags: RELENG_2_0_5_ALPHA
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +3 -2 lines
From Bruce Evans:
I ran into another manifestation of the problem reported in PR 211 and
fixed it. Try this:

as non-root:
	cd /tmp; mkdir x y x/z
as root:
	chown root /tmp/x/z
as non-root:
	cd /tmp/x; mv z ../y		# EACCES as expected
as root:
	cd /tmp/x; mv z ../y		# EINVAL NOT as expected

This is because ufs_rename() sets IN_RENAME and fails to clear it.

Reviewed by:	davidg
Submitted by:	bde

Revision 1.22: download - view: text, markup, annotated - select for diffs
Tue Apr 25 03:32:37 1995 UTC (16 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +9 -5 lines
Fixed the mmap hang fix previously committed so that it works
with options DIAGNOSTIC, and clear up an additional reference
count problem.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Mon Apr 24 05:13:17 1995 UTC (16 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +27 -17 lines
Changes to get rid of ufslk2 hangs when doing read/write to/from
mmap regions that are in the same file as the read/write.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sun Apr 9 06:03:45 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +2 -2 lines
Changes from John Dyson and myself:

Fixed remaining known bugs in the buffer IO and VM system.

vfs_bio.c:
Fixed some race conditions and locking bugs. Improved performance
by removing some (now) unnecessary code and fixing some broken
logic.
Fixed process accounting of # of FS outputs.
Properly handle NFS interrupts (B_EINTR).

(various)
Replaced calls to clrbuf() with calls to an optimized routine
called vfs_bio_clrbuf().

(various FS sync)
Sync out modified vnode_pager backed pages.

ffs_vnops.c:
Do two passes: Sync out file data first, then indirect blocks.

vm_fault.c:
Fixed deadly embrace caused by acquiring locks in the wrong order.

vnode_pager.c:
Changed to use buffer I/O system for writing out modified pages. This
should fix the problem with the modification date previous not getting
updated. Also dramatically simplifies the code. Note that this is
going to change in the future and be implemented via VOP_PUTPAGES().

vm_object.c:
Fixed a pile of bugs related to cleaning (vnode) objects. The performance
of vm_object_page_clean() is terrible when dealing with huge objects,
but this will change when we implement a binary tree to keep the object
pages sorted.

vm_pageout.c:
Fixed broken clustering of pageouts. Fixed race conditions and other
lockup style bugs in the scanning of pages. Improved performance.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Mar 19 13:44:03 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +3 -5 lines
Backed out change to panic call: As Chris just pointed out to me, panic()
does indeed work like printf(). gdb gets the string untranslated for some
reason.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sun Mar 19 09:47:32 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +5 -3 lines
Fix a call to panic: panic doesn't do token substitution on the panic
string.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Thu Mar 16 18:17:01 1995 UTC (16 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +1 -6 lines
Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'.  Fix all the bugs found.  There were no serious
ones.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Mar 11 22:23:14 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +1 -3 lines
Removed gratuitous and *extremely* evil setting of OBJ_INTERNAL. This
caused a cascade of problems including kernel memory corruption, file
corruption, system hangs, and panics.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Tue Feb 14 06:12:26 1995 UTC (16 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +2 -1 lines
YF fix.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Mon Jan 9 16:05:27 1995 UTC (17 years, 1 month ago) by davidg
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +5 -1 lines
These changes embody the support of the fully coherent merged VM buffer cache,
much higher filesystem I/O performance, and much better paging performance. It
represents the culmination of over 6 months of R&D.

The majority of the merged VM/cache work is by John Dyson.

The following highlights the most significant changes. Additionally, there are
(mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to
support the new VM/buffer scheme.

vfs_bio.c:
Significant rewrite of most of vfs_bio to support the merged VM buffer cache
scheme.  The scheme is almost fully compatible with the old filesystem
interface.  Significant improvement in the number of opportunities for write
clustering.

vfs_cluster.c, vfs_subr.c
Upgrade and performance enhancements in vfs layer code to support merged
VM/buffer cache.  Fixup of vfs_cluster to eliminate the bogus pagemove stuff.

vm_object.c:
Yet more improvements in the collapse code.  Elimination of some windows that
can cause list corruption.

vm_pageout.c:
Fixed it, it really works better now.  Somehow in 2.0, some "enhancements"
broke the code.  This code has been reworked from the ground-up.

vm_fault.c, vm_page.c, pmap.c, vm_object.c
Support for small-block filesystems with merged VM/buffer cache scheme.

pmap.c vm_map.c
Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of
kernel PTs.

vm_glue.c
Much simpler and more effective swapping code.  No more gratuitous swapping.

proc.h
Fixed the problem that the p_lock flag was not being cleared on a fork.

swap_pager.c, vnode_pager.c
Removal of old vfs_bio cruft to support the past pseudo-coherency.  Now the
code doesn't need it anymore.

machdep.c
Changes to better support the parameter values for the merged VM/buffer cache
scheme.

machdep.c, kern_exec.c, vm_glue.c
Implemented a seperate submap for temporary exec string space and another one
to contain process upages. This eliminates all map fragmentation problems
that previously existed.

ffs_inode.c, ufs_inode.c, ufs_readwrite.c
Changes for merged VM/buffer cache.  Add "bypass" support for sneaking in on
busy buffers.

Submitted by:	John Dyson and David Greenman

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Nov 26 19:38:30 1994 UTC (17 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -2 lines
Submitted by:  Kirk McKusick

Allow chown() to return success if the gid isn't changed even if
the gid is not the caller's.  Such gids are normal for files created
in world-writable directories sucj as /tmp.  This "fixes" annoying
error messages for mv'ing files created in /tmp to another file
system.  mv still preserves the foreign gid of /tmp, but now does
it silently.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Fri Oct 21 01:19:25 1994 UTC (17 years, 3 months ago) by wollman
Branches: MAIN
CVS tags: RELEASE_2_0, OLAH_TTCP, BETA_2_0, ALPHA_2_0
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +6 -1 lines
Make my ALLDEVS kernel compile (basically, LINT minus a lot of options).

This involves fixing a few things I broke last time.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Sat Oct 15 04:14:23 1994 UTC (17 years, 4 months ago) by ache
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +4 -1 lines
Add back variable declaration removed by wrong previous cleanups

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sat Oct 8 06:57:29 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +4 -1 lines
POSSIBLE BOGUS CODE found, (related to dos-partitions) in ufs_disksubr.c,
look for CC_WALL.
Cosmetics, a couple of unused vars.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Oct 8 01:41:15 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +58 -37 lines
Cosmetics.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Thu Oct 6 21:07:04 1994 UTC (17 years, 4 months ago) by davidg
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -3 lines
Use tsleep() rather than sleep so that 'ps' is more informative about
the wait.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Wed Sep 28 16:45:22 1994 UTC (17 years, 4 months ago) by dfr
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +41 -1 lines
Make NFS ask the filesystems for directory cookies instead of making them
itself.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Sep 27 20:33:37 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +1 -155 lines
Moved the "relookup" routine into vfs_lookup.c from ufs/ufs/ufs_vnops.c.
Several FS's use this, so it doesn't belong in ufs.  (unionfs, msdosfs and ufs)

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Sep 22 19:38:41 1994 UTC (17 years, 4 months ago) by wollman
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +1 -9 lines
More loadable VFS changes:

- Make a number of filesystems work again when they are statically compiled
  (blush)

- FIFOs are no longer optional; ``options FIFO'' removed from distributed
  config files.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Aug 8 17:31:01 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +3 -76 lines
Made lockf advisory locking code generic (rather than ufs specific), and
use it in NFS. This is required both for diskless support and for POSIX
compliance. Note: the support in NFS is only for the local node.

Submitted by:	based on work originally done by Yuval Yurom

Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Aug 2 07:55:03 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -0 lines
Added $Id$

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed May 25 09:17:59 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +4 -1 lines
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Tue May 24 10:09:35 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: CSRG
CVS tags: bsd_44_lite, REL_before_johndavid_2_0_0
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
BSD 4.4 Lite Kernel Sources

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue May 24 10:09:34 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options