summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Commit message (Collapse)AuthorAgeFilesLines
* getcwd() (when __getcwd() fails) works by stating current directory, going uppjd2009-08-171-0/+43
| | | | | | | | | | | | | | (..), calling readdir and looking for previous directory inode. In case of .zfs/ directory this doesn't work, because .zfs/ is hidden by default, so it won't be visible in readdir output. Fix this by implementing VPTOCNP for snapshot directories, so __getcwd() doesn't fail and getcwd() doesn't have to use readdir method. This fixes /bin/pwd from within .zfs/snapshot/<name>/. Suggested by: kib Approved by: re (rwatson)
* Manage asynchronous vnode release just like Solaris.pjd2009-08-174-7/+18
| | | | | Discussed with: kmacy Approved by: re (kib)
* - Reduce z_teardown_lock lock scope a bit.pjd2009-08-171-7/+7
| | | | | | | - The error variable is int, not bool. - Convert spaces to tabs where needed. Approved by: re (kib)
* If z_buf is NULL, we should free znode immediately.pjd2009-08-171-7/+9
| | | | | Noticed by: avg Approved by: re (kib)
* - We need to recycle vnode instead of freeing znode.pjd2009-08-171-3/+2
| | | | | | | | | Submitted by: avg - Add missing vnode interlock unlock. - Remove redundant znode locking. Approved by: re (kib)
* Fix panic in zfs recv code. The last vnode (mountpoint's vnode) can havepjd2009-08-171-1/+1
| | | | | | | 0 usecount. Reported by: Thomas Backman <serenity@exscape.org> Approved by: re (kib)
* Remove OpenSolaris taskq port (it performs very poorly in our kernel) andpjd2009-08-171-0/+1
| | | | | | | | 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. Approved by: re (kib)
* - Fix a race where /dev/zfs control device is created before ZFS is fullypjd2009-08-171-25/+21
| | | | | | | | | | 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 Approved by: re (kib)
* We don't support ephemeral IDs in FreeBSD and without this fix ZFS canpjd2009-07-271-0/+4
| | | | | | | | | | | | | 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> Approved by: re (kib) MFC after: 2 weeks
* Fix extattr_list_file(2) on ZFS in case the attribute directorytrasz2009-07-221-3/+3
| | | | | | | | | | 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)
* Fix permission handling for extended attributes in ZFS. Withouttrasz2009-07-203-3/+51
| | | | | | | | | | | | | | | | | | 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)
* Add another flags argument to vn_open_cred. Use it to specify that somekib2009-06-211-2/+2
| | | | | | | | | | | | | | 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
* Rename the host-related prison fields to be the same as the host.*jamie2009-06-131-2/+2
| | | | | | | parameters they represent, and the variables they replaced, instead of abbreviated versions of them. Approved by: bz (mentor)
* pjd has requested that I keep the tunable as zfs_prefetch_disable to ↵kmacy2009-06-114-10/+10
| | | | | | | | minimize gratuitous differences with Opensolaris' ZFS Sorry for the churn
* check against prefetch_enablekmacy2009-06-113-3/+3
|
* use default policy for enabling prefetching unless the TUNABLE is setkmacy2009-06-102-12/+12
|
* As far as I can tell systems that have less than 4GB are more often hurtkmacy2009-06-102-0/+19
| | | | | | | by prefetched than helped. On i386 systems and systems with less than 4GB, prefetch is now disabled by default. I've added a prefetch enable tunable, to enable prefetching for those systems. The prefetch disable tunable will continue to unconditionally disable prefetching.
* Support shared vnode locks for write operations when the offset isps2009-06-041-0/+1
| | | | | | | provided on filesystems that support it. This really improves mysql + innodb performance on ZFS. Reviewed by: jhb, kmacy, jeffr
* Allow the bootfs property to be set for raidz pools on FreeBSD.dfr2009-05-311-3/+14
| | | | Reviewed by: pjd
* fix xdrmem_control to be safe in an if statementkmacy2009-05-301-0/+1
| | | | | | | fix zfs to depend on krpc remove xdr from zfs makefile Submitted by: dchagin@freebsd.org
* MFp4 changes neccessary for NFSv4 ACLs support in ZFS. This is mostlytrasz2009-05-263-11/+95
| | | | | | | | | | | 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
* Fix comment.trasz2009-05-241-1/+1
|
* - back out direct map hackkmacy2009-05-192-103/+12
| | | | - it is no longer needed
* SAVESTART implies SAVENAMEkmacy2009-05-171-2/+2
|
* - allow forced unmountskmacy2009-05-161-4/+4
| | | | - don't assume snapshot was auto-mounted
* only use direct map if system has more than 2GBkmacy2009-05-161-1/+1
|
* apply band-aid to x86_64 systems with more physical memory than kmem by ↵kmacy2009-05-162-12/+103
| | | | allocating from the direct map
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-112-16/+17
| | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
* don't call vn_rele_async_fini in the !_KERNEL casekmacy2009-05-071-0/+2
|
* avoid LOR and gratuitous extra lock acquisitions by moving user_evict list ↵kmacy2009-05-071-6/+16
| | | | | | buffers to a temporary list
* Allow the VM to provide backpressure on the ARC cache as it doeskmacy2009-05-071-0/+9
| | | | on Solaris.
* Asynchronously release vnodes to avoid blocking on range locks when calling ↵kmacy2009-05-073-4/+19
| | | | | | | | | | | | | | | | | | | | 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
* Remove VOP_LEASE and supporting functions. This hasn't been used sincerwatson2009-04-101-2/+0
| | | | | | | | | | | | | | 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
* Revert r190676,190677thompsa2009-04-101-1/+1
| | | | | | | The geom and CAM changes for root_hold are the wrong solution for USB design quirks. Requested by: scottl
* Add a how argument to root_mount_hold() so it can be passed NOWAIT and be calledthompsa2009-04-031-1/+1
| | | | in situations where sleeping isnt allowed.
* The zfs_get_xattrdir() function is used to find the extended attributejhb2009-03-181-0/+2
| | | | | | | | | | | | directory for a znode. When the directory already exists, it returns a referenced but unlocked vnode. When a directory does not yet exist, it calls zfs_make_xattrdir() to create a new one. zfs_make_xattrdir() returns the vnode both referenced and and locked and zfs_get_xattrdir() was leaking this vnode lock to its callers. Fix this by dropping the vnode lock if zfs_make_xattrdir() successfully creates a new extended attribute directory. Reviewed by: pjd
* Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that ajhb2009-03-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | filesystem supports additional operations using shared vnode locks. Currently this is used to enable shared locks for open() and close() of read-only file descriptors. - When an ISOPEN namei() request is performed with LOCKSHARED, use a shared vnode lock for the leaf vnode only if the mount point has the extended shared flag set. - Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but not O_CREAT. - Use a shared vnode lock around VOP_CLOSE() if the file was opened with O_RDONLY and the mountpoint has the extended shared flag set. - Adjust md(4) to upgrade the vnode lock on the vnode it gets back from vn_open() since it now may only have a shared vnode lock. - Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since FIFO's require exclusive vnode locks for their open() and close() routines. (My recent MPSAFE patches for UDF and cd9660 already included this change.) - Enable extended shared operations on UFS, cd9660, and UDF. Submitted by: ups Reviewed by: pjd (ZFS bits) MFC after: 1 month
* Use shared vnode locks when invoking VOP_READDIR().jhb2009-02-131-2/+2
| | | | MFC after: 1 month
* Last step of splitting up minor and unit numbers: remove minor().ed2009-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Inside the kernel, the minor() function was responsible for obtaining the device minor number of a character device. Because we made device numbers dynamically allocated and independent of the unit number passed to make_dev() a long time ago, it was actually a misnomer. If you really want to obtain the device number, you should use dev2udev(). We already converted all the drivers to use dev2unit() to obtain the device unit number, which is still used by a lot of drivers. I've noticed not a single driver passes NULL to dev2unit(). Even if they would, its behaviour would make little sense. This is why I've removed the NULL check. Ths commit removes minor(), minor2unit() and unit2minor() from the kernel. Because there was a naming collision with uminor(), we can rename umajor() and uminor() back to major() and minor(). This means that the makedev(3) manual page also applies to kernel space code now. I suspect umajor() and uminor() isn't used that often in external code, but to make it easier for other parties to port their code, I've increased __FreeBSD_version to 800062.
* MFp4: We don't support TX_CREATE_ACL_ATTR nor TX_MKDIR_ACL_ATTR; code foundtrasz2008-11-251-0/+8
| | | | | | | in zfs_replay.c will panic if it encounters transactions of this type. Make sure we don't put these into the ZIL. Approved by: rwatson (mentor), pjd
* Fix locking (file descriptor table and Giant around VFS).pjd2008-11-252-17/+13
| | | | | Most submitted by: kib Reviewed by: kib
* IFp4: Don't rely on disk IDs and always use vdev guids, which means always lookpjd2008-11-221-219/+69
| | | | | up for components by reading metadata. This might be slower when there are big number of disks in the system, but is definiately more reliable.
* IFp4: Finish implemnetation of chflags(2) for ZFS. While doing this I foundpjd2008-11-221-3/+54
| | | | | that zfs_access() can only handle VREAD, VWRITE and VEXEC, for the rest we need to use vaccess(9).
* IFp4: Don't free pathname too soon, debugging code is still using it.pjd2008-11-221-5/+4
|
* Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.pjd2008-11-17108-9337/+27333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Require write access on a directory being moved from one parenttrasz2008-11-081-0/+8
| | | | | | directory to another in ZFS. Approved by: rwatson (mentor), pjd
* Backoff the last patch. It was overly restrictive - we want to checktrasz2008-11-061-7/+0
| | | | | | | for write permission on target only when moving the target between two directories. Approved by: rwatson (mentor)
* Change ZFS behaviour to match UFS: when moving (rename(2)) a subdirectorytrasz2008-11-061-0/+7
| | | | | | | from one parent directory to another, in addition to the usual access checks one also needs write access to the subdirectory being moved. Approved by: rwatson (mentor), pjd
* Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessarytrasz2008-10-282-5/+5
| | | | | | | 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)
* Remove the struct thread unuseful argument from bufobj interface.attilio2008-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | In particular following functions KPI results modified: - bufobj_invalbuf() - bufsync() and BO_SYNC() "virtual method" of the buffer objects set. Main consumers of bufobj functions are affected by this change too and, in particular, functions which changed their KPI are: - vinvalbuf() - g_vfs_close() Due to the KPI breakage, __FreeBSD_version will be bumped in a later commit. As a side note, please consider just temporary the 'curthread' argument passing to VOP_SYNC() (in bufsync()) as it will be axed out ASAP Reviewed by: kib Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
OpenPOWER on IntegriCloud