summaryrefslogtreecommitdiffstats
path: root/sys/cddl
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in copyright notice.mm2011-11-281-1/+1
| | | | MFC after: 1 month
* Merge new ZFS features from illumos:mm2011-11-2824-118/+808
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1644 add ZFS "clones" property https://www.illumos.org/issues/1644 1645 add ZFS "written" and "written@..." properties https://www.illumos.org/issues/1645 1646 "zfs send" should estimate size of stream https://www.illumos.org/issues/1646 1647 "zfs destroy" should determine space reclaimed by destroying multiple snapshots https://www.illumos.org/issues/1647 1693 persistent 'comment' field for a zpool https://www.illumos.org/issues/1693 1708 adjust size of zpool history data https://www.illumos.org/issues/1708 1748 desire support for reguid in zfs https://www.illumos.org/issues/1748 Obtained from: illumos (changesets 13514, 13524, 13525) MFC after: 1 month
* Existing VOP_VPTOCNP() interface has a fatal flow that is critical forkib2011-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | nullfs. The problem is that resulting vnode is only required to be held on return from the successfull call to vop, instead of being referenced. Nullfs VOP_INACTIVE() method reclaims the vnode, which in combination with the VOP_VPTOCNP() interface means that the directory vnode returned from VOP_VPTOCNP() is reclaimed in advance, causing vn_fullpath() to error with EBADF or like. Change the interface for VOP_VPTOCNP(), now the dvp must be referenced. Convert all in-tree implementations of VOP_VPTOCNP(), which is trivial, because vhold(9) and vref(9) are similar in the locking prerequisites. Out-of-tree fs implementation of VOP_VPTOCNP(), if any, should have no trouble with the fix. Tested by: pho Reviewed by: mckusick MFC after: 3 weeks (subject of re approval)
* Correct the types of the arguments to return probes of the syscallrstone2011-11-111-2/+7
| | | | | | | | provider. Previously we were erroneously supplying the argument types of the corresponding entry probe. Reviewed by: rpaulo MFC after: 1 week
* On i386, fbt probes are implemented by writing an invalid opcode overrstone2011-11-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | certain instructions in a function prologue or epilogue. DTrace has a hook into the invalid opcode fault handler that checks whether the fault was due to an probe and if so, runs the DTrace magic. Upon returning from an invalid opcode fault caused by a probe, DTrace must emulate the instruction that was replaced with the invalid opcode and then return control to the instruction following the invalid opcode. There were a pair of related bugs in the emulation for the leave instruction. The leave instruction is used to pop off a stack frame prior to returning from a function. The emulation for this instruction must move the trap frame for the invalid opcode fault down the stack to the bottom of the stack frame that is being removed, and then execute an iret. At two points in this process, the emulation code was storing values above the current value of the stack pointer. This opened up a window in which if we were two take an interrupt, the trap frame for the interrupt would overwrite the values stored on the stack, causing the system to panic later. The first bug was that at one point the emulation code saves the new value for $esp above the current stack pointer value. The fix is to save this value instead inside of the original trap frame. At this point we do not need the original trap frame so this is safe. The second bug is that when the emulate code loads $esp from the stack, it points part-way through the new trap frame instead of at its beginning. The emulation code adjusts the stack pointer to the correct value immediately afterwards, but this still leaves a one instruction window in which an interrupt would corrupt this trap frame. Fix this by adjusting the stack frame value before loading it into $esp. This fixes panics in invop_leave on i386 when using fbt return probes. Reviewed by: rpaulo, attilio MFC after: 1 week
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-072-2/+2
| | | | This means that their use is restricted to a single C file.
* Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able torstone2011-11-071-3/+8
| | | | | | | write to the .text section of a process. Obtained from: rpaulo MFC after: 3 days
* Correct typo in comment.pjd2011-11-051-1/+1
| | | | | Reported by: Fabian Keil <fk@fabiankeil.de> MFC after: 3 days
* In zvol_open() if the spa_namespace_lock is already held, it means thatpjd2011-11-051-0/+8
| | | | | | | | | ZFS is trying to open and taste ZVOL as its VDEV. This is not supported, so return an error instead of panicing on spa_namespace_lock recursion. Reported by: Robert Millan <rmh@debian.org> PR: kern/162008 MFC after: 3 days
* Fix typo in copyright notice introduced in r226724mm2011-10-251-1/+1
| | | | | | | (missing character in e-mail adress) Reported by: pjd MFC after: 3 days
* Update copyright information in several ZFS files, as the clause 3.3mm2011-10-255-0/+5
| | | | | | | | | | of the CDDL licence explicitly requires every Contributor to add a copyright notice. This also reflects the copyright notices for the changes recently added by Illumos. MFC after: 3 days
* - Use better naming now that we allow to rename any mounted file system (notpjd2011-10-248-9/+24
| | | | | | | only legacy). - Update copyright to include myself. MFC after: 2 weeks
* Don't forget to rename mounted snapshots of the file system being renamed.pjd2011-10-241-1/+1
| | | | MFC after: 2 weeks
* Include <sys/zfs_vfsops.h> only when compiling kernel module.pjd2011-10-241-0/+2
| | | | MFC after: 2 weeks
* Allow to rename file systems without remounting if it is possible.pjd2011-10-248-12/+69
| | | | | | | | | | | | | | | | | | | | It is possible for file systems with 'mountpoint' preperty set to 'legacy' or 'none' - we don't have to change mount directory for them. Currently such file systems are unmounted on rename and not even mounted back. This introduces layering violation, as we need to update 'f_mntfromname' field in statfs structure related to mountpoint (for the dataset we are renaming and all its children). In my opinion it is worth it, as it allow to update FreeBSD in even cleaner way - in ZFS-only configuration root file system is ZFS file system with 'mountpoint' property set to 'legacy'. If root dataset is named system/rootfs, we can snapshot it (system/rootfs@upgrade), clone it (system/oldrootfs), update FreeBSD and if it doesn't boot we can boot back from system/oldrootfs and rename it back to system/rootfs while it is mounted as /. Before it was not possible, because unmounting / was not possible. MFC after: 2 weeks
* Update per-thread I/O statistics collection in ZFS.pjd2011-10-212-2/+9
| | | | | | | | | This allows to see processes I/O activity in 'top -m io' output. PR kern/156218 Reported by: Marcus Reid <marcus@blazingdot.com> Patch by: avg MFC after: 3 days
* zfs vdev_file_io_start: validate vdev before using vdev_tsdpjd2011-10-211-8/+10
| | | | | | | | vdev_tsd can be NULL for certain vdev states. At least in userland testing with ztest. Submitted by: avg MFC after: 3 days
* - Correctly read gang header from raidz.pjd2011-10-201-6/+9
| | | | | | | | | | - Decompress assembled gang block data if compressed. - Verify checksum of a gang header. - Verify checksum of assembled gang block data. - Verify checksum of uber block. Submitted by: avg MFC after: 3 days
* Always pass data size for checksum verification function, as usingpjd2011-10-191-10/+10
| | | | | | | | | | physical block size declared in bp may not always be what we want. For example in case of gang block header physical block size declared in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum calculation failed. This bug could lead to accessing unallocated memory and resets/failures during boot. MFC after: 3 days
* Initialize 'rc' properly before using it. This error could lead to infinitepjd2011-10-191-1/+3
| | | | | | loop when data reconstruction was needed. MFC after: 3 days
* Remove redundant size calculation.pjd2011-10-191-5/+0
| | | | MFC after: 3 days
* Import fix for Illumos bug #1475 to reduce diff against upstream.mm2011-10-181-8/+12
| | | | | | | | | | | | | Panic caused by this bug was already partially fixed by pjd@ in p4 CH 185940 and 185942. Reference: 1475 zfs spill block hold can access invalid spill blkptr https://www.illumos.org/issues/1475 Reviewed by: delphij Obtained from: Illumos (issue 1475, changeset 13469:b8e89e5c4167) MFC after: 1 week
* Fix a bug in sa_find_sizes() which could lead to panic:delphij2011-10-171-2/+2
| | | | | | | | | | | | | | | | When calculating space needed for SA_BONUS buffers, hdrsize is always rounded up to next 8-aligned boundary. However, in two places the round up was done against sum of 'total' plus hdrsize. On the other hand, hdrsize increments by 4 each time, which means in certain conditions, we would end up returning with will_spill == 0 and (total + hdrsize) larger than full_space, leading to a failed assertion because it's invalid for dmu_set_bonus. Sponsored by: iXsystems, Inc. Reviewed by: mm MFC after: 3 days
* Define dtrace_cmpset_long in terms of atomic_cmpset_longmarcel2011-10-161-43/+3
| | | | | and not by virtue of inline assembly. Now this file compiles on all supported architectures.
* In order to maximize the re-usability of kernel code in user space thiskmacy2011-09-162-4/+4
| | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz)
* zfs boot subroutines: correctly specify type of an integer literalavg2011-09-131-1/+1
| | | | | | | Found by adding more warning flags to zfs boot blocks build. Approved by: re (kib) MFC after: 1 week
* Split the vm_page flags PG_WRITEABLE and PG_REFERENCED into atomickib2011-09-061-2/+1
| | | | | | | | | | | | | | | | | 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)
* Generalize ffs_pages_remove() into vn_pages_remove().mm2011-08-251-4/+9
| | | | | | | | | | | Remove mapped pages for all dataset vnodes in zfs_rezget() using new vn_pages_remove() to fix mmapped files changed by zfs rollback or zfs receive -F. PR: kern/160035, kern/156933 Reviewed by: kib, pjd Approved by: re (kib) MFC after: 1 week
* We need to unlock and destroy vnode attached to znode which we are freeing.pjd2011-08-241-0/+14
| | | | | | Reviewed by: kib Approved by: re (bz) MFC after: 1 week
* zfs_ioctl.c: improve code readability in zfs_ioc_dataset_list_next()mm2011-08-132-7/+8
| | | | | | | | | | | | | | | | | | | zvol.c: fix calling of dmu_objset_prefetch() in zvol_create_minors() by passing full instead of relative dataset name and prefetching all visible datasets to be processed later instead of just the pool name Reviewed by: pjd Approved by: re (kib) MFC after: 1 week > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M opensolaris/uts/common/fs/zfs/zfs_ioctl.c M opensolaris/uts/common/fs/zfs/zvol.c
* Fix race between dmu_objset_prefetch() invoked frommm2011-08-131-1/+2
| | | | | | | | | | | | | | | | zfs_ioc_dataset_list_next() and dsl_dir_destroy_check() indirectly invoked from dmu_recv_existing_end() via dsl_dataset_destroy() by not prefetching temporary clones, as these count as always inconsistent. In addition, do not prefetch hidden datasets at all as we are not going to process these later. Filed as Illumos Bug #1346 PR: kern/157728 Tested by: Borja Marcos <borjam@sarenet.es>, mm Reviewed by: pjd Approved by: re (kib) MFC after: 1 week
* Eliminate the zfsdev_state_lock entirely and replace it with thepjd2011-08-124-70/+54
| | | | | | | | | | spa_namespace_lock. This fixes LOR between the spa_namespace_lock and spa_config lock. LOR can cause deadlock on vdevs removal/insertion. Reported by: gibbs, delphij Tested by: delphij Approved by: re (kib) MFC after: 1 week
* Second-to-last commit implementing Capsicum capabilities in the FreeBSDrwatson2011-08-111-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc
* Fix panic in zfs_read() if IO_SYNC flag supplied by checking formm2011-08-021-2/+3
| | | | | | | | | | 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
* Fix integer overflow in txg_delay() by initializingmm2011-08-011-1/+1
| | | | | | | | | | the variable "timeout" as clock_t. Filed as Illumos Bug #1313 Reviewed by: avg Approved by: re (kib) MFC after: 3 days
* Fix serious bug in ZIL that can lead to pool corruptionmm2011-07-301-17/+24
| | | | | | | | | | | | | | in the case of a held dataset during remount. Detailed description is available at: https://www.illumos.org/issues/883 illumos-gate revision: 13380:161b964a0e10 Reviewed by: pjd Approved by: re (kib) Obtained from: Illumos (Bug #883) MFC after: 3 days
* Bring the code more in-line with OpenSolaris source todelphij2011-07-212-2/+21
| | | | | | | ease future port. Reviewed by: pjd, mm Approved by: re (kib)
* A different implementation of r224231 proposed by pjd@,delphij2011-07-213-5/+10
| | | | | | | | | | 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)
* Add a new field to in-core znode, z_rdev, to represent device nodes.delphij2011-07-203-1/+12
| | | | | | | PR: kern/159010 Reviewed by: mm@ Approved by: re (kib) MFC after: 2 weeks
* ZFS tries to allocate blocks evenly across all devices. This means whenmm2011-07-187-28/+130
| | | | | | | | | | | | | devices are imbalanced zfs will lots of CPU searching for space on devices which tend to be pretty full. It should instead fail quickly on the full devices and move onto devices which have more availability. New loader tunable: vfs.zfs.mg_alloc_failures (min = 8) Illumos-gate changeset: 13379:4df42cc92254 Obtained from: Illumos (Bug #1051) MFC after: 2 weeks
* Resurrect the ZFS "aclmode" propertymm2011-07-189-177/+156
| | | | | | | | | Change default of "aclmode" to "discard". Illumos-gate changeset: 13370:8c04143bd318 Obtained from: Illumos (Feature #742) MFC after: 2 weeks
* With retirement of cpumask_t and usage of cpuset_t for representing aattilio2011-07-042-4/+4
| | | | | | | | | | | | | | | mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient. Remove them and replace their usage with custom pc_cpuid magic (as, atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))). This change is not targeted for MFC because of struct pcpu members removal and dependency by cpumask_t retirement. MD review by: marcel, marius, alc Tested by: pluknet MD testing by: marcel, marius, gonzo, andreast
* Add a new "REFCOMPRESSRATIO" property.mm2011-06-283-5/+14
| | | | | | | | | | | | | | For snapshots, this is the same as COMPRESSRATIO, but for filesystems/volumes, the COMPRESSRATIO is based on the data "USED" (ie, includes blocks in children, but not blocks shared with the origin). This is needed to figure out how much space a filesystem would use if it were not compressed (ignoring snapshots). Illumos-gate revision: 13387 Obtained from: Illumos (Feature #1092) MFC after: 2 weeks
* Disable vdev cache (readahead) by default.mm2011-06-281-1/+8
| | | | | | | | | | The vdev cache is very underutilized (hit ratio 30%-70%) and may consume excessive memory on systems with many vdevs. Illumos-gate revision: 13346 Obtained from: Illumos (Bug #175) MFC after: 1 week
* Fix clang warnings.benl2011-06-181-1/+1
| | | | Approved by: philip (mentor)
* Remove C constructs that are incompatible with C++ from variousgibbs2011-06-107-100/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSolaris and ZFS header files. These changes are sufficient to allow a C++ program to use the libzfs library. Note: The majority of these files already included 'extern "C"' declarations, so the intention of providing C++ compatibility already existed even if it wasn't provided. cddl/compat/opensolaris/include/assert.h: Wrap our compatibility assert implementation in 'extern "C"'. Since this is a compatibility header I matched the Solaris style of doing this explicitly rather than rely on FreeBSD's __BEGIN/END_DECLS macro. sys/cddl/compat/opensolaris/sys/kstat.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h: Rename parameters in function declarations that conflict with C++ keywords. This was the solution preferred by members of the Illumos community. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h: In C, nested structures are visible in the global namespace, but in C++, they take on the namespace of the structure in which they are contained. Flatten nested structure definitions within struct zfs_cmd so these structures are visible in the global namespace when compiled in both languages. Sponsored by: Spectra Logic Corporation
* Silence notice on pool creation, import and access.mm2011-06-071-0/+2
| | | | | | Suggested by: Jeremy Chadwick (freebsd-stable@) Discussed with: pjd MFC after: 1 week
* MFCattilio2011-06-061-2/+0
|\
| * Remove empty #ifndefmm2011-06-061-2/+0
| | | | | | | | MFC after: 3 days
* | MFCattilio2011-06-042-2/+18
|\ \ | |/
OpenPOWER on IntegriCloud