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

CVS log for src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

[BACK] Up to [FreeBSD] / src / sys / cddl / contrib / opensolaris / uts / common / fs / zfs

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.96.2.1: download - view: text, markup, annotated - select for diffs
Tue Jan 10 07:46:35 2012 UTC (4 weeks, 4 days ago) by dim
Branches: RELENG_9
Diff to: previous 1.96: preferred, colored; next MAIN 1.97: preferred, colored
Changes since revision 1.96: +1 -1 lines
SVN rev 229925 on 2012-01-10 07:46:35Z by dim

MFC r229425:

In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the
the number of links against LINK_MAX (which is INT16_MAX), not against
UINT32_MAX.  Otherwise, the constant would implicitly be converted to
-1.

Reviewed by:	pjd

Revision 1.98: download - view: text, markup, annotated - select for diffs
Tue Jan 3 20:53:07 2012 UTC (5 weeks, 4 days ago) by dim
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +1 -1 lines
SVN rev 229425 on 2012-01-03 20:53:07Z by dim

In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the
the number of links against LINK_MAX (which is INT16_MAX), not against
UINT32_MAX.  Otherwise, the constant would implicitly be converted to
-1.

Reviewed by:	pjd
MFC after:	1 week

Revision 1.97: download - view: text, markup, annotated - select for diffs
Sun Dec 18 12:19:03 2011 UTC (7 weeks, 6 days ago) by pjd
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +1 -1 lines
SVN rev 228685 on 2011-12-18 12:19:03Z by pjd

Implement replying of ACLs updates. ACL changes should go to ZIL only
if the 'sync' property is set to 'always', so replying them is not common.

MFC after:	1 month

Revision 1.96: download - view: text, markup, annotated - select for diffs
Tue Sep 6 10:30:11 2011 UTC (5 months ago) by kib
Branches: MAIN
CVS tags: RELENG_9_BP, RELENG_9_0_BP, RELENG_9_0_0_RELEASE, RELENG_9_0
Branch point for: RELENG_9
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +1 -2 lines
SVN rev 225418 on 2011-09-06 10:30:11Z by kib

Split the vm_page flags PG_WRITEABLE and PG_REFERENCED into atomic
flags field. Updates to the atomic flags are performed using the atomic
ops on the containing word, do not require any vm lock to be held, and
are non-blocking. The vm_page_aflag_set(9) and vm_page_aflag_clear(9)
functions are provided to modify afalgs.

Document the changes to flags field to only require the page lock.

Introduce vm_page_reference(9) function to provide a stable KPI and
KBI for filesystems like tmpfs and zfs which need to mark a page as
referenced.

Reviewed by:    alc, attilio
Tested by:      marius, flo (sparc64); andreast (powerpc, powerpc64)
Approved by:	re (bz)

Revision 1.46.2.40: download - view: text, markup, annotated - select for diffs
Fri Sep 2 07:37:55 2011 UTC (5 months, 1 week ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.39: preferred, colored; branchpoint 1.46: preferred, colored; next MAIN 1.47: preferred, colored
Changes since revision 1.46.2.39: +2 -10 lines
SVN rev 225320 on 2011-09-02 07:37:55Z by mm

MFC r207662 (trasz):
Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize().

Revision 1.46.2.39: download - view: text, markup, annotated - select for diffs
Thu Aug 18 07:34:11 2011 UTC (5 months, 3 weeks ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.38: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.38: +3 -2 lines
SVN rev 224959 on 2011-08-18 07:34:11Z by mm

MFC r224605:
Fix panic in zfs_read() if IO_SYNC flag supplied by checking for
zfsvfs->z_log before calling zil_commit(). [1]
Do not call zfs_read() from zfs_getextattr() with the IO_SYNC flag.

Submitted by:	Alexander Zagrebin <alex@zagrebin.ru> [1]
Reviewed by:	pjd

Revision 1.46.2.38: download - view: text, markup, annotated - select for diffs
Wed Aug 3 18:11:53 2011 UTC (6 months, 1 week ago) by delphij
Branches: RELENG_8
Diff to: previous 1.46.2.37: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.37: +16 -5 lines
SVN rev 224636 on 2011-08-03 18:11:53Z by delphij

MFC r224231,224251-224252:

Make ZFS work better with respect to device nodes.

PR:		kern/159010

Revision 1.95: download - view: text, markup, annotated - select for diffs
Tue Aug 2 11:28:33 2011 UTC (6 months, 1 week ago) by mm
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +3 -2 lines
SVN rev 224605 on 2011-08-02 11:28:33Z by mm

Fix panic in zfs_read() if IO_SYNC flag supplied by checking for
zfsvfs->z_log before calling zil_commit(). [1]
Do not call zfs_read() from zfs_getextattr() with the IO_SYNC flag.

Submitted by:	Alexander Zagrebin <alex@zagrebin.ru> [1]
Reviewed by:	pjd@
Approved by:	re (kib)
MFC after:	3 days

Revision 1.46.2.37: download - view: text, markup, annotated - select for diffs
Mon Aug 1 08:14:16 2011 UTC (6 months, 1 week ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.36: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.36: +2 -1 lines
SVN rev 224564 on 2011-08-01 08:14:16Z by mm

MFC 224174:
Resurrect the ZFS "aclmode" property
Change default of "aclmode" to "discard".

Illumos-gate changeset:	13370:8c04143bd318

Obtained from:	Illumos (Feature #742)

Revision 1.94: download - view: text, markup, annotated - select for diffs
Thu Jul 21 20:02:22 2011 UTC (6 months, 3 weeks ago) by delphij
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +9 -2 lines
SVN rev 224252 on 2011-07-21 20:02:22Z by delphij

Bring the code more in-line with OpenSolaris source to
ease future port.

Reviewed by:	pjd, mm
Approved by:	re (kib)

Revision 1.93: download - view: text, markup, annotated - select for diffs
Thu Jul 21 20:01:51 2011 UTC (6 months, 3 weeks ago) by delphij
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +7 -3 lines
SVN rev 224251 on 2011-07-21 20:01:51Z by delphij

A different implementation of r224231 proposed by pjd@,
which does not require change in the znode structure.
Specifically, it queries rdev from the znode in the
same sa_bulk_lookup already done in zfs_getattr().

Submitted by:	pjd (with some revisions)
Reviewed by:	pjd, mm
Approved by:	re (kib)

Revision 1.92: download - view: text, markup, annotated - select for diffs
Wed Jul 20 16:53:32 2011 UTC (6 months, 3 weeks ago) by delphij
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +1 -1 lines
SVN rev 224231 on 2011-07-20 16:53:32Z by delphij

Add a new field to in-core znode, z_rdev, to represent device nodes.

PR:		kern/159010
Reviewed by:	mm@
Approved by:	re (kib)
MFC after:	2 weeks

Revision 1.91: download - view: text, markup, annotated - select for diffs
Mon Jul 18 07:16:44 2011 UTC (6 months, 3 weeks ago) by mm
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +2 -1 lines
SVN rev 224174 on 2011-07-18 07:16:44Z by mm

Resurrect the ZFS "aclmode" property
Change default of "aclmode" to "discard".

Illumos-gate changeset:	13370:8c04143bd318

Obtained from:	Illumos (Feature #742)
MFC after:	2 weeks

Revision 1.46.2.36: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:36:46 2011 UTC (8 months, 1 week ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.35: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.35: +1984 -670 lines
SVN rev 222741 on 2011-06-06 09:36:46Z by mm

MFC ZFS version 28 and related revisions:
208682, 211900, 212543, 213791, 216378, 218007, 218725, 219089, 219090,
219092, 219316, 219317, 219320, 219404, 219636, 219703, 219959, 219973,
220447, 220575, 221112, 221177, 221263, 221409, 222050, 222267, 222268

MFC r208682 (pjd):
Fix panic when reading label from provider with non power of 2 sector size.

MFC r211900 (pjd):
Use ZFS_CTLDIR_NAME instead of hardcoding ".zfs".

MFC r212543 (imp):
Simplify atomic selection

MFC r213791 (rpaulo):
Pass a format string to panic() and to taskqueue_start_threads().

Found with:	clang

MFC r216378 (pjd):
Remove redundant semicolon and empty like.

MFC r218007 (jchandra):
CDDL fixes for MIPS n32.

Provide 64 bit atomic ops, and use 32 bit pointer.

MFC r218725 (dim):
When building libzpool on ia64 or sparc64, don't add the .note.GNU-stack
section.

MFC r219089 (pjd):
Finally... Import the latest open-source ZFS version - (SPA) 28.

Few new things available from now on:

- Data deduplication.
- Triple parity RAIDZ (RAIDZ3).
- zfs diff.
- zpool split.
- Snapshot holds.
- zpool import -F. Allows to rewind corrupted pool to earlier
  transaction group.
- Possibility to import pool in read-only mode.

MFC r219090 (pjd):
Commit two more files missed in r219089.

MFC r219092 (pjd):
Use proper lock in assertion.

MFC r219316 (pjd):
Simplify zvol_remove_minors() a bit.

MFC r219317 (pjd):
Make renaming of a ZVOL, ZVOL's parent directory and ZVOL snapshot work.

MFC r219320 (pjd):
Fix libzpool build.

MFC r219404 (pjd):
Correct readdir over ZFS handling.

MFC r219636 (pjd):
Fix potential panic in dbuf_sync_list() relate to spill blocks handling.

MFC r219703 (ae):
The size of zfsboot2 grown up to 64 Kbytes in r219089.
Increase NSECT up to 128 sectors too.

MFC r219959 (pjd):
Properly print characters larger than 127.

MFC r219973 (pjd):
Checking file access on size change is bogus. The checks are done earlier by
VFS where we know if this is truncate(2) or ftruncate(2). If this is the
latter we should depend on the mode the file was opened and not on the current
permission.

MFC r220447 (mm):
Partially fix ZFS compat code for sparc64.
Some endianess bugs still need to be resolved.

MFC r220575 (pjd):
Fix 'zfs list <path>' handling. If the path was found, the 'ret' variable was
uninitialized.

MFC r221112 (marcel):
Fix copy-paste bug.

MFC r221177 (jhb):
Due to space constraints, the UFS boot2 and boot1 use an evil hack where
boot2 calls back into boot1 to perform disk reads.  The ZFS MBR boot blocks
do not have the same space constraints, so remove this hack for ZFS.
While here, remove commented out code to support C/H/S addressing from
zfsldr.  The ZFS and GPT bootstraps always just use EDD LBA addressing.

MFC r221263 (mm):
Fix deduplicated zfs receive
(dmu_recv_stream builds incomplete guid_to_ds_map)

Illumos-gate changeset: 13329:c48b8bf84ab7

MFC r221409 (marius):
Convert the last use of xcopyout() to ddi_copyout() and remove the now
unused xcopyin() as well as xcopyout().

MFC r222050 (mm):
Restore old (v15) behaviour for a recursive snapshot destroy.
(zfs destroy -r pool/dataset@snapshot)

To destroy all descendent snapshots with the same name the top level
snapshot was not required to exist. So if the top level snapshot does
not exist, check permissions of the parent dataset instead.

Filed as Illumos Bug #1043

MFC r222267 (pjd):
Don't access task structure once we call task function.
The task structure might be no longer available.
This also allows to eliminates the need for two tasks in the zio structure.

MFC r222268 (pjd):
Don't pass pointer to name buffer which is on the stack to another thread,
because the stack might be paged out once the other thread tries to use the
data. Instead, just allocate memory.

Discussed with:		pjd

Revision 1.90: download - view: text, markup, annotated - select for diffs
Thu Mar 24 20:28:09 2011 UTC (10 months, 2 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +0 -5 lines
SVN rev 219973 on 2011-03-24 20:28:09Z by pjd

Checking file access on size change is bogus. The checks are done earlier by
VFS where we know if this is truncate(2) or ftruncate(2). If this is the
latter we should depend on the mode the file was opened and not on the current
permission.

PR:		standards/154873
Reported by:	Mark Martinec <Mark.Martinec@ijs.si>
Discussed with:	Eric Schrock <eric.schrock@delphix.com>
Discussed with:	Mark Maybee <Mark.Maybee@Oracle.COM>
MFC after:	1 month

Revision 1.89: download - view: text, markup, annotated - select for diffs
Tue Mar 8 18:39:41 2011 UTC (11 months ago) by pjd
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +8 -11 lines
SVN rev 219404 on 2011-03-08 18:39:41Z by pjd

Correct readdir over ZFS handling.

Reported by:	Pierre Beyssac <pb@fasterix.frmug.org>
MFC after:	1 month

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sun Feb 27 19:41:40 2011 UTC (11 months, 2 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +1979 -685 lines
SVN rev 219089 on 2011-02-27 19:41:40Z by pjd

Finally... Import the latest open-source ZFS version - (SPA) 28.

Few new things available from now on:

- Data deduplication.
- Triple parity RAIDZ (RAIDZ3).
- zfs diff.
- zpool split.
- Snapshot holds.
- zpool import -F. Allows to rewind corrupted pool to earlier
  transaction group.
- Possibility to import pool in read-only mode.

MFC after:	1 month

Revision 1.46.2.35: download - view: text, markup, annotated - select for diffs
Fri Feb 18 09:47:58 2011 UTC (11 months, 3 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.46.2.34: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.34: +8 -2 lines
SVN rev 218795 on 2011-02-18 09:47:58Z by kib

MFC r218550:
For UIO_NOCOPY case of reading request on zfs vnode, which has vm object
attached, activate the page after the successful read, and free the page
if read was unsuccessfull.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Fri Feb 11 10:46:15 2011 UTC (12 months ago) by kib
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +8 -2 lines
SVN rev 218550 on 2011-02-11 10:46:15Z by kib

For UIO_NOCOPY case of reading request on zfs vnode, which has vm object
attached, activate the page after the successful read, and free the page
if read was unsuccessfull.

Freshly allocated page is not on any queue yet, and not activating (or
deactivating) the page leaves it on no queue, excluding the page from
pagedaemon scans and making the memory disappeared until the vnode
reclaimed.

Reviewed by:	avg
MFC after:	1 week

Revision 1.46.2.34: download - view: text, markup, annotated - select for diffs
Mon Jan 3 19:23:43 2011 UTC (13 months, 1 week ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.33: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.33: +12 -0 lines
SVN rev 216927 on 2011-01-03 19:23:43Z by mm

MFC r207745 (trasz):

Enforce RLIMIT_FSIZE in ZFS.

Note: original implementation without vn_rlimit_fsize (pre-r207662)

Reviewed by:	trasz
Approved by:	pjd

Revision 1.86: download - view: text, markup, annotated - select for diffs
Sat Dec 11 13:35:25 2010 UTC (14 months ago) by pjd
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +1 -2 lines
SVN rev 216378 on 2010-12-11 13:35:25Z by pjd

Remove redundant semicolon and empty like.

Revision 1.46.2.33: download - view: text, markup, annotated - select for diffs
Sun Nov 28 12:26:15 2010 UTC (14 months, 2 weeks ago) by avg
Branches: RELENG_8
CVS tags: RELENG_8_2_BP, RELENG_8_2_0_RELEASE, RELENG_8_2
Diff to: previous 1.46.2.32: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.32: +15 -4 lines
SVN rev 215995 on 2010-11-28 12:26:15Z by avg

MFC r215401: zfs+sendfile: populate all requested pages, not just those
already cached

Revision 1.31.2.12: download - view: text, markup, annotated - select for diffs
Sun Nov 28 10:05:26 2010 UTC (14 months, 2 weeks ago) by mm
Branches: RELENG_7
CVS tags: RELENG_7_4_BP, RELENG_7_4_0_RELEASE, RELENG_7_4
Diff to: previous 1.31.2.11: preferred, colored; next MAIN 1.32: preferred, colored
Changes since revision 1.31.2.11: +21 -4 lines
SVN rev 215993 on 2010-11-28 10:05:26Z by mm

MFC r213634, r213673:

MFC r213634:
Change FAPPEND to IO_APPEND as this is a ioflag and not a fflag.
This corrects writing to append-only files on ZFS.

MFC r213673 (pjd):
Provide internal ioflags() function that converts ioflag provided by FreeBSD's
VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write
operations.

PR:		kern/149495 [1], kern/151082 [2]
Submitted by:	Daniel Zhelev <daniel@zhelev.biz> [1], Michael Naef <cal@linu.gs> [2]
Reviewed by:	mm (r213673)
Approved by:	delphij (mentor)

Revision 1.46.2.32: download - view: text, markup, annotated - select for diffs
Sun Nov 28 09:52:06 2010 UTC (14 months, 2 weeks ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.31: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.31: +21 -4 lines
SVN rev 215992 on 2010-11-28 09:52:06Z by mm

MFC r213634, r213673:

MFC r213634:
Change FAPPEND to IO_APPEND as this is a ioflag and not a fflag.
This corrects writing to append-only files on ZFS.

MFC r213673 (pjd):
Provide internal ioflags() function that converts ioflag provided by FreeBSD's
VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write
operations.

PR:		kern/149495 [1], kern/151082 [2]
Submitted by:	Daniel Zhelev <daniel@zhelev.biz> [1], Michael Naef <cal@linu.gs> [2]
Reviewed by:	mm (r213673)
Approved by:	delphij (mentor)

Revision 1.85: download - view: text, markup, annotated - select for diffs
Tue Nov 16 15:53:44 2010 UTC (14 months, 3 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +14 -4 lines
SVN rev 215401 on 2010-11-16 15:53:44Z by avg

zfs+sendfile: populate all requested pages, not just those already cached

kern_sendfile() uses vm_rdwr() to read-ahead blocks of data to populate
page cache.  When sendfile stumbles upon a page that is not populated
yet, it sends out all the mbufs that it collected so far.  This
resulted in very poor performance with ZFS when file data is not in the
page cache, because ZFS vop_read for UIO_NOCOPY case populated only
those pages that are already in cache, but not valid.  Which means that
most of the time it populated only the first requested page in the
described above scenario.

Reported by:	Alexander Zagrebin <alexz@visp.ru>
Tested by:	Alexander Zagrebin <alexz@visp.ru>,
		Artemiev Igor <ai@kliksys.ru>
MFC after:	12 days

Revision 1.46.2.31: download - view: text, markup, annotated - select for diffs
Tue Nov 9 19:43:45 2010 UTC (15 months ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.30: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.30: +19 -1 lines
SVN rev 215048 on 2010-11-09 19:43:45Z by mm

MFC r214378:

Bugfix merge from OpenSolaris:

OpenSolaris onnv-revision:	10209:91f47f0e7728
6830541	zfs_get_data_trips on a verify
6696242	multiple zfs_fillpage() zfs: accessing past end of object panics
6785914	zfs fails to drop dn_struct_rwlock in recovery code path

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6830541, 6696242, 6785914)

Revision 1.46.2.30: download - view: text, markup, annotated - select for diffs
Sun Nov 7 19:32:03 2010 UTC (15 months ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.29: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.29: +2 -3 lines
SVN rev 214941 on 2010-11-07 19:32:03Z by avg

Followup to r214936: zfs_getpages: account for differences from head
in page locking

Revision 1.46.2.29: download - view: text, markup, annotated - select for diffs
Sun Nov 7 18:21:42 2010 UTC (15 months ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.28: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.28: +91 -0 lines
SVN rev 214936 on 2010-11-07 18:21:42Z by avg

MFC r213937: zfs: add vop_getpages method implementation

Revision 1.84: download - view: text, markup, annotated - select for diffs
Tue Oct 26 15:48:03 2010 UTC (15 months, 2 weeks ago) by mm
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +19 -1 lines
SVN rev 214378 on 2010-10-26 15:48:03Z by mm

Bugfix merge from OpenSolaris:

OpenSolaris onnv-revision:	10209:91f47f0e7728
6830541	zfs_get_data_trips on a verify
6696242	multiple zfs_fillpage() zfs: accessing past end of object panics
6785914	zfs fails to drop dn_struct_rwlock in recovery code path

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6830541, 6696242, 6785914)
MFC after:	2 weeks

Revision 1.83: download - view: text, markup, annotated - select for diffs
Sat Oct 16 20:43:05 2010 UTC (15 months, 3 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +91 -0 lines
SVN rev 213937 on 2010-10-16 20:43:05Z by avg

zfs: add vop_getpages method implementation

This should make vnode_pager_getpages path a bit shorter and clearer.
Also this should eliminate problems with partially valid pages.
Having this method opens room for future optimizations.

To do: try to satisfy other pages besides the required one taking into
account tradeofs between number of page faults, read throughput and read
latency.  Also, eventually vop_putpages should be added too.

Reviewed by:	kib, mm, pjd
MFC after:	3 weeks

Revision 1.46.2.28: download - view: text, markup, annotated - select for diffs
Sat Oct 16 20:13:15 2010 UTC (15 months, 3 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.27: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.27: +3 -31 lines
SVN rev 213936 on 2010-10-16 20:13:15Z by avg

Revert r213261 (MFC of r212652): vm_page_sleep change has not been MFCed yet

Revision 1.46.2.27: download - view: text, markup, annotated - select for diffs
Sat Oct 16 11:52:43 2010 UTC (15 months, 3 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.26: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.26: +6 -3 lines
SVN rev 213924 on 2010-10-16 11:52:43Z by avg

MFC r213730: zfs + sendfile: do not produce partially valid pages for
vnode's tail

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Oct 12 17:04:21 2010 UTC (16 months ago) by avg
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +6 -3 lines
SVN rev 213730 on 2010-10-12 17:04:21Z by avg

zfs + sendfile: do not produce partially valid pages for vnode's tail

Since r212650 and before this change sendfile(2) could produce
a partially valid page for a trailing portion of a ZFS vnode.
vm_fault() always wants to see a fully valid page even if it's the last
page that partially extends beyond vnode's end.  Otherwise it calls
vop_getpages() to bring in the page.  In the case of ZFS this means
that the data is read from the page into the same page and this breaks
checks in ZFS mappedread() - a thread that set VPO_BUSY on the page in
vm_fault() will get blocked forever waiting for it to be cleared.

Many thanks to Kai and Jeremy for reproducing the issue and providing
important debugging information and help.

Reported by:	Kai Gallasch <gallasch@free.de>,
		Jeremy Chadwick <freebsd@jdc.parodius.com>
Tested by:	Kai Gallasch <gallasch@free.de>,
		Jeremy Chadwick <freebsd@jdc.parodius.com>
Reviewed by:	kib
MFC after:	3 days
To-Do:		apply the same treatment to tmpfs + sendfile

Revision 1.46.2.26: download - view: text, markup, annotated - select for diffs
Mon Oct 11 09:34:46 2010 UTC (16 months ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.25: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.25: +6 -6 lines
SVN rev 213683 on 2010-10-11 09:34:46Z by mm

MFC r210470:

Import two changesets from OpenSolaris to make future updates easier.

The changes do not affect FreeBSD code because
zfs_znode_move(), cleanlocks() and cleanshares() are not used.

OpenSolaris onnv changeset:	9788:f660bc44f2e8, 9909:aa280f585a3e

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6843700, 6790232)

Revision 1.81: download - view: text, markup, annotated - select for diffs
Sun Oct 10 20:49:33 2010 UTC (16 months ago) by pjd
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +22 -5 lines
SVN rev 213673 on 2010-10-10 20:49:33Z by pjd

Provide internal ioflags() function that converts ioflag provided by FreeBSD's
VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write
operations.

Reviewed by:	mm
MFC after:	1 week

Revision 1.80: download - view: text, markup, annotated - select for diffs
Fri Oct 8 23:01:38 2010 UTC (16 months ago) by mm
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +1 -1 lines
SVN rev 213634 on 2010-10-08 23:01:38Z by mm

Change FAPPEND to IO_APPEND as this is a ioflag and not a fflag.
This corrects writing to append-only files on ZFS.

PR:		kern/149495 [1], kern/151082 [2]
Submitted by:	Daniel Zhelev <daniel@zhelev.biz> [1], Michael Naef <cal@linu.gs> [2]
Approved by:	delphij (mentor)
MFC after:	1 week

Revision 1.46.2.25: download - view: text, markup, annotated - select for diffs
Fri Oct 8 07:31:32 2010 UTC (16 months ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.24: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.24: +1 -11 lines
SVN rev 213548 on 2010-10-08 07:31:32Z by avg

MFC r212657: zfs vn_has_cached_data: take into account v_object->cache != NULL

Revision 1.46.2.24: download - view: text, markup, annotated - select for diffs
Fri Oct 8 07:29:26 2010 UTC (16 months ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.23: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.23: +1 -3 lines
SVN rev 213547 on 2010-10-08 07:29:26Z by avg

MFC r212951: zfs_map_page/zfs_unmap_page: do not use sched_pin() and
SFB_CPUPRIVATE

Revision 1.46.2.23: download - view: text, markup, annotated - select for diffs
Fri Oct 8 07:26:56 2010 UTC (16 months ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.22: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.22: +2 -5 lines
SVN rev 213546 on 2010-10-08 07:26:56Z by avg

MFC r212950: zfs_vnops: use zfs_map_page/zfs_unmap_page helper functions
in another place

Revision 1.46.2.22: download - view: text, markup, annotated - select for diffs
Wed Sep 29 09:18:34 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.21: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.21: +6 -5 lines
SVN rev 213263 on 2010-09-29 09:18:34Z by avg

MFC r212655: zfs mappedread, update_pages: use int for offset and length
within a page

Revision 1.46.2.21: download - view: text, markup, annotated - select for diffs
Wed Sep 29 09:16:45 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.20: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.20: +2 -8 lines
SVN rev 213262 on 2010-09-29 09:16:45Z by avg

MFC r212654: zfs mappedread: use uiomove_fromphys where possible

Revision 1.46.2.20: download - view: text, markup, annotated - select for diffs
Wed Sep 29 09:15:02 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.19: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.19: +31 -3 lines
SVN rev 213261 on 2010-09-29 09:15:02Z by avg

MFC r212652: zfs: catch up with vm_page_sleep_if_busy changes

Revision 1.46.2.19: download - view: text, markup, annotated - select for diffs
Wed Sep 29 09:11:34 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.18: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.18: +2 -0 lines
SVN rev 213260 on 2010-09-29 09:11:34Z by avg

MFC r212650: tmpfs, zfs + sendfile: mark page bits as valid after
populating it with data

Revision 1.46.2.18: download - view: text, markup, annotated - select for diffs
Fri Sep 24 07:23:48 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.46.2.17: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.17: +3 -1 lines
SVN rev 213093 on 2010-09-24 07:23:48Z by avg

MFC r212782: zfs+sendfile: advance uio_offset upon reading as well

Revision 1.79: download - view: text, markup, annotated - select for diffs
Tue Sep 21 05:58:45 2010 UTC (16 months, 3 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +1 -3 lines
SVN rev 212951 on 2010-09-21 05:58:45Z by avg

zfs_map_page/zfs_unmap_page: do not use sched_pin() and SFB_CPUPRIVATE

zfs_map_page/zfs_unmap_page are mostly called around potential I/O paths
and it seems to be a not very good idea to do cpu pinning there.

Suggested by:	kib
MFC after:	2 weeks

Revision 1.78: download - view: text, markup, annotated - select for diffs
Tue Sep 21 05:54:36 2010 UTC (16 months, 3 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +2 -5 lines
SVN rev 212950 on 2010-09-21 05:54:36Z by avg

zfs_vnops: use zfs_map_page/zfs_unmap_page helper functions in another place

MFC after:	2 weeks

Revision 1.46.2.17: download - view: text, markup, annotated - select for diffs
Sat Sep 18 08:45:43 2010 UTC (16 months, 3 weeks ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.16: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.16: +22 -13 lines
SVN rev 212820 on 2010-09-18 08:45:43Z by mm

MFC r212694:

Fix kernel panic when moving a file to .zfs/shares
Fix possible loss of correct error return code in ZFS mount

OpenSolaris revisions and Bug IDs:

11824:53128e5db7cf
6863610	ZFS mount can lose correct error return

12079:13822b941977
6939941	problem with moving files in zfs (142901-12)

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6863610, 6939941)

Revision 1.77: download - view: text, markup, annotated - select for diffs
Fri Sep 17 07:20:20 2010 UTC (16 months, 3 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +3 -1 lines
SVN rev 212782 on 2010-09-17 07:20:20Z by avg

zfs+sendfile: advance uio_offset upon reading as well

Picked from analogous code in tmpfs.

MFC after:	1 week

Revision 1.76: download - view: text, markup, annotated - select for diffs
Wed Sep 15 19:55:26 2010 UTC (16 months, 3 weeks ago) by mm
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +22 -13 lines
SVN rev 212694 on 2010-09-15 19:55:26Z by mm

Fix kernel panic when moving a file to .zfs/shares
Fix possible loss of correct error return code in ZFS mount

OpenSolaris revisions and Bug IDs:

11824:53128e5db7cf
6863610	ZFS mount can lose correct error return

12079:13822b941977
6939941	problem with moving files in zfs (142901-12)

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6863610, 6939941)
MFC after:	3 days

Revision 1.46.2.16: download - view: text, markup, annotated - select for diffs
Wed Sep 15 16:20:24 2010 UTC (16 months, 3 weeks ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.15: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.15: +86 -32 lines
SVN rev 212672 on 2010-09-15 16:20:24Z by mm

MFC r211932, r211947, r211948:

MFC r211932:

Import changes from OpenSolaris that provide
- better ACL caching and speedup of ACL permission checks
- faster handling of stat()
- lowered mutex contention in the read/writer lock (rrwlock)
- several related bugfixes

Detailed information (OpenSolaris onnv changesets and Bug IDs):

9749:105f407a2680
6802734	Support for Access Based Enumeration (not used on FreeBSD)
6844861	inconsistent xattr readdir behavior with too-small buffer

9866:ddc5f1d8eb4e
6848431	zfs with rstchown=0 or file_chown_self privilege allows user to "take" ownership

9981:b4907297e740
6775100	stat() performance on files on zfs should be improved
6827779	rrwlock is overly protective of its counters

10143:d2d432dfe597
6857433	memory leaks found at: zfs_acl_alloc/zfs_acl_node_alloc
6860318	truncate() on zfsroot succeeds when file has a component of its path set without access permission

10232:f37b85f7e03e
6865875	zfs sometimes incorrectly giving search access to a dir

10250:b179ceb34b62
6867395	zpool_upgrade_007_pos testcase panic'd with BAD TRAP: type=e (#pf Page fault)

10269:2788675568fd
6868276	zfs_rezget() can be hazardous when znode has a cached ACL

10295:f7a18a1e9610
6870564	panic in zfs_getsecattr

MFC r211947:

Move ZUT_OBJS in the same place that is used in vendor code.

MFC r211948:

Return NULL pointer instead of B_FALSE as it is done in the vendor code.

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (multiple Bug IDs)

Revision 1.46.2.15: download - view: text, markup, annotated - select for diffs
Wed Sep 15 16:05:40 2010 UTC (16 months, 3 weeks ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.14: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.14: +469 -277 lines
SVN rev 212668 on 2010-09-15 16:05:40Z by mm

MFC r209962, r211970-r211972, r212050, r212605, r212611

MFC r209962:

Merge ZFS version 15 and almost all OpenSolaris bugfixes referenced
in Solaris 10 updates 141445-09 and 142901-14.

Detailed information:
(OpenSolaris revisions and Bug IDs, Solaris 10 patch numbers)

7844:effed23820ae
6755435 zfs_open() and zfs_close() needs to use ZFS_ENTER/ZFS_VERIFY_ZP (141445-01)

7897:e520d8258820
6748436 inconsistent zpool.cache in boot_archive could panic a zfs root filesystem upon boot-up (141445-01)

7965:b795da521357
6740164 zpool attach can create an illegal root pool (141909-02)

8084:b811cc60d650
6769612 zpool_import() will continue to write to cachefile even if altroot is set (N/A)

8121:7fd09d4ebd9c
6757430 want an option for zdb to disable space map loading and leak tracking (141445-01)

8129:e4f45a0bfbb0
6542860 ASSERT: reason != VDEV_LABEL_REMOVE||vdev_inuse(vd, crtxg, reason, 0) (141445-01)

8188:fd00c0a81e80
6761100 want zdb option to select older uberblocks (141445-01)

8190:6eeea43ced42
6774886 zfs_setattr() won't allow ndmp to restore SUNWattr_rw (141445-01)

8225:59a9961c2aeb
6737463 panic while trying to write out config file if root pool import fails (141445-01)

8227:f7d7be9b1f56
6765294 Refactor replay (141445-01)

8228:51e9ca9ee3a5
6572357 libzfs should do more to avoid mnttab lookups (141909-01)
6572376 zfs_iter_filesystems and zfs_iter_snapshots get objset stats twice (141909-01)

8241:5a60f16123ba
6328632 zpool offline is a bit too conservative (141445-01)
6739487 ASSERT: txg <= spa_final_txg due to scrub/export race (141445-01)
6767129 ASSERT: cvd->vdev_isspare, in spa_vdev_detach() (141445-01)
6747698 checksum failures after offline -t / export / import / scrub (141445-01)
6745863 ZFS writes to disk after it has been offlined (141445-01)
6722540 50% slowdown on scrub/resilver with certain vdev configurations (141445-01)
6759999 resilver logic rewrites ditto blocks on both source and destination (141445-01)
6758107 I/O should never suspend during spa_load() (141445-01)
6776548 codereview(1) runs off the page when faced with multi-line comments (N/A)
6761406 AMD errata 91 workaround doesn't work on 64-bit systems (141445-01)

8242:e46e4b2f0a03
6770866 GRUB/ZFS should require physical path or devid, but not both (141445-01)

8269:03a7e9050cfd
6674216 "zfs share" doesn't work, but "zfs set sharenfs=on" does (141445-01)
6621164 $SRC/cmd/zfs/zfs_main.c seems to have a syntax error in the translation note (141445-01)
6635482 i18n problems in libzfs_dataset.c and zfs_main.c (141445-01)
6595194 "zfs get" VALUE column is as wide as NAME (141445-01)
6722991 vdev_disk.c: error checking for ddi_pathname_to_dev_t() must test for NODEV (141445-01)
6396518 ASSERT strings shouldn't be pre-processed (141445-01)

8274:846b39508aff
6713916 scrub/resilver needlessly decompress data (141445-01)

8343:655db2375fed
6739553 libzfs_status msgid table is out of sync (141445-01)
6784104 libzfs unfairly rejects numerical values greater than 2^63 (141445-01)
6784108 zfs_realloc() should not free original memory on failure (141445-01)

8525:e0e0e525d0f8
6788830 set large value to reservation cause core dump (141445-01)
6791064 want sysevents for ZFS scrub (141445-01)
6791066 need to be able to set cachefile on faulted pools (141445-01)
6791071 zpool_do_import() should not enable datasets on faulted pools (141445-01)
6792134 getting multiple properties on a faulted pool leads to confusion (141445-01)

8547:bcc7b46e5ff7
6792884 Vista clients cannot access .zfs (141445-01)

8632:36ef517870a3
6798384 It can take a village to raise a zio (141445-01)

8636:7e4ce9158df3
6551866 deadlock between zfs_write(), zfs_freesp(), and zfs_putapage() (141909-01)
6504953 zfs_getpage() misunderstands VOP_GETPAGE() interface (141909-01)
6702206 ZFS read/writer lock contention throttles sendfile() benchmark (141445-01)
6780491 Zone on a ZFS filesystem has poor fork/exec performance (141445-01)
6747596 assertion failed: DVA_EQUAL(BP_IDENTITY(&zio->io_bp_orig), BP_IDENTITY(zio->io_bp))); (141445-01)

8692:692d4668b40d
6801507 ZFS read aggregation should not mind the gap (141445-01)

8697:e62d2612c14d
6633095 creating a filesystem with many properties set is slow (141445-01)

8768:dfecfdbb27ed
6775697 oracle crashes when overwriting after hitting quota on zfs (141909-01)

8811:f8deccf701cf
6790687 libzfs mnttab caching ignores external changes (141445-01)
6791101 memory leak from libzfs_mnttab_init (141445-01)

8845:91af0d9c0790
6800942 smb_session_create() incorrectly stores IP addresses (N/A)
6582163 Access Control List (ACL) for shares (141445-01)
6804954 smb_search - shortname field should be space padded following the NULL terminator (N/A)
6800184 Panic at smb_oplock_conflict+0x35() (N/A)

8876:59d2e67b4b65
6803822 Reboot after replacement of system disk in a ZFS mirror drops to grub> prompt (141445-01)

8924:5af812f84759
6789318 coredump when issue zdb -uuuu poolname/ (141445-01)
6790345 zdb -dddd -e poolname coredump (141445-01)
6797109 zdb: 'zdb -dddddd pool_name/fs_name inode' coredump if the file with inode was deleted (141445-01)
6797118 zdb: 'zdb -dddddd poolname inum' coredump if I miss the fs name (141445-01)
6803343 shareiscsi=on failed, iscsitgtd failed request to share (141445-01)

9030:243fd360d81f
6815893 hang mounting a dataset after booting into a new boot environment (141445-01)

9056:826e1858a846
6809691 'zpool create -f' no longer overwrites ufs infomation (141445-01)

9179:d8fbd96b79b3
6790064 zfs needs to determine uid and gid earlier in create process (141445-01)

9214:8d350e5d04aa
6604992 forced unmount + being in .zfs/snapshot/<snap1> = not happy (141909-01)
6810367 assertion failed: dvp->v_flag & VROOT, file: ../../common/fs/gfs.c, line: 426 (141909-01)

9229:e3f8b41e5db4
6807765 ztest_dsl_dataset_promote_busy needs to clean up after ENOSPC (141445-01)

9230:e4561e3eb1ef
6821169 offlining a device results in checksum errors (141445-01)
6821170 ZFS should not increment error stats for unavailable devices (141445-01)
6824006 need to increase issue and interrupt taskqs threads in zfs (141445-01)

9234:bffdc4fc05c4
6792139 recovering from a suspended pool needs some work (141445-01)
6794830 reboot command hangs on a failed zfs pool (141445-01)

9246:67c03c93c071
6824062 System panicked in zfs_mount due to NULL pointer dereference when running btts and svvs tests (141909-01)

9276:a8a7fc849933
6816124 System crash running zpool destroy on broken zpool (141445-03)

9355:09928982c591
6818183 zfs snapshot -r is slow due to set_snap_props() doing txg_wait_synced() for each new snapshot (141445-03)

9391:413d0661ef33
6710376 log device can show incorrect status when other parts of pool are degraded (141445-03)

9396:f41cf682d0d3 (part already merged)
6501037 want user/group quotas on ZFS (141445-03)
6827260 assertion failed in arc_read(): hdr == pbuf->b_hdr (141445-03)
6815592 panic: No such hold X on refcount Y from zfs_znode_move (141445-03)
6759986 zfs list shows temporary %clone when doing online zfs recv (141445-03)

9404:319573cd93f8
6774713 zfs ignores canmount=noauto when sharenfs property != off (141445-03)

9412:4aefd8704ce0
6717022 ZFS DMU needs zero-copy support (141445-03)

9425:e7ffacaec3a8
6799895 spa_add_spares() needs to be protected by config lock (141445-03)
6826466 want to post sysevents on hot spare activation (141445-03)
6826468 spa 'allowfaulted' needs some work (141445-03)
6826469 kernel support for storing vdev FRU information (141445-03)
6826470 skip posting checksum errors from DTL regions of leaf vdevs (141445-03)
6826471 I/O errors after device remove probe can confuse FMA (141445-03)
6826472 spares should enjoy some of the benefits of cache devices (141445-03)

9443:2a96d8478e95
6833711 gang leaders shouldn't have to be logical (141445-03)

9463:d0bd231c7518
6764124 want zdb to be able to checksum metadata blocks only (141445-03)

9465:8372081b8019
6830237 zfs panic in zfs_groupmember() (141445-03)

9466:1fdfd1fed9c4
6833162 phantom log device in zpool status (141445-03)

9469:4f68f041ddcd
6824968 add ZFS userquota support to rquotad (141445-03)

9470:6d827468d7b5
6834217 godfather I/O should reexecute (141445-03)

9480:fcff33da767f
6596237 Stop looking and start ganging (141909-02)

9493:9933d599bc93
6623978 lwb->lwb_buf != NULL, file ../../../uts/common/fs/zfs/zil.c, line 787, function zil_lwb_commit (141445-06)

9512:64cafcbcc337
6801810 Commit of aligned streaming rewrites to ZIL device causes unwanted disk reads (N/A)

9515:d3b739d9d043
6586537 async zio taskqs can block out userland commands (142901-09)

9554:787363635b6a
6836768 zfs_userspace() callback has no way to indicate failure (N/A)

9574:1eb6a6ab2c57
6838062 zfs panics when an error is encountered in space_map_load() (141909-02)

9583:b0696cd037cc
6794136 Panic BAD TRAP: type=e when importing degraded zraid pool. (141909-03)

9630:e25a03f552e0
6776104 "zfs import" deadlock between spa_unload() and spa_async_thread() (141445-06)

9653:a70048a304d1
6664765 Unable to remove files when using fat-zap and quota exceeded on ZFS filesystem (141445-06)

9688:127be1845343
6841321 zfs userspace / zfs get userused@ doesn't work on mounted snapshot (N/A)
6843069 zfs get userused@S-1-... doesn't work (N/A)

9873:8ddc892eca6e
6847229 assertion failed: refcount_count(&tx->tx_space_written) + delta <= tx->tx_space_towrite in dmu_tx.c (141445-06)

9904:d260bd3fd47c
6838344 kernel heap corruption detected on zil while stress testing (141445-06)

9951:a4895b3dd543
6844900 zfs_ioc_userspace_upgrade leaks (N/A)

10040:38b25aeeaf7a
6857012 zfs panics on zpool import (141445-06)

10000:241a51d8720c
6848242 zdb -e no longer works as expected (N/A)

10100:4a6965f6bef8
6856634 snv_117 not booting: zfs_parse_bootfs: error2 (141445-07)

10160:a45b03783d44
6861983 zfs should use new name <-> SID interfaces (N/A)
6862984 userquota commands can hang (141445-06)

10299:80845694147f
6696858 zfs receive of incremental replication stream can dereference NULL pointer and crash (N/A)

10302:a9e3d1987706
6696858 zfs receive of incremental replication stream can dereference NULL pointer and crash (fix lint) (N/A)

10575:2a8816c5173b (partial merge)
6882227 spa_async_remove() shouldn't do a full clear (142901-14)

10800:469478b180d9
6880764 fsync on zfs is broken if writes are greater than 32kb on a hard crash and no log attached (142901-09)
6793430 zdb -ivvvv assertion failure: bp->blk_cksum.zc_word[2] == dmu_objset_id(zilog->zl_os) (N/A)

10801:e0bf032e8673 (partial merge)
6822816 assertion failed: zap_remove_int(ds_next_clones_obj) returns ENOENT (142901-09)

10810:b6b161a6ae4a
6892298 buf->b_hdr->b_state != arc_anon, file: ../../common/fs/zfs/arc.c, line: 2849 (142901-09)

10890:499786962772
6807339 spurious checksum errors when replacing a vdev (142901-13)

11249:6c30f7dfc97b
6906110 bad trap panic in zil_replay_log_record (142901-13)
6906946 zfs replay isn't handling uid/gid correctly (142901-13)

11454:6e69bacc1a5a
6898245 suspended zpool should not cause rest of the zfs/zpool commands to hang (142901-10)

11546:42ea6be8961b (partial merge)
6833999 3-way deadlock in dsl_dataset_hold_ref() and dsl_sync_task_group_sync() (142901-09)

MFC r211970:

Fix 'zfs allow' (maybe not only) returning:

        cannot access dataset system/usr/home: Operation not supported

by including libzfs_impl.h. What libzfs_impl.h does is to redefine ioctl() to
be compatible with OpenSolaris. More specifically OpenSolaris returns ENOMEM
when buffer is too small and sets field zc_nvlist_dst_size to the size that
will be big enough for the data. In FreeBSD case ioctl() doesn't copy data
structure back in case of a failure. We work-around it in kernel and libzfs by
returning 0 from ioctl() and always checking if zc_nvlist_dst_size hasn't
changed. For this work-around to work in pyzfs we need this compatible ioctl()
which is implemented in libzfs_impl.h.

MFC r211971:

Print errors on stderr.

MFC r211972:

Give user a hint what to do when /usr/lib/zfs/pyzfs.py is missing.

MFC r212050:

When upgrading a pool which contain root file system, give user a hint that
he should update boot code.

MFC r212605:

Add missing vop_vector zfsctl_ops_shares
Add missing locks around VOP_READDIR and VOP_GETATTR with z_shares_dir

MFC r212611:

Remove duplicated VFS_HOLD due to a mismerge.

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (multiple Bug IDs), Perforce (pjd)

Revision 1.75: download - view: text, markup, annotated - select for diffs
Wed Sep 15 11:05:41 2010 UTC (16 months, 4 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +1 -11 lines
SVN rev 212657 on 2010-09-15 11:05:41Z by avg

zfs vn_has_cached_data: take into account v_object->cache != NULL

This mirrors code in tmpfs.
This changge shouldn't affect much read path, it may cause unnecessary
vm_page_lookup calls in the case where v_object has no active or inactive
pages but has some cache pages.  I believe this situation to be non-essential.

In write path this change should allow us to properly detect the above
case and free a cache page when we write to a range that corresponds to it.
If this situation is undetected then we could have a discrepancy between
data in page cache and in ARC or on disk.

This change allows us to re-enable vn_has_cached_data() check in zfs_write.

NOTE: strictly speaking resident_page_count and cache fields of v_object
should be exmined under VM_OBJECT_LOCK, but for this particular usage
we may get away with it.

Discussed with:	alc, kib
Approved by:	pjd
Tested with:	tools/regression/fsx
MFC after:	3 weeks

Revision 1.74: download - view: text, markup, annotated - select for diffs
Wed Sep 15 10:48:16 2010 UTC (16 months, 4 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +6 -5 lines
SVN rev 212655 on 2010-09-15 10:48:16Z by avg

zfs mappedread, update_pages: use int for offset and length within a page

uint64_t, int64_t were redundant there

Approved by:	pjd
Tested by:	tools/regression/fsx
MFC after:	2 weeks

Revision 1.73: download - view: text, markup, annotated - select for diffs
Wed Sep 15 10:44:20 2010 UTC (16 months, 4 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +2 -8 lines
SVN rev 212654 on 2010-09-15 10:44:20Z by avg

zfs mappedread: use uiomove_fromphys where possible

Reviewed by:	alc
Approved by:	pjd
Tested by:	tools/regression/fsx
MFC after:	2 weeks

Revision 1.72: download - view: text, markup, annotated - select for diffs
Wed Sep 15 10:39:21 2010 UTC (16 months, 4 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +31 -3 lines
SVN rev 212652 on 2010-09-15 10:39:21Z by avg

zfs: catch up with vm_page_sleep_if_busy changes

Reviewed by:	alc
Approved by:	pjd
Tested by:	tools/regression/fsx
MFC after:	2 weeks

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Sep 15 10:31:27 2010 UTC (16 months, 4 weeks ago) by avg
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +2 -0 lines
SVN rev 212650 on 2010-09-15 10:31:27Z by avg

tmpfs, zfs + sendfile: mark page bits as valid after populating it with data

Otherwise, adding insult to injury, in addition to double-caching of data
we would always copy the data into a vnode's vm object page from backend.
This is specific to sendfile case only (VOP_READ with UIO_NOCOPY).

PR:		kern/141305
Reported by:	Wiktor Niesiobedzki <bsd@vink.pl>
Reviewed by:	alc
Tested by:	tools/regression/sockets/sendfile
MFC after:	2 weeks

Revision 1.70: download - view: text, markup, annotated - select for diffs
Mon Sep 13 19:47:09 2010 UTC (16 months, 4 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +0 -2 lines
SVN rev 212573 on 2010-09-13 19:47:09Z by pjd

Remove the page queues lock around vm_page_undirty() - it is no longer needed.

Reviewed by:	alc

Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Aug 30 16:30:18 2010 UTC (17 months, 1 week ago) by jh
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +11 -4 lines
SVN rev 212002 on 2010-08-30 16:30:18Z by jh

execve(2) has a special check for file permissions: a file must have at
least one execute bit set, otherwise execve(2) will return EACCES even
for an user with PRIV_VFS_EXEC privilege.

Add the check also to vaccess(9), vaccess_acl_nfs4(9) and
vaccess_acl_posix1e(9). This makes access(2) to better agree with
execve(2). Because ZFS doesn't use vaccess(9) for VEXEC, add the check
to zfs_freebsd_access() too. There may be other file systems which are
not using vaccess*() functions and need to be handled separately.

PR:		kern/125009
Reviewed by:	bde, trasz
Approved by:	pjd (ZFS part)

Revision 1.68: download - view: text, markup, annotated - select for diffs
Sat Aug 28 09:24:11 2010 UTC (17 months, 2 weeks ago) by mm
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +86 -32 lines
SVN rev 211932 on 2010-08-28 09:24:11Z by mm

Import changes from OpenSolaris that provide
- better ACL caching and speedup of ACL permission checks
- faster handling of stat()
- lowered mutex contention in the read/writer lock (rrwlock)
- several related bugfixes

Detailed information (OpenSolaris onnv changesets and Bug IDs):

9749:105f407a2680
6802734	Support for Access Based Enumeration (not used on FreeBSD)
6844861	inconsistent xattr readdir behavior with too-small buffer

9866:ddc5f1d8eb4e
6848431	zfs with rstchown=0 or file_chown_self privilege allows user to "take" ownership

9981:b4907297e740
6775100	stat() performance on files on zfs should be improved
6827779	rrwlock is overly protective of its counters

10143:d2d432dfe597
6857433	memory leaks found at: zfs_acl_alloc/zfs_acl_node_alloc
6860318	truncate() on zfsroot succeeds when file has a component of its path set without access permission

10232:f37b85f7e03e
6865875	zfs sometimes incorrectly giving search access to a dir

10250:b179ceb34b62
6867395	zpool_upgrade_007_pos testcase panic'd with BAD TRAP: type=e (#pf Page fault)

10269:2788675568fd
6868276	zfs_rezget() can be hazardous when znode has a cached ACL

10295:f7a18a1e9610
6870564	panic in zfs_getsecattr

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (multiple Bug IDs)
MFC after:	2 weeks

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun Jul 25 15:17:24 2010 UTC (18 months, 2 weeks ago) by mm
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +6 -6 lines
SVN rev 210470 on 2010-07-25 15:17:24Z by mm

Import two changesets from OpenSolaris to make future updates easier.

The changes do not affect FreeBSD code because
zfs_znode_move(), cleanlocks() and cleanshares() are not used.

OpenSolaris onnv changeset:	9788:f660bc44f2e8, 9909:aa280f585a3e

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6843700, 6790232)
MFC after:	7 weeks

Revision 1.66: download - view: text, markup, annotated - select for diffs
Mon Jul 12 23:49:04 2010 UTC (19 months ago) by mm
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +469 -277 lines
SVN rev 209962 on 2010-07-12 23:49:04Z by mm

Merge ZFS version 15 and almost all OpenSolaris bugfixes referenced
in Solaris 10 updates 141445-09 and 142901-14.

Detailed information:
(OpenSolaris revisions and Bug IDs, Solaris 10 patch numbers)

7844:effed23820ae
6755435	zfs_open() and zfs_close() needs to use ZFS_ENTER/ZFS_VERIFY_ZP (141445-01)

7897:e520d8258820
6748436	inconsistent zpool.cache in boot_archive could panic a zfs root filesystem upon boot-up (141445-01)

7965:b795da521357
6740164	zpool attach can create an illegal root pool (141909-02)

8084:b811cc60d650
6769612	zpool_import() will continue to write to cachefile even if altroot is set (N/A)

8121:7fd09d4ebd9c
6757430	want an option for zdb to disable space map loading and leak tracking (141445-01)

8129:e4f45a0bfbb0
6542860	ASSERT: reason != VDEV_LABEL_REMOVE||vdev_inuse(vd, crtxg, reason, 0) (141445-01)

8188:fd00c0a81e80
6761100	want zdb option to select older uberblocks (141445-01)

8190:6eeea43ced42
6774886	zfs_setattr() won't allow ndmp to restore SUNWattr_rw (141445-01)

8225:59a9961c2aeb
6737463	panic while trying to write out config file if root pool import fails (141445-01)

8227:f7d7be9b1f56
6765294	Refactor replay (141445-01)

8228:51e9ca9ee3a5
6572357	libzfs should do more to avoid mnttab lookups (141909-01)
6572376	zfs_iter_filesystems and zfs_iter_snapshots get objset stats twice (141909-01)

8241:5a60f16123ba
6328632	zpool offline is a bit too conservative (141445-01)
6739487	ASSERT: txg <= spa_final_txg due to scrub/export race (141445-01)
6767129	ASSERT: cvd->vdev_isspare, in spa_vdev_detach() (141445-01)
6747698	checksum failures after offline -t / export / import / scrub (141445-01)
6745863	ZFS writes to disk after it has been offlined (141445-01)
6722540	50% slowdown on scrub/resilver with certain vdev configurations (141445-01)
6759999	resilver logic rewrites ditto blocks on both source and destination (141445-01)
6758107	I/O should never suspend during spa_load() (141445-01)
6776548	codereview(1) runs off the page when faced with multi-line comments (N/A)
6761406	AMD errata 91 workaround doesn't work on 64-bit systems (141445-01)

8242:e46e4b2f0a03
6770866	GRUB/ZFS should require physical path or devid, but not both (141445-01)

8269:03a7e9050cfd
6674216	"zfs share" doesn't work, but "zfs set sharenfs=on" does (141445-01)
6621164	$SRC/cmd/zfs/zfs_main.c seems to have a syntax error in the translation note (141445-01)
6635482	i18n problems in libzfs_dataset.c and zfs_main.c (141445-01)
6595194	"zfs get" VALUE column is as wide as NAME (141445-01)
6722991	vdev_disk.c: error checking for ddi_pathname_to_dev_t() must test for NODEV (141445-01)
6396518	ASSERT strings shouldn't be pre-processed (141445-01)

8274:846b39508aff
6713916	scrub/resilver needlessly decompress data (141445-01)

8343:655db2375fed
6739553	libzfs_status msgid table is out of sync (141445-01)
6784104	libzfs unfairly rejects numerical values greater than 2^63 (141445-01)
6784108	zfs_realloc() should not free original memory on failure (141445-01)

8525:e0e0e525d0f8
6788830	set large value to reservation cause core dump (141445-01)
6791064	want sysevents for ZFS scrub (141445-01)
6791066	need to be able to set cachefile on faulted pools (141445-01)
6791071	zpool_do_import() should not enable datasets on faulted pools (141445-01)
6792134	getting multiple properties on a faulted pool leads to confusion (141445-01)

8547:bcc7b46e5ff7
6792884	Vista clients cannot access .zfs (141445-01)

8632:36ef517870a3
6798384	It can take a village to raise a zio (141445-01)

8636:7e4ce9158df3
6551866	deadlock between zfs_write(), zfs_freesp(), and zfs_putapage() (141909-01)
6504953	zfs_getpage() misunderstands VOP_GETPAGE() interface (141909-01)
6702206	ZFS read/writer lock contention throttles sendfile() benchmark (141445-01)
6780491	Zone on a ZFS filesystem has poor fork/exec performance (141445-01)
6747596	assertion failed: DVA_EQUAL(BP_IDENTITY(&zio->io_bp_orig), BP_IDENTITY(zio->io_bp))); (141445-01)

8692:692d4668b40d
6801507	ZFS read aggregation should not mind the gap (141445-01)

8697:e62d2612c14d
6633095	creating a filesystem with many properties set is slow (141445-01)

8768:dfecfdbb27ed
6775697	oracle crashes when overwriting after hitting quota on zfs (141909-01)

8811:f8deccf701cf
6790687	libzfs mnttab caching ignores external changes (141445-01)
6791101	memory leak from libzfs_mnttab_init (141445-01)

8845:91af0d9c0790
6800942	smb_session_create() incorrectly stores IP addresses (N/A)
6582163	Access Control List (ACL) for shares (141445-01)
6804954	smb_search - shortname field should be space padded following the NULL terminator (N/A)
6800184	Panic at smb_oplock_conflict+0x35() (N/A)

8876:59d2e67b4b65
6803822	Reboot after replacement of system disk in a ZFS mirror drops to grub> prompt (141445-01)

8924:5af812f84759
6789318	coredump when issue zdb -uuuu poolname/ (141445-01)
6790345 zdb -dddd -e poolname coredump (141445-01)
6797109 zdb: 'zdb -dddddd pool_name/fs_name inode' coredump if the file with inode was deleted (141445-01)
6797118 zdb: 'zdb -dddddd poolname inum' coredump if I miss the fs name (141445-01)
6803343 shareiscsi=on failed, iscsitgtd failed request to share (141445-01)

9030:243fd360d81f
6815893	hang mounting a dataset after booting into a new boot environment (141445-01)

9056:826e1858a846
6809691	'zpool create -f' no longer overwrites ufs infomation (141445-01)

9179:d8fbd96b79b3
6790064	zfs needs to determine uid and gid earlier in create process (141445-01)

9214:8d350e5d04aa
6604992	forced unmount + being in .zfs/snapshot/<snap1> = not happy (141909-01)
6810367	assertion failed: dvp->v_flag & VROOT, file: ../../common/fs/gfs.c, line: 426 (141909-01)

9229:e3f8b41e5db4
6807765	ztest_dsl_dataset_promote_busy needs to clean up after ENOSPC (141445-01)

9230:e4561e3eb1ef
6821169	offlining a device results in checksum errors (141445-01)
6821170	ZFS should not increment error stats for unavailable devices (141445-01)
6824006	need to increase issue and interrupt taskqs threads in zfs (141445-01)

9234:bffdc4fc05c4
6792139	recovering from a suspended pool needs some work (141445-01)
6794830	reboot command hangs on a failed zfs pool (141445-01)

9246:67c03c93c071
6824062	System panicked in zfs_mount due to NULL pointer dereference when running btts and svvs tests (141909-01)

9276:a8a7fc849933
6816124	System crash running zpool destroy on broken zpool (141445-03)

9355:09928982c591
6818183	zfs snapshot -r is slow due to set_snap_props() doing txg_wait_synced() for each new snapshot (141445-03)

9391:413d0661ef33
6710376	log device can show incorrect status when other parts of pool are degraded (141445-03)

9396:f41cf682d0d3 (part already merged)
6501037	want user/group quotas on ZFS (141445-03)
6827260	assertion failed in arc_read(): hdr == pbuf->b_hdr (141445-03)
6815592	panic: No such hold X on refcount Y from zfs_znode_move (141445-03)
6759986	zfs list shows temporary %clone when doing online zfs recv (141445-03)

9404:319573cd93f8
6774713	zfs ignores canmount=noauto when sharenfs property != off (141445-03)

9412:4aefd8704ce0
6717022	ZFS DMU needs zero-copy support (141445-03)

9425:e7ffacaec3a8
6799895	spa_add_spares() needs to be protected by config lock (141445-03)
6826466	want to post sysevents on hot spare activation (141445-03)
6826468	spa 'allowfaulted' needs some work (141445-03)
6826469	kernel support for storing vdev FRU information (141445-03)
6826470	skip posting checksum errors from DTL regions of leaf vdevs (141445-03)
6826471	I/O errors after device remove probe can confuse FMA (141445-03)
6826472	spares should enjoy some of the benefits of cache devices (141445-03)

9443:2a96d8478e95
6833711	gang leaders shouldn't have to be logical (141445-03)

9463:d0bd231c7518
6764124	want zdb to be able to checksum metadata blocks only (141445-03)

9465:8372081b8019
6830237	zfs panic in zfs_groupmember() (141445-03)

9466:1fdfd1fed9c4
6833162	phantom log device in zpool status (141445-03)

9469:4f68f041ddcd
6824968	add ZFS userquota support to rquotad (141445-03)

9470:6d827468d7b5
6834217	godfather I/O should reexecute (141445-03)

9480:fcff33da767f
6596237	Stop looking and start ganging (141909-02)

9493:9933d599bc93
6623978	lwb->lwb_buf != NULL, file ../../../uts/common/fs/zfs/zil.c, line 787, function zil_lwb_commit (141445-06)

9512:64cafcbcc337
6801810	Commit of aligned streaming rewrites to ZIL device causes unwanted disk reads (N/A)

9515:d3b739d9d043
6586537	async zio taskqs can block out userland commands (142901-09)

9554:787363635b6a
6836768	zfs_userspace() callback has no way to indicate failure (N/A)

9574:1eb6a6ab2c57
6838062	zfs panics when an error is encountered in space_map_load() (141909-02)

9583:b0696cd037cc
6794136	Panic BAD TRAP: type=e when importing degraded zraid pool. (141909-03)

9630:e25a03f552e0
6776104	"zfs import" deadlock between spa_unload() and spa_async_thread() (141445-06)

9653:a70048a304d1
6664765	Unable to remove files when using fat-zap and quota exceeded on ZFS filesystem (141445-06)

9688:127be1845343
6841321	zfs userspace / zfs get userused@ doesn't work on mounted snapshot (N/A)
6843069	zfs get userused@S-1-... doesn't work (N/A)

9873:8ddc892eca6e
6847229	assertion failed: refcount_count(&tx->tx_space_written) + delta <= tx->tx_space_towrite in dmu_tx.c (141445-06)

9904:d260bd3fd47c
6838344	kernel heap corruption detected on zil while stress testing (141445-06)

9951:a4895b3dd543
6844900	zfs_ioc_userspace_upgrade leaks (N/A)

10040:38b25aeeaf7a
6857012	zfs panics on zpool import (141445-06)

10000:241a51d8720c
6848242	zdb -e no longer works as expected (N/A)

10100:4a6965f6bef8
6856634	snv_117 not booting: zfs_parse_bootfs: error2 (141445-07)

10160:a45b03783d44
6861983	zfs should use new name <-> SID interfaces (N/A)
6862984	userquota commands can hang (141445-06)

10299:80845694147f
6696858	zfs receive of incremental replication stream can dereference NULL pointer and crash (N/A)

10302:a9e3d1987706
6696858	zfs receive of incremental replication stream can dereference NULL pointer and crash (fix lint) (N/A)

10575:2a8816c5173b (partial merge)
6882227 spa_async_remove() shouldn't do a full clear (142901-14)

10800:469478b180d9
6880764	fsync on zfs is broken if writes are greater than 32kb on a hard crash and no log attached (142901-09)
6793430 zdb -ivvvv assertion failure: bp->blk_cksum.zc_word[2] == dmu_objset_id(zilog->zl_os) (N/A)

10801:e0bf032e8673 (partial merge)
6822816 assertion failed: zap_remove_int(ds_next_clones_obj) returns ENOENT (142901-09)

10810:b6b161a6ae4a
6892298 buf->b_hdr->b_state != arc_anon, file: ../../common/fs/zfs/arc.c, line: 2849 (142901-09)

10890:499786962772
6807339	spurious checksum errors when replacing a vdev (142901-13)

11249:6c30f7dfc97b
6906110 bad trap panic in zil_replay_log_record (142901-13)
6906946 zfs replay isn't handling uid/gid correctly (142901-13)

11454:6e69bacc1a5a
6898245 suspended zpool should not cause rest of the zfs/zpool commands to hang (142901-10)

11546:42ea6be8961b (partial merge)
6833999 3-way deadlock in dsl_dataset_hold_ref() and dsl_sync_task_group_sync() (142901-09)

Discussed with:	pjd
Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (multiple Bug IDs)
MFC after:	2 months

Revision 1.46.2.14: download - view: text, markup, annotated - select for diffs
Thu Jun 17 22:38:23 2010 UTC (19 months, 3 weeks ago) by mm
Branches: RELENG_8
Diff to: previous 1.46.2.13: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.13: +1 -3 lines
SVN rev 209274 on 2010-06-17 22:38:23Z by mm

MFC r209093-r209101:

MFC r209093:
Fix unable to remove a file over NFS after hitting refquota limit
OpenSolaris onnv rev:	8890:8c2bd5f17bf2
OpenSolaris Bug ID:	6798878

MFC r209094:
Fix zfs destroy fails to free object in open context, stops up txg train
OpenSolaris onnv rev:	9409:9dc3f17354ed
OpenSolaris Bug ID:	6809683

MFC r209095:
Fix incomplete resilvering after disk replacement (raidz)
OpenSolaris onnv rev:	9434:3bebded7c76a
OpenSolaris Bug ID:	6794570

MFC r209096:
Fix vdev_probe() starvation brings txg train to a screeching halt
OpenSolaris onnv rev:	9722:e3866bad4e96
OpenSolaris Bug ID:	6844069

MFC r209097:
Fix ZFS panic deadlock: cycle in blocking chain via zfs_zget
OpenSolaris onnv rev:	9774:0bb234ab2287
OpenSolaris Bug ID:	6788152

MFC r209098:
Fix zpool resilver stalls with spa_scrub_thread in a 3 way deadlock
OpenSolaris onnv rev:	9997:174d75a29a1c
OpenSolaris Bug ID:	6843235

MFC r209099:
Fix possible zfs panic on zpool import
OpenSolaris onnv rev:	10040:38b25aeeaf7a
OpenSolaris Bug ID:	6857012

MFC r209100:
Fix panic in zfs_getsecattr
OpenSolaris onnv rev:	10295:f7a18a1e9610
OpenSolaris Bug ID:	6870564

MFC r209101:
Fix arc_read_done may try to byteswap undefined data (sparc related)
OpenSolaris onnv rev:	10839:cf83b553a2ab
OpenSolaris Bug ID:	6836714

Obtained from:	OpenSolaris (multiple Bug IDs)
Approved by:	pjd, delphij (mentor)

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sat Jun 12 11:22:45 2010 UTC (20 months ago) by mm
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +1 -3 lines
SVN rev 209097 on 2010-06-12 11:22:45Z by mm

Fix ZFS panic deadlock: cycle in blocking chain via zfs_zget

OpenSolaris onnv-revision:	9774:0bb234ab2287

Obtained from:	OpenSolaris (Bug ID 6788152)
Approved by:	pjd, delphij (mentor)
MFC after:	3 days

Revision 1.46.2.13: download - view: text, markup, annotated - select for diffs
Wed May 19 06:49:52 2010 UTC (20 months, 3 weeks ago) by mm
Branches: RELENG_8
CVS tags: RELENG_8_1_BP, RELENG_8_1_0_RELEASE, RELENG_8_1
Diff to: previous 1.46.2.12: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.12: +24 -0 lines
SVN rev 208288 on 2010-05-19 06:49:52Z by mm

MFC r207670, r208130, r208131:

MFC r207670:
Introduce hardforce export option (-F) for "zpool export".
When exporting with this flag, zpool.cache remains untouched.
OpenSolaris onnv revision: 8211:32722be6ad3b

MFC r208130:
Fix perfomance problem with ZFS prefetch caching [1]
Add statistics for ZFS prefetch (sysctl kstat.zfs.misc.zfetchstats)
OpenSolaris onnv revision: 10474:0e96dd3b905a (partial)

MFC r208131:
Fix deadlock between zfs_dirent_lock and zfs_rmdir
OpenSolaris onnv revision: 11321:506b7043a14c

Reported by:	jhell@dataix.net (private e-mail) [1]
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID: 6775357, 6859997, 6868951, 6847615)

Revision 1.46.2.12: download - view: text, markup, annotated - select for diffs
Mon May 17 17:56:27 2010 UTC (20 months, 3 weeks ago) by trasz
Branches: RELENG_8
Diff to: previous 1.46.2.11: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.11: +4 -0 lines
SVN rev 208209 on 2010-05-17 17:56:27Z by trasz

MFC r208030:

Add missing check to prevent local users from panicing the kernel by trying
to set malformed ACL.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sun May 16 07:46:03 2010 UTC (20 months, 4 weeks ago) by mm
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +24 -0 lines
SVN rev 208131 on 2010-05-16 07:46:03Z by mm

Fix deadlock between zfs_dirent_lock and zfs_rmdir

OpenSolaris onnv revision:	11321:506b7043a14c

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6847615)
MFC after:	3 days

Revision 1.63: download - view: text, markup, annotated - select for diffs
Thu May 13 15:31:00 2010 UTC (21 months ago) by trasz
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +4 -0 lines
SVN rev 208030 on 2010-05-13 15:31:00Z by trasz

Add missing check to prevent local users from panicing the kernel by trying
to set malformed ACL.

MFC after:	3 days

Revision 1.62: download - view: text, markup, annotated - select for diffs
Fri May 7 14:30:21 2010 UTC (21 months ago) by trasz
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +3 -0 lines
SVN rev 207745 on 2010-05-07 14:30:21Z by trasz

Enforce RLIMIT_FSIZE in ZFS.

Reviewed by:	pjd@

Revision 1.46.2.11: download - view: text, markup, annotated - select for diffs
Sun Apr 18 21:36:34 2010 UTC (21 months, 3 weeks ago) by pjd
Branches: RELENG_8
Diff to: previous 1.46.2.10: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.10: +3 -3 lines
SVN rev 206815 on 2010-04-18 21:36:34Z by pjd

MFC r203504,r204067,r204073,r204101,r204804,r205079,r205080,r205132,r205133,
    r205134,r205231,r205253,r205264,r205346,r206051,r206667,r206792,r206793,
    r206794,r206795,r206796,r206797:

r203504:

Open provider for writting when we find the right one. Opening too much
providers for writing provokes huge traffic related to taste events send
by GEOM on close. This can lead to various problems with opening GEOM
providers that are created on top of other GEOM providers.

Reorted by:	Kurt Touet <ktouet@gmail.com>, mr
Tested by:	mr, Baginski Darren <kickbsd@ya.ru>

r204067:

Update comment. We also look for GPT partitions.

r204073:

Add tunable and sysctl to skip hostid check on pool import.

r204101:

Don't set f_bsize to recordsize. It might confuse some software (like squid).

Submitted by:	Alexander Zagrebin <alexz@visp.ru>

r204804:

Remove racy assertion.

Reported by:	Attila Nagy <bra@fsn.hu>
Obtained from:	OpenSolaris, Bug ID 6827260

r205079:

Remove bogus assertion.

Reported by:	Johan Ström <johan@stromnet.se>
Obtained from:	OpenSolaris, Bug ID 6920880

r205080:

Force commit to correct Bug ID:

Obtained from:	OpenSolaris, Bug ID 6920880

r205132:

Don't bottleneck on acquiring the stream locks - this avoids a massive
drop off in throughput with large numbers of simultaneous reads

r205133:

fix compilation under ZIO_USE_UMA

r205134:

make UMA the default allocator for ZFS buffers - this avoids
a great deal of contention in kmem_alloc

r205231:

- reduce contention by breaking up ARC state locks in to 16 for data
  and 16 for metadata
- export L2ARC tunables as sysctls
- add several kstats to track L2ARC state more precisely
- avoid holding a contended lock when atomically incrementing a
  contended counter (no lock protection needed for atomics)

r205253:

use CACHE_LINE_SIZE instead of hardcoding 128 for lock pad

pointed out by Marius Nuennerich and jhb@

r205264:

- cache line align arcs_lock array (h/t Marius Nuennerich)
- fix ARCS_LOCK_PAD to use architecture defined CACHE_LINE_SIZE
- cache line align buf_hash_table ht_locks array

r205346:

The same code is used to import and to create pool.
The order of operations is the following:
1. Try to open vdev by remembered path and guid.
2. If 1 failed, try to find vdev which guid matches and ignore the path.
3. If 2 failed this means either that the vdev we're looking for is gone
   or that pool is being created and vdev doesn't contain proper guid yet.
   To be able to handle pool creation we open vdev by path anyway.

Because of 3 it is possible that we open wrong vdev on import which can lead to
confusions.

The solution for this is to check spa_load_state. On pool creation it will be
equal to SPA_LOAD_NONE and we can open vdev only by path immediately and if it
is not equal to SPA_LOAD_NONE we first open by path+guid and when that fails,
we open by guid. We no longer open wrong vdev on import.

r206051:

IOCPARM_MAX defines maximum size of a structure that can be passed
directly to ioctl(2). Because of how ioctl command is build using _IO*()
macros we have only 13 bits to encode structure size. So the structure
can be up to 8kB-1.

Currently we define IOCPARM_MAX as PAGE_SIZE.

This is IMHO wrong for three main reasons:

1. It is confusing on archs with page size larger than 8kB (not really
   sure if we support such archs (sparc64?)), as even if PAGE_SIZE is
   bigger than 8kB, we won't be able to encode anything larger in ioctl
   command.

2. It is a waste. Why the structure can be only 4kB on most archs if we
   have 13 bits dedicated for that, not 12?

3. It shouldn't depend on architecture and page size. My ioctl command
   can work on one arch, but can't on the other?

Increase IOCPARM_MAX to 8kB and make it independed of PAGE_SIZE and
architecture it is compiled for. This allows to use all the bits on all the
archs for size. Note that this doesn't mean we will copy more on every ioctl(2)
call. No. We still copyin(9)/copyout(9) only exact number of bytes encoded in
ioctl command.

Practical use for this change is ZFS. zfs_cmd_t structure used for ZFS
ioctls is larger than 4kB.

Silence on:	arch@

r206667:

Fix 3-way deadlock that can happen because of ZFS and vnode lock
order reversal.

thread0 (vfs_fhtovp)	thread1 (vop_getattr)	thread2 (zfs_recv)
--------------------	---------------------	------------------
			vn_lock
rrw_enter_read
						rrw_enter_write (hangs)
			rrw_enter_read (hangs)
vn_lock (hangs)

Reported by:	Attila Nagy <bra@fsn.hu>

r206792:

Set ARC_L2_WRITING on L2ARC header creation.

Obtained from:	OpenSolaris

r206793:

Remove racy assertion.

Obtained from:	OpenSolaris

r206794:

Extend locks scope to match OpenSolaris.

r206795:

Add missing list and lock destruction.

r206796:

Style fixes.

r206797:

Restore previous order.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Thu Apr 15 16:40:54 2010 UTC (21 months, 4 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +3 -3 lines
SVN rev 206667 on 2010-04-15 16:40:54Z by pjd

Fix 3-way deadlock that can happen because of ZFS and vnode lock
order reversal.

thread0 (vfs_fhtovp)	thread1 (vop_getattr)	thread2 (zfs_recv)
--------------------	---------------------	------------------
			vn_lock
rrw_enter_read
						rrw_enter_write (hangs)
			rrw_enter_read (hangs)
vn_lock (hangs)

Submitted by:	Attila Nagy <bra@fsn.hu>
MFC after:	3 days

Revision 1.46.2.10: download - view: text, markup, annotated - select for diffs
Sun Jan 31 02:11:14 2010 UTC (2 years ago) by trasz
Branches: RELENG_8
Diff to: previous 1.46.2.9: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.9: +33 -8 lines
SVN rev 203264 on 2010-01-31 02:11:14Z by trasz

MFC r196949:

Enable NFSv4 ACL support in ZFS.

MFC r197435:

In VOP_SETACL(9) and VOP_GETACL(9), specifying wrong ACL type should result
in EINVAL, not EOPNOTSUPP.

Revision 1.31.2.11: download - view: text, markup, annotated - select for diffs
Fri Jan 22 11:42:44 2010 UTC (2 years ago) by trasz
Branches: RELENG_7
CVS tags: RELENG_7_3_BP, RELENG_7_3_0_RELEASE, RELENG_7_3
Diff to: previous 1.31.2.10: preferred, colored
Changes since revision 1.31.2.10: +31 -1 lines
SVN rev 202805 on 2010-01-22 11:42:44Z by trasz

MFC c195785:

Fix permission handling for extended attributes in ZFS.  Without
this change, ZFS uses SunOS Alternate Data Streams semantics - each
EA has its own permissions, which are set at EA creation time
and - unlike SunOS - invisible to the user and impossible to change.
From the user point of view, it's just broken: sometimes access
is granted when it shouldn't be, sometimes it's denied when
it shouldn't be.

This patch makes it behave just like UFS, i.e. depend on current
file permissions.  Also, it fixes returned error codes (ENOATTR
instead of ENOENT) and makes listextattr(2) return 0 instead
of EPERM where there is no EA directory (i.e. the file never had
any EA).

Tested by:	cperciva

Revision 1.31.2.10: download - view: text, markup, annotated - select for diffs
Thu Jan 7 13:42:28 2010 UTC (2 years, 1 month ago) by netchild
Branches: RELENG_7
Diff to: previous 1.31.2.9: preferred, colored
Changes since revision 1.31.2.9: +1 -1 lines
SVN rev 201744 on 2010-01-07 13:42:28Z by netchild

Diff reduction to 8-stable:
 - whitespace
 - fix harmless mismerges
   - comments or (harmless) code which was there twice
 - fix not so harmless mismerges (mem leak - double mtx_init)

MFC r197842: whitespace fix

Revision 1.31.2.9: download - view: text, markup, annotated - select for diffs
Thu Jan 7 09:37:59 2010 UTC (2 years, 1 month ago) by netchild
Branches: RELENG_7
Diff to: previous 1.31.2.8: preferred, colored
Changes since revision 1.31.2.8: +26 -10 lines
SVN rev 201723 on 2010-01-07 09:37:59Z by netchild

MFC several ZFS related commits:

r197459:
---snip---
    Before calling vflush(FORCECLOSE) mark file system as unmounted so the
    following vnops will fail. This is very important, because without this change
    vnode could be reclaimed at any point, even if we increased usecount. The only
    way to ensure that vnode won't be reclaimed was to lock it, which would be very
    hard to do in ZFS without changing a lot of code. With this change simply
    increasing usecount is enough to be sure vnode won't be reclaimed from under
    us. To be precise it can still be reclaimed but we won't be able to see it,
    because every try to enter ZFS through VFS will result in EIO.

    The only function that cannot return EIO, because it is needed for vflush() is
    zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks
    z_teardown_lock and never returns EIO.
---snip---

r197512:
---snip---
    - Don't depend on value returned by gfs_*_inactive(), it doesn't work
      well with forced unmounts when GFS vnodes are referenced.
    - Make other preparations to GFS for forced unmounts.

    PR:			kern/139062
    Reported by:	trasz
---snip---

r197513:
---snip---
    Use traverse() function to find and return mount point's vnode instead of
cov    ered vnode when snapshot is already mounted.
---snip---

r197513:
---snip---
    Handle cases where virtual (GFS) vnodes are referenced when doing forced
    unmount. In that case we cannot depend on the proper order of invalidating
    vnodes, so we have to free resources when we have a chance.

    PR:			kern/139062
    Reported by:	trasz
---snip---

r197683:
---snip---
    Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old
    format ZFS, as defined in the manual page.

    Submitted by:	pjd (response of my original patch but bugs are mine)
---snip---

r198703:
---snip---
    - zfs_zaccess() can handle VAPPEND too, so map V_APPEND to VAPPEND and call
      zfs_access() instead of vaccess() in this case as well.
    - If VADMIN is specified with another V* flag (unlikely) call both
      zfs_access() and vaccess() after spliting V* flags.

    This fixes "dirtying snapshot!" panic.

    PR:				kern/139806
    Reported by:		Carl Chave <carl@chave.us>
    In co-operation with:	jh
---snip---
While I'm here: fix two comments regarding the members of vop_access_args
to comply what is in RELENG_7.

r199156:
---snip---
    Avoid passing invalid mountpoint to getnewvnode().

    Reported by:	rwatson
    Tested by:	rwatson
---snip---

r200724:
---snip---
    Apply fix Solaris bug 6462803 zfs snapshot -r failed because
    filesystem was busy. (onnv-gate revision 8989)

    Submitted by:	mm
    Approved by:	pjd
---snip---

r200726:
---snip---
    Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG
    (onnv revision 8986)

    Requested by:	mm
    Submitted by:	pjd
    Obtained from:	OpenSolaris
---snip---

r200727 (following is the corrected commit log):
---snip---
    Apply fix for Solaris bug 6764159: restore_object() makes a call
    that can block while having a tx open but not yet committed
    (onnv revision 7994)

    Submitted by:	mm
    Obtained from:	OpenSolaris
---snip---

Revision 1.46.2.7.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 6 21:45:30 2010 UTC (2 years, 1 month ago) by simon
Branches: RELENG_8_0
Diff to: previous 1.46.2.7: preferred, colored; next MAIN 1.46.2.8: preferred, colored
Changes since revision 1.46.2.7: +21 -9 lines
SVN rev 201679 on 2010-01-06 21:45:30Z by simon

Fix BIND named(8) cache poisoning with DNSSEC validation.
[SA-10:01]

Fix ntpd mode 7 denial of service. [SA-10:02]

Fix ZFS ZIL playback with insecure permissions. [SA-10:03]

Various FreeBSD 8.0-RELEASE improvements. [EN-10:01]

Security:	FreeBSD-SA-10:01.bind
Security:	FreeBSD-SA-10:02.ntpd
Security:	FreeBSD-SA-10:03.zfs
Errata:		FreeBSD-EN-10:01.freebsd
Approved by:	so (simon)

Revision 1.31.2.8: download - view: text, markup, annotated - select for diffs
Wed Jan 6 16:09:58 2010 UTC (2 years, 1 month ago) by netchild
Branches: RELENG_7
Diff to: previous 1.31.2.7: preferred, colored
Changes since revision 1.31.2.7: +18 -6 lines
SVN rev 201651 on 2010-01-06 16:09:58Z by netchild

MFC several ZFS related commits:

r196980:
---snip---
    When we automatically mount snapshot we want to return vnode of the mount point
    from the lookup and not covered vnode. This is one of the fixes for using .zfs/
    over NFS.
---snip---

r196982:
---snip---
    We don't export individual snapshots, so mnt_export field in snapshot's
    mount point is NULL. That's why when we try to access snapshots over NFS
    use mnt_export field from the parent file system.
---snip---

r197131:
---snip---
    Tighten up the check for race in zfs_zget() - ZTOV(zp) can not only contain
    NULL, but also can point to dead vnode, take that into account.

    PR:				kern/132068
    Reported by:		Edward Fisk" <7ogcg7g02@sneakemail.com>, kris
    Fix based on patch from:	Jaakko Heinonen <jh@saunalahti.fi>
---snip---

r197133:
---snip---
    - Protect reclaim with z_teardown_inactive_lock.
    - Be prepared for dbuf to disappear in zfs_reclaim_complete() and check if
      z_dbuf field is NULL - this might happen in case of rollback or forced
      unmount between zfs_freebsd_reclaim() and zfs_reclaim_complete().
    - On forced unmount wait for all znodes to be destroyed - destruction can be
      done asynchronously via zfs_reclaim_complete().
---snip---

r197153:
---snip---
    When zfs.ko is compiled with debug, make sure that znode and vnode point at
    each other.
---snip---

r197167:
---snip---
    Work-around READDIRPLUS problem with .zfs/ and .zfs/snapshot/ directories
    by just returning EOPNOTSUPP. This will allow NFS server to fall back to
    regular READDIR.

    Note that converting inode number to snapshot's vnode is expensive operation.
    Snapshots are stored in AVL tree, but based on their names, not inode numbers,
    so to convert inode to snapshot vnode we have to interate over all snalshots.

    This is not a problem in OpenSolaris, because in their READDIRPLUS
    implementation they use VOP_LOOKUP() on d_name, instead of VFS_VGET() on
    d_fileno as we do.

    PR:			kern/125149
    Reported by:	Weldon Godfrey <wgodfrey@ena.com>
    Analysis by:	Jaakko Heinonen <jh@saunalahti.fi>
---snip---

r197177:
---snip---
    Support both case: when snapshot is already mounted and when it is not yet
    mounted.
---snip---

r197201:
---snip---
    - Mount ZFS snapshots with MNT_IGNORE flag, so they are not visible in regular
      df(1) and mount(8) output. This is a bit smilar to OpenSolaris and follows
      ZFS route of not listing snapshots by default with 'zfs list' command.
    - Add UPDATING entry to note that ZFS snapshots are no longer visible in
      mount(8) and df(1) output by default.

    Reviewed by:	kib
---snip---
Note: the MNT_IGNORE part is commented out in this commit and the UPDATING
entry is not merged, as this would be a POLA violation on a stable branch.
This revision is included here, as it also makes locking changes and makes
sure that a snapshot is mounted RO.

r197426:
---snip---
    Restore BSD behaviour - when creating new directory entry use parent directory
    gid to set group ownership and not process gid.

    This was overlooked during v6 -> v13 switch.

    PR:			kern/139076
    Reported by:	Sean Winn <sean@gothic.net.au>
---snip---

r197458:
---snip---
    Close race in zfs_zget(). We have to increase usecount first and then
    check for VI_DOOMED flag. Before this change vnode could be reclaimed
    between checking for the flag and increasing usecount.
---snip---

Revision 1.31.2.7: download - view: text, markup, annotated - select for diffs
Wed Jan 6 13:56:49 2010 UTC (2 years, 1 month ago) by netchild
Branches: RELENG_7
Diff to: previous 1.31.2.6: preferred, colored
Changes since revision 1.31.2.6: +3 -2 lines
SVN rev 201646 on 2010-01-06 13:56:49Z by netchild

MFC several ZFS related commits:

r196662:
---snip---
    Add missing mountpoint vnode locking.

    This fixes panic on assertion with DEBUG_VFS_LOCKS and vfs.usermount=1 when
    regular user tries to mount dataset owned by him.
---snip---

r196703:
---snip---
    Backport the 'dirtying dbuf' panic fix from newer ZFS version.

    Reported by:	Thomas Backman <serenity@exscape.org>
---snip---

r196919:
---snip---
    bzero() on-stack argument, so mutex_init() won't misinterpret that the
    lock is already initialized if we have some garbage on the stack.

    PR:			kern/135480
    Reported by:	Emil Mikulic <emikulic@gmail.com>
---snip---

r196927:
---snip---
    Changing provider size is not really supported by GEOM, but doing so when
    provider is closed should be ok.

    When administrator requests to change ZVOL size do it immediately if ZVOL
    is closed or do it on last ZVOL close.

    PR:			kern/136942
    Requested by:	Bernard Buri <bsd@ask-us.at>
---snip---

r196943:
---snip---
    - Avoid holding mutex around M_WAITOK allocations.
    - Add locking for mnt_opt field.
---snip---

r196944:
---snip---
    Don't recheck ownership on update mount. This will eliminate LOR between
    vfs_busy() and mount mutex. We check ownership in vfs_domount() anyway.

    Noticed by:	kib
    Reviewed by:	kib
---snip---

r196954:
---snip---
    If we have to use avl_find(), optimize a bit and use avl_insert() instead of
    avl_add() (the latter is actually a wrapper around avl_find() + avl_insert()).

    Fix similar case in the code that is currently commented out.
---snip---
Note: This also seems to fix a previous merge hickup.

r196965:
---snip---
    Fix reference count leak for a case where snapshot's mount point is updated.
    Such situation is not supported.

    This problem was triggered by something like this:

	# zpool create tank da0
	# zfs snapshot tank@snap
	# cd /tank/.zfs/snapshot/snap  (this will mount the snapshot)
	# cd
	# mount -u nosuid /tank/.zfs/snapshot/snap  (refcount leak)
	# zpool export tank
	cannot export 'tank': pool is busy
---snip---

r196985:
---snip---
    Only log successful commands! Without this fix we log even unsuccessful
    commands executed by unprivileged users. Action is not really taken, but it is
    logged to pool history, which might be confusing.

    Reported by:	Denis Ahrens <denis@h3q.com>
---snip---

r197151:
---snip---
    Be sure not to overflow struct fid.
---snip---

r197152:
---snip---
    Extend scope of the z_teardown_lock lock for consistency and "just in case".
---snip---

r200124:
---snip---
    Avoid using additional variable for storing an error if we are not going
    to do anything with it.
---snip---

r200158:
---snip---
   We have to eventually look for provider without checking guid as this is need
   for attaching when there is no metadata yet.

   Before r200125 the order of looking for providers was wrong. It was:
   1. Find provider by name.
   2. Find provider by guid.
   3. Find provider by name and guid.

   Where it should have been:
   1. Find provider by name and guid.
   2. Find provider by guid.
   3. Find provider by name.
---snip---
Note: This was already there, but it was not recorded as merged. This commit
fixes a mis-merge (reversed logic).

Revision 1.31.2.6: download - view: text, markup, annotated - select for diffs
Wed Jan 6 08:18:49 2010 UTC (2 years, 1 month ago) by netchild
Branches: RELENG_7
Diff to: previous 1.31.2.5: preferred, colored
Changes since revision 1.31.2.5: +20 -18 lines
SVN rev 201633 on 2010-01-06 08:18:49Z by netchild

MFC several ZFS related commits:
 - taskq changes
 - fixes for race conditions
 - locking fixes
 - bug fixes
 - ...

r185310:
---snip---
    Remove unused variable.

    Found with:	Coverity Prevent(tm)
    CID:	3669,3671
---snip---

r185319:
---snip---
    Fix locking (file descriptor table and Giant around VFS).

    Most submitted by:	kib
    Reviewed by:	kib
---snip---

r192689:
---snip---
    Fix comment.
---snip---

r193110:
---snip---
	work around snapshot shutdown race reported by Henri Hennebert
---snip---

r193440:
---snip---
    Support shared vnode locks for write operations when the offset is
    provided on filesystems that support it.  This really improves mysql
    + innodb performance on ZFS.

    Reviewed by:	jhb, kmacy, jeffr
---snip---
ATTENTION: this commit to releng7 does not allow shared vnode locks
(there are some VFS changes needed before it can be enabled), it only
provides the infrastructure and serves mostly as a diff reduction in
the ZFS code.
A comment has been added to the locking part to explain why no shared
locks are used.

r195627:
---snip---
    In nvpair_native_embedded_array(), meaningless pointers are zeroed.
    The programmer was aware that alignment was not guaranteed in the
    packed structure and used bzero() to NULL out the pointers.
    However, on ia64, the compiler is quite agressive in finding ILP
    and calls to bzero() are often replaced by simple assignments (i.e.
    stores). Especially when the width or size in question corresponds
    with a store instruction (i.e. st1, st2, st4 or st8).

    The problem here is not a compiler bug. The address of the memory
    to zero-out was given by '&packed->nvl_priv' and given the type of
    the 'packed' pointer the compiler could assume proper alignment for
    the replacement of bzero() with an 8-byte wide store to be valid.
    The problem is with the programmer. The programmer knew that the
    address did not have the alignment guarantees needed for a regular
    assignment, but failed to inform the compiler of that fact. In
    fact, the programmer told the compiler the opposite: alignment is
    guaranteed.

    The fix is to avoid using a pointer of type "nvlist_t *" and
    instead use a "char *" pointer as the basis for calculating the
    address. This tells the compiler that only 1-byte alignment can
    be assumed and the compiler will either keep the bzero() call
    or instead replace it with a sequence of byte-wise stores. Both
    are valid.
---snip---

r195822:
---snip---
    Fix extattr_list_file(2) on ZFS in case the attribute directory
    doesn't exist and user doesn't have write access to the file.
    Without this fix, it returns bogus value instead of 0.  For some
    reason this didn't manifest on my kernel compiled with -O0.

    PR:			kern/136601
    Submitted by:	Jaakko Heinonen <jh at saunalahti dot fi>
---snip---

r195909
---snip---
    We don't support ephemeral IDs in FreeBSD and without this fix ZFS can
    panic when in zfs_fuid_create_cred() when userid is negative. It is
    converted to unsigned value which makes IS_EPHEMERAL() macro to
    incorrectly report that this is ephemeral ID. The most reasonable
    solution for now is to always report that the given ID is not ephemeral.

    PR:			kern/132337
    Submitted by:	Matthew West <freebsd@r.zeeb.org>
    Tested by:		Thomas Backman <serenity@exscape.org>, Michael Reifenberger <mike@reifenberger.com>
---snip---

r196291:
---snip---
    - Fix a race where /dev/zfs control device is created before ZFS is fully
      initialized. Also destroy /dev/zfs before doing other deinitializations.
    - Initialization through taskq is no longer needed and there is a race
      where one of the zpool/zfs command loads zfs.ko and tries to do some work
      immediately, but /dev/zfs is not there yet.

    Reported by:	pav
---snip---

r196269:
---snip---
    Fix misalignment in nvpair_native_embedded() caused by the compiler
    replacing the bzero(). See also revision 195627, which fixed the
    misalignment in nvpair_native_embedded_array().
---snip---

r196295:
---snip---
    Remove OpenSolaris taskq port (it performs very poorly in our kernel) and
    replace it with wrappers around our taskqueue(9).
    To make it possible implement taskqueue_member() function which returns 1
    if the given thread was created by the given taskqueue.
---snip---
The taskqueue_member() function is different due to kproc/kthread changes
in releng8 and head, the function was...
Revieved by:	jhb

r196297:
---snip---
    Fix panic in zfs recv code. The last vnode (mountpoint's vnode) can have
    0 usecount.

    Reported by:	Thomas Backman <serenity@exscape.org>
---snip---

r196299:
---snip---
    - We need to recycle vnode instead of freeing znode.

    Submitted by:	avg

    - Add missing vnode interlock unlock.
    - Remove redundant znode locking.
---snip---

r196301:
---snip---
    If z_buf is NULL, we should free znode immediately.

    Noticed by:	avg
---snip---

r196307:
---snip---
    Manage asynchronous vnode release just like Solaris.

    Discussed with:	kmacy
---snip---

Revision 1.46.2.9: download - view: text, markup, annotated - select for diffs
Sat Dec 12 14:44:04 2009 UTC (2 years, 2 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.46.2.8: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.8: +1 -1 lines
SVN rev 200438 on 2009-12-12 14:44:04Z by kib

MFC r200162:
Change VOP_FSYNC for zfs vnode from VOP_PANIC to zfs_freebsd_fsync().

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sat Dec 5 20:36:42 2009 UTC (2 years, 2 months ago) by kib
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +1 -1 lines
SVN rev 200162 on 2009-12-05 20:36:42Z by kib

Change VOP_FSYNC for zfs vnode from VOP_PANIC to zfs_freebsd_fsync(),
both to not panic when fsync(2) is called for fifo on zfs
filedescriptor, and to actually fsync fifo inode to permanent storage.

PR:	kern/141177
Reviewed by:	pjd
MFC after:	1 week

Revision 1.46.2.8: download - view: text, markup, annotated - select for diffs
Sat Nov 14 11:59:59 2009 UTC (2 years, 2 months ago) by pjd
Branches: RELENG_8
Diff to: previous 1.46.2.7: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.7: +21 -9 lines
SVN rev 199266 on 2009-11-14 11:59:59Z by pjd

MFC r198703,r199156,r199157:

r198703:

- zfs_zaccess() can handle VAPPEND too, so map V_APPEND to VAPPEND and call
  zfs_access() instead of vaccess() in this case as well.
- If VADMIN is specified with another V* flag (unlikely) call both
  zfs_access() and vaccess() after spliting V* flags.

This fixes "dirtying snapshot!" panic.

PR:	kern/139806
Reported by:	Carl Chave <carl@chave.us>
In co-operation with:	jh

r199156:

Avoid passing invalid mountpoint to getnewvnode().

Reported by:	rwatson
Tested by:	rwatson

r199157:

Be careful which vattr fields are set during setattr replay.
Without this fix strange things can appear after unclean shutdown like
files with mode set to 07777.

Reported by:	des

Revision 1.59: download - view: text, markup, annotated - select for diffs
Fri Oct 30 23:33:06 2009 UTC (2 years, 3 months ago) by pjd
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +21 -9 lines
SVN rev 198703 on 2009-10-30 23:33:06Z by pjd

- zfs_zaccess() can handle VAPPEND too, so map V_APPEND to VAPPEND and call
  zfs_access() instead of vaccess() in this case as well.
- If VADMIN is specified with another V* flag (unlikely) call both
  zfs_access() and vaccess() after spliting V* flags.

This fixes "dirtying snapshot!" panic.

PR:		kern/139806
Reported by:	Carl Chave <carl@chave.us>
In co-operation with:	jh
MFC after:	3 days

Revision 1.46.2.7: download - view: text, markup, annotated - select for diffs
Mon Oct 12 20:36:55 2009 UTC (2 years, 4 months ago) by pjd
Branches: RELENG_8
CVS tags: RELENG_8_0_BP, RELENG_8_0_0_RELEASE
Branch point for: RELENG_8_0
Diff to: previous 1.46.2.6: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.6: +28 -11 lines
SVN rev 198001 on 2009-10-12 20:36:55Z by pjd

MFC r197831,r197842,r197843,r197860,r197861:

r197831:

Fix situation where Mac OS X NFS client creates a file and when it tries
to set ownership and mode in the same setattr operation, the mode was
overwritten by secpolicy_vnode_setattr().

PR:	kern/118320
Submitted by:	Mark Thompson <info-gentoo@mark.thompson.bz>

r197842:

Fix white-spaces.

r197843:

On FreeBSD it is enough to report provider removal when orphan event is
received, we don't have to do it on every ENXIO error in I/O path.
Solaris has no GEOM so they have to handle it in a less clean way.

r197860:

File system owner is when uid matches and jail matches.

r197861:

Allow file system owner to modify system flags if securelevel permits.

Approved by:	re (kib)

Revision 1.58: download - view: text, markup, annotated - select for diffs
Thu Oct 8 16:05:17 2009 UTC (2 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +11 -10 lines
SVN rev 197861 on 2009-10-08 16:05:17Z by pjd

Allow file system owner to modify system flags if securelevel permits.

MFC after:	3 days

Revision 1.57: download - view: text, markup, annotated - select for diffs
Wed Oct 7 12:38:19 2009 UTC (2 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +17 -1 lines
SVN rev 197831 on 2009-10-07 12:38:19Z by pjd

Fix situation where Mac OS X NFS client creates a file and when it tries
to set ownership and mode in the same setattr operation, the mode was
overwritten by secpolicy_vnode_setattr().

PR:		kern/118320
Submitted by:	Mark Thompson <info-gentoo@mark.thompson.bz>
MFC after:	3 days

Revision 1.46.2.6: download - view: text, markup, annotated - select for diffs
Sun Oct 4 09:07:29 2009 UTC (2 years, 4 months ago) by delphij
Branches: RELENG_8
Diff to: previous 1.46.2.5: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.5: +4 -0 lines
SVN rev 197738 on 2009-10-04 09:07:29Z by delphij

MFC revision 197683:

Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old
format ZFS, as defined in the manual page.

Submitted by:	pjd (response of my original patch but bugs are mine)
Approved by:	re (kib)

Revision 1.56: download - view: text, markup, annotated - select for diffs
Thu Oct 1 18:58:26 2009 UTC (2 years, 4 months ago) by delphij
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +4 -0 lines
SVN rev 197683 on 2009-10-01 18:58:26Z by delphij

Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old
format ZFS, as defined in the manual page.

Submitted by:	pjd (response of my original patch but bugs are mine)
MFC after:	3 days

Revision 1.55: download - view: text, markup, annotated - select for diffs
Wed Sep 23 15:09:34 2009 UTC (2 years, 4 months ago) by trasz
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +2 -2 lines
SVN rev 197435 on 2009-09-23 15:09:34Z by trasz

In VOP_SETACL(9) and VOP_GETACL(9), specifying wrong ACL type should result
in EINVAL, not EOPNOTSUPP.

Revision 1.46.2.5: download - view: text, markup, annotated - select for diffs
Tue Sep 15 11:13:40 2009 UTC (2 years, 4 months ago) by pjd
Branches: RELENG_8
Diff to: previous 1.46.2.4: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.4: +21 -8 lines
SVN rev 197215 on 2009-09-15 11:13:40Z by pjd

MFC r196456,r196457,r196458,r196662,r196702,r196703,r196919,r196927,r196928,
r196943,r196944,r196947,r196950,r196953,r196954,r196965,r196978,r196979,
r196980,r196982,r196985,r196992,r197131,r197133,r197150,r197151,r197152,
r197153,r197167,r197172,r197177,r197200,r197201:

r196456:
- Give minclsyspri and maxclsyspri real values (consulted with kmacy).
- Honour 'pri' argument for thread_create().

r196457:
Set priority of vdev_geom threads and zvol threads to PRIBIO.

r196458:
- Hide ZFS kernel threads under zfskern process.
- Use better (shorter) threads names:
	'zvol:worker zvol/tank/vol00' -> 'zvol tank/vol00'
	'vdev:worker da0' -> 'vdev da0'

r196662:
Add missing mountpoint vnode locking.
This fixes panic on assertion with DEBUG_VFS_LOCKS and vfs.usermount=1 when
regular user tries to mount dataset owned by him.

r196702:
Remove empty directory.

r196703:
Backport the 'dirtying dbuf' panic fix from newer ZFS version.

Reported by:	Thomas Backman <serenity@exscape.org>

r196919:
bzero() on-stack argument, so mutex_init() won't misinterpret that the
lock is already initialized if we have some garbage on the stack.

PR:	kern/135480
Reported by:	Emil Mikulic <emikulic@gmail.com>

r196927:
Changing provider size is not really supported by GEOM, but doing so when
provider is closed should be ok.
When administrator requests to change ZVOL size do it immediately if ZVOL
is closed or do it on last ZVOL close.

PR:	kern/136942
Requested by:	Bernard Buri <bsd@ask-us.at>

r196928:
Teach zdb(8) how to obtain GEOM provider size.

PR:	kern/133134
Reported by:	Philipp Wuensche <cryx-freebsd@h3q.com>

r196943:
- Avoid holding mutex around M_WAITOK allocations.
- Add locking for mnt_opt field.

r196944:
Don't recheck ownership on update mount. This will eliminate LOR between
vfs_busy() and mount mutex. We check ownership in vfs_domount() anyway.

Noticed by:	kib
Reviewed by:	kib

r196947:
Defer thread start until we set priority.

Reviewed by:	kib

r196950:
Fix detection of file system being shared. Now zfs unshare/destroy/rename
command will properly remove exported file systems.

r196953:
When snapshot mount point is busy (for example we are still in it)
we will fail to unmount it, but it won't be removed from the tree,
so in that case there is no need to reinsert it.

Reported by:	trasz

r196954:
If we have to use avl_find(), optimize a bit and use avl_insert() instead of
avl_add() (the latter is actually a wrapper around avl_find() + avl_insert()).
Fix similar case in the code that is currently commented out.

r196965:
Fix reference count leak for a case where snapshot's mount point is updated.

r196978:
Call ZFS_EXIT() after locking the vnode.

r196979:
On FreeBSD we don't have to look for snapshot's mount point,
because fhtovp method is already called with proper mount point.

r196980:
When we automatically mount snapshot we want to return vnode of the mount point
from the lookup and not covered vnode. This is one of the fixes for using .zfs/
over NFS.

r196982:
We don't export individual snapshots, so mnt_export field in snapshot's
mount point is NULL. That's why when we try to access snapshots over NFS
use mnt_export field from the parent file system.

r196985:
Only log successful commands! Without this fix we log even unsuccessful
commands executed by unprivileged users. Action is not really taken, but it is
logged to pool history, which might be confusing.

Reported by:	Denis Ahrens <denis@h3q.com>

r196992:
Implement __assert() for Solaris-specific code. Until now Solaris code was
using Solaris prototype for __assert(), but FreeBSD's implementation.
Both take different arguments, so we were either core-dumping in assert()
or printing garbage.

Reported by:	avg

r197131:
Tighten up the check for race in zfs_zget() - ZTOV(zp) can not only contain
NULL, but also can point to dead vnode, take that into account.

PR:	kern/132068
Reported by:	Edward Fisk <7ogcg7g02@sneakemail.com>, kris
Fix based on patch from:	Jaakko Heinonen <jh@saunalahti.fi>

r197133:
- Protect reclaim with z_teardown_inactive_lock.
- Be prepared for dbuf to disappear in zfs_reclaim_complete() and check if
  z_dbuf field is NULL - this might happen in case of rollback or forced
  unmount between zfs_freebsd_reclaim() and zfs_reclaim_complete().
- On forced unmount wait for all znodes to be destroyed - destruction can be
  done asynchronously via zfs_reclaim_complete().

r197150:
There is a bug where mze_insert() can trigger an assert() of inserting
the same entry twice. This bug is not fixed yet, but leads to situation
where when try to access corrupted directory the kernel will panic.
Until the bug is properly fixed, try to recover from it and log that it
happened.

Reported by:	marck
OpenSolaris bug:	6709336

r197151:
Be sure not to overflow struct fid.

r197152:
Extend scope of the z_teardown_lock lock for consistency and "just in case".

r197153:
When zfs.ko is compiled with debug, make sure that znode and vnode point at
each other.

r197167:
Work-around READDIRPLUS problem with .zfs/ and .zfs/snapshot/ directories
by just returning EOPNOTSUPP. This will allow NFS server to fall back to
regular READDIR.
Note that converting inode number to snapshot's vnode is expensive operation.
Snapshots are stored in AVL tree, but based on their names, not inode numbers,
so to convert inode to snapshot vnode we have to interate over all snalshots.
This is not a problem in OpenSolaris, because in their READDIRPLUS
implementation they use VOP_LOOKUP() on d_name, instead of VFS_VGET() on
d_fileno as we do.

PR:	kern/125149
Reported by:	Weldon Godfrey <wgodfrey@ena.com>
Analysis by:	Jaakko Heinonen <jh@saunalahti.fi>

r197172:
Add missing \n.

Reported by:	marck

r197177:
Support both case: when snapshot is already mounted and when it is not yet
mounted.

r197200:
Modify mount(8) to skip MNT_IGNORE file systems by default, just like df(1)
does. This is not POLA violation, because there is no single file system in the
base that use MNT_IGNORE currently, although ZFS snapshots will be mounted with
MNT_IGNORE after next commit.

Reviewed by:	kib

r197201:
- Mount ZFS snapshots with MNT_IGNORE flag, so they are not visible in regular
  df(1) and mount(8) output. This is a bit smilar to OpenSolaris and follows
  ZFS route of not listing snapshots by default with 'zfs list' command.
- Add UPDATING entry to note that ZFS snapshots are no longer visible in
  mount(8) and df(1) output by default.

Reviewed by:	kib

Approved by:	re (bz)

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sun Sep 13 10:33:51 2009 UTC (2 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +1 -1 lines
SVN rev 197153 on 2009-09-13 10:33:51Z by pjd

When zfs.ko is compiled with debug, make sure that znode and vnode point at
each other.

MFC after:	3 days

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sun Sep 13 10:29:51 2009 UTC (2 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -2 lines
SVN rev 197152 on 2009-09-13 10:29:51Z by pjd

Extend scope of the z_teardown_lock lock for consistency and "just in case".

MFC after:	3 days

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sat Sep 12 19:53:31 2009 UTC (2 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +17 -5 lines
SVN rev 197133 on 2009-09-12 19:53:31Z by pjd

- Protect reclaim with z_teardown_inactive_lock.
- Be prepared for dbuf to disappear in zfs_reclaim_complete() and check if
  z_dbuf field is NULL - this might happen in case of rollback or forced
  unmount between zfs_freebsd_reclaim() and zfs_reclaim_complete().
- On forced unmount wait for all znodes to be destroyed - destruction can be
  done asynchronously via zfs_reclaim_complete().

MFC after:	1 week

Revision 1.51: download - view: text, markup, annotated - select for diffs
Mon Sep 7 19:43:13 2009 UTC (2 years, 5 months ago) by trasz
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +31 -6 lines
SVN rev 196949 on 2009-09-07 19:43:13Z by trasz

Enable NFSv4 ACL support in ZFS.

Reviewed by:	pjd

Revision 1.46.2.4: download - view: text, markup, annotated - select for diffs
Mon Aug 17 09:55:58 2009 UTC (2 years, 5 months ago) by pjd
Branches: RELENG_8
Diff to: previous 1.46.2.3: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.3: +5 -4 lines
SVN rev 196308 on 2009-08-17 09:55:58Z by pjd

MFC r196307:

Manage asynchronous vnode release just like Solaris.

Discussed with:	kmacy
Approved by:	re (kib)

Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon Aug 17 09:48:34 2009 UTC (2 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +5 -4 lines
SVN rev 196307 on 2009-08-17 09:48:34Z by pjd

Manage asynchronous vnode release just like Solaris.

Discussed with:	kmacy
Approved by:	re (kib)

Revision 1.46.2.3: download - view: text, markup, annotated - select for diffs
Mon Aug 17 09:30:31 2009 UTC (2 years, 5 months ago) by pjd
Branches: RELENG_8
Diff to: previous 1.46.2.2: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.2: +7 -7 lines
SVN rev 196304 on 2009-08-17 09:30:31Z by pjd

MFC r196303:

- Reduce z_teardown_lock lock scope a bit.
- The error variable is int, not bool.
- Convert spaces to tabs where needed.

Approved by:	re (kib)

Revision 1.49: download - view: text, markup, annotated - select for diffs
Mon Aug 17 09:28:15 2009 UTC (2 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +7 -7 lines
SVN rev 196303 on 2009-08-17 09:28:15Z by pjd

- Reduce z_teardown_lock lock scope a bit.
- The error variable is int, not bool.
- Convert spaces to tabs where needed.

Approved by:	re (kib)

Revision 1.46.2.2: download - view: text, markup, annotated - select for diffs
Mon Aug 17 09:27:10 2009 UTC (2 years, 5 months ago) by pjd
Branches: RELENG_8
Diff to: previous 1.46.2.1: preferred, colored; branchpoint 1.46: preferred, colored
Changes since revision 1.46.2.1: +9 -7 lines
SVN rev 196302 on 2009-08-17 09:27:10Z by pjd

MFC r196301:

If z_buf is NULL, we should free znode immediately.

Noticed by:	avg
Approved by:	re (kib)

Revision 1.48: download - view: text, markup, annotated - select for diffs
Mon Aug 17 09:25:37 2009 UTC (2 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +9 -7 lines
SVN rev 196301 on 2009-08-17 09:25:37Z by pjd

If z_buf is NULL, we should free znode immediately.

Noticed by:	avg
Approved by:	re (kib)

Revision 1.46.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 17 09:23:27 2009 UTC (2 years, 5 months ago) by pjd
Branches: RELENG_8
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +2 -3 lines
SVN rev 196300 on 2009-08-17 09:23:27Z by pjd

MFC r196299:

- We need to recycle vnode instead of freeing znode.

Submitted by:	avg

- Add missing vnode interlock unlock.
- Remove redundant znode locking.

Approved by:	re (kib)

Revision 1.47: download - view: text, markup, annotated - select for diffs
Mon Aug 17 09:21:39 2009 UTC (2 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +2 -3 lines
SVN rev 196299 on 2009-08-17 09:21:39Z by pjd

- We need to recycle vnode instead of freeing znode.

Submitted by:	avg

- Add missing vnode interlock unlock.
- Remove redundant znode locking.

Approved by:	re (kib)

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed Jul 22 15:15:58 2009 UTC (2 years, 6 months ago) by trasz
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +3 -3 lines
SVN rev 195822 on 2009-07-22 15:15:58Z by trasz

Fix extattr_list_file(2) on ZFS in case the attribute directory
doesn't exist and user doesn't have write access to the file.
Without this fix, it returns bogus value instead of 0.  For some
reason this didn't manifest on my kernel compiled with -O0.

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

Revision 1.45: download - view: text, markup, annotated - select for diffs
Mon Jul 20 19:16:42 2009 UTC (2 years, 6 months ago) by trasz
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +31 -1 lines
SVN rev 195785 on 2009-07-20 19:16:42Z by trasz

Fix permission handling for extended attributes in ZFS.  Without
this change, ZFS uses SunOS Alternate Data Streams semantics - each
EA has its own permissions, which are set at EA creation time
and - unlike SunOS - invisible to the user and impossible to change.
From the user point of view, it's just broken: sometimes access
is granted when it shouldn't be, sometimes it's denied when
it shouldn't be.

This patch makes it behave just like UFS, i.e. depend on current
file permissions.  Also, it fixes returned error codes (ENOATTR
instead of ENOENT) and makes listextattr(2) return 0 instead
of EPERM where there is no EA directory (i.e. the file never had
any EA).

Reviewed by:	pjd (idea, not actual code)
Approved by:	re (kib)

Revision 1.44: download - view: text, markup, annotated - select for diffs
Sun Jun 21 13:41:32 2009 UTC (2 years, 7 months ago) by kib
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -2 lines
SVN rev 194586 on 2009-06-21 13:41:32Z by kib

Add another flags argument to vn_open_cred. Use it to specify that some
vn_open_cred invocations shall not audit namei path.

In particular, specify VN_OPEN_NOAUDIT for dotdot lookup performed by
default implementation of vop_vptocnp, and for the open done for core
file. vn_fullpath is called from the audit code, and vn_open there need
to disable audit to avoid infinite recursion. Core file is created on
return to user mode, that, in particular, happens during syscall return.
The creation of the core file is audited by direct calls, and we do not
want to overwrite audit information for syscall.

Reported, reviewed and tested by: rwatson

Revision 1.43: download - view: text, markup, annotated - select for diffs
Tue May 26 08:21:59 2009 UTC (2 years, 8 months ago) by trasz
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +95 -5 lines
SVN rev 192800 on 2009-05-26 08:21:59Z by trasz

MFp4 changes neccessary for NFSv4 ACLs support in ZFS.  This is mostly
about removing a few #ifdefs and providing compatibility wrappers and
VOP implementations to get and set an ACL; ZFS does ACL enforcement all
by itself.

Note that the VOPs are ifdefed out for now, so this change should be
a no-op.

Reviewed by:	pjd

Revision 1.42: download - view: text, markup, annotated - select for diffs
Sun May 24 15:48:48 2009 UTC (2 years, 8 months ago) by trasz
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +1 -1 lines
SVN rev 192689 on 2009-05-24 15:48:48Z by trasz

Fix comment.

Revision 1.31.2.5: download - view: text, markup, annotated - select for diffs
Wed May 20 23:34:59 2009 UTC (2 years, 8 months ago) by kmacy
Branches: RELENG_7
Diff to: previous 1.31.2.4: preferred, colored
Changes since revision 1.31.2.4: +1545 -288 lines
SVN rev 192498 on 2009-05-20 23:34:59Z by kmacy

MFC ZFS version 13. This includes the changes by pjd (see original message
below) as well as the following:

- the recurring deadlock was fixed by deferring vinactive to a dedicated thread

- zfs boot for all pool types now works
      Submitted by: dfr

- kmem now goes up to 512GB so arc is now limited by physmem

- the arc now experiences backpressure from the vm (which can be too
much - but this allows ZFS to work without any tunables on amd64)

- frequently recurring LOR in the ARC fixed

- zfs send coredump fix

- fixes for various PRs

Supported by: Barrett Lyon, BitGravity

Revision 185029 - (view) (annotate) - [select for diffs]
Modified Mon Nov 17 20:49:29 2008 UTC (6 months ago) by pjd
File length: 38244 byte(s)
Diff to previous 177698

Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.

This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

       Allows regular users to perform ZFS operations, like file system
       creation, snapshot creation, etc.

- L2ARC

       Level 2 cache for ZFS - allows to use additional disks for cache.
       Huge performance improvements mostly for random read of mostly
       static content.

- slog

       Allow to use additional disks for ZFS Intent Log to speed up
       operations like fsync(2).

- vfs.zfs.super_owner

       Allows regular users to perform privileged operations on files stored
       on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

       Not all the flags are supported. This still needs work.

- ZFSBoot

       Support to boot off of ZFS pool. Not finished, AFAIK.

       Submitted by:   dfr

- Snapshot properties

- New failure modes

       Before if write requested failed, system paniced. Now one
       can select from one of three failure modes:

       Before if write requested failed, system paniced. Now one
       can select from one of three failure modes:
       - panic - panic on write error
       - wait - wait for disk to reappear
       - continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

       Just quota and reservation properties, but don't count space consumed
       by children file systems, clones and snapshots.

 - Sparse volumes

       ZVOLs that don't reserve space in the pool.

 - External attributes

       Compatible with extattr(2).

 - NFSv4-ACLs

       Not sure about the status, might not be complete yet.

       Submitted by:   trasz

 - Creation-time properties

 - Regression tests for zpool(8) command.

 Obtained from:        OpenSolaris

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun May 17 01:31:28 2009 UTC (2 years, 8 months ago) by kmacy
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +2 -2 lines
SVN rev 192237 on 2009-05-17 01:31:28Z by kmacy

SAVESTART implies SAVENAME

Revision 1.40: download - view: text, markup, annotated - select for diffs
Thu May 7 20:28:06 2009 UTC (2 years, 9 months ago) by kmacy
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +17 -3 lines
SVN rev 191900 on 2009-05-07 20:28:06Z by kmacy

Asynchronously release vnodes to avoid blocking on range locks when calling back in to zfs.
This is based on a fix that went in to opensolaris on March 9th. However, it uses a dedicated
thread instead of a Solaris' taskq to avoid doing a blocking memory allocation with the vnode
interlock held.

This fixes a long-time deadlock in ZFS. This is not, strictly speaking, an LOR. The spa_zio
thread releases a vnode, this calls in to vn_reclaim which in turn needs to acquire range locks
to sync dirty data out to disk. The range locks are already held by a user-level process waiting
on a condition variable that it the process is waiting on a spa_zio thread to signal it on. The
process could not be signalled because the spa_zio thread could not proceed.

The nature of this problem was not apparent due to ZFS locks opting out of witness which meant
that DDB did not know about the locks that were held by ZFS.

Reviewed by:	pjd
MFC after:	7 days

Revision 1.39: download - view: text, markup, annotated - select for diffs
Fri Apr 10 10:52:19 2009 UTC (2 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +0 -2 lines
SVN rev 190888 on 2009-04-10 10:52:19Z by rwatson

Remove VOP_LEASE and supporting functions.  This hasn't been used since
the removal of NQNFS, but was left in in case it was required for NFSv4.
Since our new NFSv4 client and server can't use it for their
requirements, GC the old mechanism, as well as other unused lease-
related code and interfaces.

Due to its impact on kernel programming and binary interfaces, this
change should not be MFC'd.

Proposed by:    jeff
Reviewed by:    jeff
Discussed with: rmacklem, zach loafman @ isilon

Revision 1.31.2.4: download - view: text, markup, annotated - select for diffs
Thu Feb 19 16:01:00 2009 UTC (2 years, 11 months ago) by kib
Branches: RELENG_7
CVS tags: RELENG_7_2_BP, RELENG_7_2_0_RELEASE, RELENG_7_2
Diff to: previous 1.31.2.3: preferred, colored
Changes since revision 1.31.2.3: +0 -9 lines
SVN rev 188817 on 2009-02-19 16:01:00Z by kib

Unbreak ZFS after the r188610:

MFC r182781 (by pjd):
Catch up after last insmntque() changes:
- The vnode has to be locked exclusively before calling insmntque().
- Until I find a way to handle insmntque() failures use VV_FORCEINSMQ flag
  to force insmntque() to always succeed.

MFC r182824 (by pjd):
Lock vnode exclusively around insmntque().

MFC r182840 (by pjd):
Initialize vp, so we don't call VOP_UNLOCK() with NULL vnode pointer.

Tested by:	cy, pjd
No objections by:	pjd

Revision 1.38: download - view: text, markup, annotated - select for diffs
Fri Feb 13 18:18:14 2009 UTC (2 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +2 -2 lines
SVN rev 188588 on 2009-02-13 18:18:14Z by jhb

Use shared vnode locks when invoking VOP_READDIR().

MFC after:	1 month

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat Nov 22 13:24:44 2008 UTC (3 years, 2 months ago) by pjd
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +54 -3 lines
SVN rev 185172 on 2008-11-22 13:24:44Z by pjd

IFp4: Finish implemnetation of chflags(2) for ZFS. While doing this I found
that zfs_access() can only handle VREAD, VWRITE and VEXEC, for the rest we need
to use vaccess(9).

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Nov 17 20:49:29 2008 UTC (3 years, 2 months ago) by pjd
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +1479 -283 lines
SVN rev 185029 on 2008-11-17 20:49:29Z by pjd

Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.

This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

	Allows regular users to perform ZFS operations, like file system
	creation, snapshot creation, etc.

- L2ARC

	Level 2 cache for ZFS - allows to use additional disks for cache.
	Huge performance improvements mostly for random read of mostly
	static content.

- slog

	Allow to use additional disks for ZFS Intent Log to speed up
	operations like fsync(2).

- vfs.zfs.super_owner

	Allows regular users to perform privileged operations on files stored
	on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

	Not all the flags are supported. This still needs work.

- ZFSBoot

	Support to boot off of ZFS pool. Not finished, AFAIK.

	Submitted by:	dfr

- Snapshot properties

- New failure modes

	Before if write requested failed, system paniced. Now one
	can select from one of three failure modes:
	- panic - panic on write error
	- wait - wait for disk to reappear
	- continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

	Just quota and reservation properties, but don't count space consumed
	by children file systems, clones and snapshots.

- Sparse volumes

	ZVOLs that don't reserve space in the pool.

- External attributes

	Compatible with extattr(2).

- NFSv4-ACLs

	Not sure about the status, might not be complete yet.

	Submitted by:	trasz

- Creation-time properties

- Regression tests for zpool(8) command.

Obtained from:	OpenSolaris

Revision 1.35: 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.34: preferred, colored
Changes since revision 1.34: +2 -2 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.34: download - view: text, markup, annotated - select for diffs
Wed Sep 10 13:16:41 2008 UTC (3 years, 5 months ago) by trasz
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +2 -2 lines
SVN rev 182905 on 2008-09-10 13:16:41Z by trasz

Remove VSVTX, VSGID and VSUID.  This should be a no-op,
as VSVTX == S_ISVTX, VSGID == S_ISGID and VSUID == S_ISUID.

Approved by:	rwatson (mentor)

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat Sep 6 17:24:07 2008 UTC (3 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +0 -9 lines
SVN rev 182824 on 2008-09-06 17:24:07Z by pjd

Lock vnode exclusively around insmntque().

Revision 1.32: 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.31: preferred, colored
Changes since revision 1.31: +0 -2 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.31.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
CVS tags: RELENG_7_1_BP, RELENG_7_1_0_RELEASE, RELENG_7_1
Diff to: previous 1.31.2.2: preferred, colored
Changes since revision 1.31.2.2: +0 -39 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.31.2.2: download - view: text, markup, annotated - select for diffs
Sat Apr 26 13:03:23 2008 UTC (3 years, 9 months ago) by pjd
Branches: RELENG_7
Diff to: previous 1.31.2.1: preferred, colored
Changes since revision 1.31.2.1: +4 -0 lines
MFC:	sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:1.28

Fix mmap(2) on ZFS after some changes in VM subsystem.

Submitted by:	alc
Reported by:	kris (originally) and many others
Reminded by:	kris

Revision 1.31.2.1: download - view: text, markup, annotated - select for diffs
Thu Apr 17 01:23:33 2008 UTC (3 years, 9 months ago) by jb
Branches: RELENG_7
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +48 -13 lines
MFC. The great CDDL file move.

These files were repocopied for HEAD. The repo copy process renames
tags, adding a prefix of 'old_', so the history for these files is
in old_RELENG_7 etc.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed Apr 16 11:33:29 2008 UTC (3 years, 9 months ago) by kib
Branches: MAIN
Branch point for: RELENG_7
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +0 -39 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.30: download - view: text, markup, annotated - select for diffs
Fri Mar 28 22:16:10 2008 UTC (3 years, 10 months ago) by jb
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +0 -0 lines
Forced commit to note that these files were repo copied.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Wed Mar 26 15:23:08 2008 UTC (3 years, 10 months ago) by dfr
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +20 -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.28: download - view: text, markup, annotated - select for diffs
Sat Mar 15 23:23:04 2008 UTC (3 years, 10 months ago) by pjd
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +4 -0 lines
Fix mmap(2) on ZFS after some changes in VM subsystem.

Submitted by:	alc
Reported by:	kris (originally) and many others
Tested with:	fsx
MFC after:	1 week

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Feb 25 18:45:55 2008 UTC (3 years, 11 months ago) by attilio
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -3 lines
Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it is
always curthread.

As KPI gets broken by this patch, manpages and __FreeBSD_version will be
updated by further commits.

Tested by:	Andrea Barberio <insomniac at slackware dot it>

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Jan 13 14:44:01 2008 UTC (4 years, 1 month ago) by attilio
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +1 -1 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.25: download - view: text, markup, annotated - select for diffs
Thu Jan 10 01:10:43 2008 UTC (4 years, 1 month ago) by attilio
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +5 -5 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.24: download - view: text, markup, annotated - select for diffs
Tue Jul 24 15:00:43 2007 UTC (4 years, 6 months ago) by pjd
Branches: MAIN
CVS tags: old_RELENG_7_BP, old_RELENG_7_0_BP, old_RELENG_7_0_0_RELEASE, old_RELENG_7_0, old_RELENG_7
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +1 -1 lines
Update assertion after revision 1.23.

Reviewed by:	dfr
Approved by:	re (rwatson)

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Jul 9 09:03:49 2007 UTC (4 years, 7 months ago) by dfr
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +1 -1 lines
Correct a reference-counting mistake in the ZFS code which led to abnormal
memory usage and pessimal cache performance.

Reviewed by: pjd
Approved by: re (rwatson)

Revision 1.22: download - view: text, markup, annotated - select for diffs
Mon May 28 02:37:43 2007 UTC (4 years, 8 months ago) by pjd
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +1 -0 lines
Adjust va_mask for setattr. FreeBSD doesn't have va_mask, so we initialize it
based on individual fields beeing set. This doesn't work for setattr replay,
because va_type is set there, so we add AT_TYPE flag to va_mask, which won't
be accepted by zfs_setattr().

Reported by:	kris

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun May 6 01:27:54 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +2 -1 lines
MFp4: We don't need to cover vnode_pager_setsize() with the z_map_lock.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Wed May 2 00:41:44 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +6 -2 lines
When parent directory has to be unlocked, lock it back with the same lock
type. Before this change, if directory was shared-locked, it was relocked
exclusively.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed May 2 00:39:52 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +1 -1 lines
Lock vnode using cn_lkflags in case the caller wants the vnode to be
shared-locked.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed May 2 00:18:22 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -1 lines
ZFS should update timestamps upon the creat() of an existing file.

Obtained from:	OpenSolaris
Bug:		http://bugs.opensolaris.org/view_bug.do?bug_id=6465105

Revision 1.17: download - view: text, markup, annotated - select for diffs
Tue May 1 13:58:56 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +6 -1 lines
MFp4:	Remove LK_RETRY flag when locking vnode in zfs_lookup, we don't want
	dead vnodes here.

Suggested by:	kib

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue May 1 13:32:22 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +12 -12 lines
White space fixes.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Tue May 1 12:09:45 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +9 -0 lines
Add a comment explaining why we call dmu_write() unconditionally, even if
uiomove() fails, especially that it is different from what OpenSolaris
does (I'm not entirely sure they are right).

Suggested by:	darrenr

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Apr 29 23:28:07 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +3 -0 lines
- Define d_type for ".", ".." and ".zfs" directories.
- Add a TODO comment where d_type is still noe defined.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sun Apr 29 23:12:00 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +1 -1 lines
Oops, correct important typo in last commit.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Apr 29 23:08:24 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +1 -1 lines
Avoid freeing NULL pointer in case of an error.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Apr 26 17:07:50 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +58 -31 lines
MFp4: Optimize mappedwrite() and mappedread() functions to write/read as much
non-mapped data as possible at once and not page-by-page. Which this change we
combain I/Os, but also saves many VM_OBJECT_UNLOCK()/VM_OBJECT_LOCK()
operations.

Simple 'fsx -l 33554432 -o 524288 -N 10000 /tank/fsx' test shows ~23%
performance increase.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Apr 26 12:58:17 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +9 -7 lines
- Always try to write one whole page at a time.
- vm_page_undirty() is enough (instead of vm_page_set_validclean()), but it has
  to be called before we write the data in case someone makes page dirty after
  our write, but before our vm_page_undirty() call.
- Always dmu_write, not matter if uiomove() succeeded, because it could
  partially be ok and we would lose some changes.

All good ideas from:	ups

Revision 1.9: download - view: text, markup, annotated - select for diffs
Tue Apr 24 16:57:53 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +22 -17 lines
MFp4: Rearange the code so vobject is destroyed from reclaim() method like
in all other file system on FreeBSD (instead from inactive() method).

A nice side-effect of this change, except that it speedups file system
when mmaped file are often open/closed, is that it makes FreeBSD's
namecache work:)

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Apr 24 16:53:01 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -0 lines
MFp4: Once page is written successfully, we should clear the dirty bits.
This fixes slow operations on mmaped files, because without this fix,
pages were written to disk multiple times.

If one is looking for even greater speed up for such operation, he should
disable ZIL (by setting vfs.zfs.zil_disable to 1 in /boot/loader.conf).
Disabling ZIL makes fsx run ~9 times faster.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Apr 24 16:49:01 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -2 lines
MFp4: Reduce diff against vendor.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Apr 23 13:47:49 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +3 -3 lines
Too much diff reduction. 'cmd' has to be u_long.

Reported by:	delphij

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Apr 23 00:52:07 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +768 -468 lines
MFp4: Reduce diff against vendor code:
- Move FreeBSD-specific code to zfs_freebsd_*() functions in zfs_vnops.c
  and keep original functions as similar to vendor's code as possible.
- Add various includes back, now that we have them.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sun Apr 22 21:16:15 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +1 -0 lines
Fix st_rdev handling (implement it, actually).

Reported by:	gj

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Apr 21 12:02:57 2007 UTC (4 years, 9 months ago) by pjd
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +19 -9 lines
MFp4:

@118370	Correct typo.

@118371	Integrate changes from vendor.

@118491	Show backtrace on unexpected code paths.

@118494	Integrate changes from vendor.

@118504	Fix sendfile(2). I had two ways of fixing it:
	1. Fixing sendfile(2) itself to use VOP_GETPAGES() instead of
	   hacking around with vn_rdwr(UIO_NOCOPY), which was suggested
	   by ups.
	2. Modify ZFS behaviour to handle this special case.

	Although 1 is more correct, I've choosen 2, because hack from 1
	have a side-effect of beeing faster - it reads ahead MAXBSIZE
	bytes instead of reading page by page. This is not easy to implement
	with VOP_GETPAGES(), at least not for me in this very moment.

	Reported by:	Andrey V. Elsukov <bu7cher@yandex.ru>

@118525	Reorganize the code to reduce diff.

@118526	This code path is expected. It is simply when file is opened with
	O_FSYNC flag.

	Reported by:	kris
	Reported by:	Michal Suszko <dry@dry.pl>

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat Apr 7 19:11:41 2007 UTC (4 years, 10 months ago) by des
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +3 -3 lines
Fix some type mismatches.

Reviewed by:	pjd@

Revision 1.1: download - view: text, markup, annotated - select for diffs
Fri Apr 6 01:09:02 2007 UTC (4 years, 10 months ago) by pjd
Branches: MAIN
Please welcome ZFS - The last word in file systems.

ZFS file system was ported from OpenSolaris operating system. The code in under
CDDL license.

I'd like to thank all SUN developers that created this great piece of software.

Supported by:	Wheel LTD (http://www.wheel.pl/)
Supported by:	The FreeBSD Foundation (http://www.freebsdfoundation.org/)
Supported by:	Sentex (http://www.sentex.net/)

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