summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* MFC r269708:kib2014-08-221-4/+40
| | | | | Unlock ldvp and lock dvp to compensate for possible ldvp unlock in lower VOP_LOOKUP() and dvp reclamation. Use cached value of dvp->v_mount.
* MFC: r269771rmacklem2014-08-161-4/+3
| | | | | | Change the NFS server's printf related to hitting the DRC cache's flood level so that it suggests increasing vfs.nfsd.tcphighwater.
* MFC r269347:kib2014-08-072-16/+8
| | | | | Do not generate 1000 unique lock names for nfsrc hash chain locks. Shorten the names of some nfs mutexes.
* MFC r269187:kib2014-08-041-0/+4
| | | | | Assert that nullfs vnode has VV_ROOT set whenever lower vnode has. Assert that dotdot lookup on the root vnode is not performed.
* MFC: r268273rmacklem2014-08-031-2/+4
| | | | | | | | | | | | The new NFSv3 server did not generate directory postop attributes for the reply to ReaddirPlus when the server failed within the loop that calls VFS_VGET(). This failure is most likely an error return from VFS_VGET() caused by a bogus d_fileno that was truncated to 32bits. This patch fixes the server so that it will return directory postop attributes for the failure. It does not fix the underlying issue caused by d_fileno being uint32_t when a file system like ZFS generates a fileno that is greater than 32bits.
* MFC: r268115rmacklem2014-08-0118-332/+2060
| | | | | | | | Merge the NFSv4.1 server code in projects/nfsv4.1-server over into head. The code is not believed to have any effect on the semantics of non-NFSv4.1 server behaviour. It is a rather large merge, but I am hoping that there will not be any regressions for the NFS server.
* MFC r268765:kib2014-07-301-1/+0
| | | | Remove unused header.
* MFC r268764:kib2014-07-305-36/+0
| | | | | Check for the cross-device cross-link attempt in the VFS, instead of VOP_LINK() implemenations.
* MFC r268766:kib2014-07-281-1/+3
| | | | Do not ignore error from tmpfs_alloc_vp().
* MFC r268617:kib2014-07-283-27/+74
| | | | Rework the tmpfs unmount.
* MFC r268615:kib2014-07-281-1/+1
| | | | | | | | | | | Add OBJ_TMPFS_NODE flag. MFC r268616: Set the OBJ_TMPFS_NODE flag for vm_object of VREG tmpfs node. MFC r269053: Correct assertion. tmpfs vm object is always at the bottom of the shadow chain.
* MFC r268614:kib2014-07-281-13/+13
| | | | | Use tmpfs_vn_get_ino_gen() to handle the races with reclaim in tmpfs dotdot lookup.
* MFC r268613:kib2014-07-282-1/+2
| | | | Style. Add comment about lock mode.
* MFC r268611:kib2014-07-281-9/+5
| | | | Replace goto's with the return.
* MFC r268610:kib2014-07-282-1/+3
| | | | Add convenience macro to assert tmpfs node lock.
* MFC r268609:kib2014-07-282-0/+3
| | | | Add some assertions for the code handling vm_object for tmpfs vnode.
* MFC r268608:kib2014-07-281-2/+2
| | | | | The tmpfs_link() must not dereference the filesystem-specific data for a vnode until it is verified that the vnode indeed belongs to tmpfs mount.
* MFC r268606:kib2014-07-282-85/+52
| | | | | | Generalize vn_get_ino() to allow filesystems to use custom vnode producer. Convert inline copies of vn_get_ino() in msdosfs and cd9660 into the uses of vn_get_ino_gen().
* MFC r268605:kib2014-07-287-132/+0
| | | | Remove code separator lines which do not conform to style(9).
* MFC r269081:kib2014-07-271-1/+1
| | | | Fix typo.
* MFC r268114:bdrewery2014-07-211-12/+9
| | | | | Change NFS readdir() to only ignore cookies preceding the given offset for UFS rather than for all but ZFS.
* MFC: r268008rmacklem2014-07-131-17/+17
| | | | | | | | | | There might be a potential race condition for the NFSv4 client when a newly created file has another open done on it that update the open mode. This patch moves the code that updates the open mode up into the block where the mutex is held to ensure this cannot happen. No bug caused by this potential race has been observed, but this fix is a safety belt to ensure it cannot happen.
* MFC r265206:mjg2014-07-061-3/+1
| | | | | | | | Ignore the error from pipespace_new when creating a pipe. It can fail if pipe map is exhausted (as a result of too many pipes created), but it is not fatal and could be provoked by unprivileged users. The only consequence is worse performance with given pipe.
* MFC r267564:kib2014-06-245-34/+20
| | | | | In msdosfs_setattr(), add a check for result of the utimes(2) permissions test. Refactor the permission checks for utimes(2).
* MFC r267060:kib2014-06-111-0/+2
| | | | Allow shared locking for the tmpfs vnode.
* MFC: r267191rmacklem2014-06-101-7/+0
| | | | | | | | | The new NFS server would not allow a hard link to be created to a symlink. This restriction (which was inherited from OpenBSD) is not required by the NFS RFCs. Since this is allowed by the old NFS server, it is a POLA violation to not allow it. This patch modifies the new NFS server to allow this.
* MFC r265275:kib2014-05-101-0/+11
| | | | | Overwrite the de_Name for the directories on rename to correct the dot name.
* MFC: r265252rmacklem2014-05-082-6/+20
| | | | | | | | | | | The new draft specification for NFSv4.0 specifies that a server should either accept owner and owner_group strings that are just the digits of the uid/gid or return NFS4ERR_BADOWNER. This patch adds a sysctl vfs.nfsd.enable_stringtouid, which can be set to enable the server w.r.t. accepting numeric string. It also ensures that NFS4ERR_BADOWNER is returned if numeric uid/gid strings are not enabled. This fixes the server for recent Linux nfs4 clients that use numeric uid/gid strings by default.
* MFC: r264888rmacklem2014-05-081-0/+1
| | | | | | The PR reported that the old NFS server did not set uio_td == NULL for the VOP_READ() call. This patch fixes both the old and new server for this case.
* MFC: r264845rmacklem2014-05-071-7/+6
| | | | | | Remove an unnecessary level of indirection for an argument. This simplifies the code and should avoid the clang sparc port from generating an abort() call.
* MFC: r264842rmacklem2014-05-071-2/+5
| | | | | | Modify the NFSv4 client's Pathconf RPC (actually a Getattr Op.) so that it only does the RPC for names that are answered by the RPC. Doing the RPC for other names is harmless, but unnecessary.
* MFC: r264738rmacklem2014-05-061-1/+3
| | | | | | For an NFSv4 mount with the "nocto" option, don't get the up to date file attributes upon close. This reduces the Getattr RPC count by about 65% for software builds.
* MFC: r264705, r264749rmacklem2014-05-062-1/+17
| | | | | | | Modify the NFSv4 client create/mkdir RPC so that it acquires post-create/mkdir directory attributes. This allows the RPC to name cache the newly created directory and reduces the lookup RPC count for applications creating a lot of directories.
* MFC: r264681rmacklem2014-05-062-5/+17
| | | | | | | Modify the NFSv4 client open/create RPC so that it acquires post-open/create directory attributes. This allows the RPC to name cache the newly created file and reduces the lookup RPC count by about 10% for software builds.
* MFC: r264672rmacklem2014-05-063-29/+45
| | | | | | | Modify the Lookup RPC for NFSv4 so that it acquires directory attributes. This allows the client to cache directory names when they are looked up, reducing the Lookup RPC count by about 40% for software builds.
* MFC r264494:ae2014-05-023-18/+64
| | | | | | | | | | | | Use SMB_QUERY_FS_SIZE_INFO request to populate statfs structure. When server doesn't support this request, try to use SMB_INFO_ALLOCATION. And use SMB_COM_QUERY_INFORMATION_DISK request as fallback. MFC r264600: Remove redundant unlock. This code was removed from the opensolaris and darwin's netsmb implementations, in DfBSD it also has been disabled.
* Fix NFS deadlock vulnerability. [SA-14:05]delphij2014-04-081-5/+20
| | | | | Fix "Heartbleed" vulnerability and ECDSA Cache Side-channel Attack in OpenSSL. [SA-14:06]
* MFC r263131,r263174,r263175:bdrewery2014-03-302-27/+38
| | | | | | | | | | | | | | | | Tmpfs readdir() redundant logic and code readability cleanup. r263131: Cleanup redundant logic and add some comments to help explain how it works in lieu of potentially less clear code. r263174: Rename cnt to maxcookies and change its use as the condition for when to lookup cookies to be less obscure. r263175: Add missing FALLTHROUGH comment in tmpfs_dir_getdents for looking up '.' and '..'.
* MFC r263130:bdrewery2014-03-301-2/+4
| | | | Fix -o size less than PAGE_SIZE resulting in SIZE_MAX being used.
* MFC: r263441:pfg2014-03-231-1/+1
| | | | msdosfs: minor format fix - spaces vs tab
* MFC r262869:pfg2014-03-091-1/+1
| | | | | | | | ext2fs: Fix a bug when sorting htree entries. This a typo introduced when bringing the original code from NetBSD. Reported by: Mike Ma
* MFC r262623, r262667:pfg2014-03-0418-221/+219
| | | | | | | | | | ext2fs: use of tab vs spaces. Consistently use a single tab after a #define as mentioned in style(9). Use tabs instead of space for indenting. Fix a typo: "hash_vesion". No functional change.
* MFC r262346:pfg2014-02-272-6/+14
| | | | | | | | | | | | | | | | | ext2fs: fully enable ext4 read-only support. The ext4 developers tend to tag Ext4-specific flags as "incompatible" even when such features are not relevant for read-only support. This is a consequence of the process though which this filesystem is implemented without design and the fact that some new features are not extensible to ext2/3. Organize the features according to what we support and sort them so that we can now read-only mount filesystems with some features that may be found in newly formatted ext4 fs. Submitted by: Zheng Liu
* MFC r261914:dim2014-02-191-0/+2
| | | | In sys/fs/nandfs/nandfs_vfsops.c, #if 0 an unused static function.
* MFC r261136:pfg2014-01-311-2/+2
| | | | | | | | ext2fs: Re-enable reallocblk. The major corruption issues affecting this code have been fixed. Tested by: Mike Ma
* MFC r260988, r261034, r261120, r261235:pfg2014-01-319-26/+35
| | | | | | | | | | | | | | | | ext2fs: Properly the EXT4_EXTENTS and EXT4_INDEX to the inode flags. In order to support Ext4 extents we need to pass the Ext4 inode flags without interfering with the chflags. This is better done by using the i_flag field in the inode and doing proper translation to the linux ext4 equivalents. Solve a potential corruption issue in the dirindex code. The dirindex code can now be renabled as the problems related to it have been solved. Suggested by: bde Tested by: kevlo
* MFC r260229, r260258, r260367, r260390, r260459, r260648:mav2014-01-226-159/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework NFS Duplicate Request Cache cleanup logic. - Introduce additional hash to group requests by hash of sockref. This allows to process TCP acknowledgements without looping though all the cache, and as result allows to do it every time. - Indroduce additional callbacks to notify application layer about sockets disconnection. Without this last few requests processed just before socket disconnection never processed their ACKs and stuck in cache for many hours. - Implement transport-specific method for tracking reply acknowledgements. New implementation does not cross multiple stack layers to get the data and does not have race conditions that previously made some requests stuck in cache. This could be done more efficiently at sockbuf layer, but that would broke some KBIs, while I don't know other consumers for it aside NFS. - Instead of traversing all DRC twice per request, run cleaning only once per request, and except in some conditions traverse only single hash slot at a time. Together this limits NFS DRC growth only to situations of real connectivity problems. If network is working well, and so all replies are acknowledged, cache remains almost empty even after hours of heavy load. Without this change on the same test cache was growing to many thousand requests even with perfectly working local network. As another result this reduces CPU time spent on the DRC handling during SPEC NFS benchmark from about 10% to 0.5%. Sponsored by: iXsystems, Inc.
* MFC r259877:mav2014-01-221-12/+20
| | | | | | | | Slightly simplify expiration logic introduced in r254337. - Do not update the histogram for items we are any way deleting from cache. - Do not update the histogram if nfsrc_tcphighwater is not set. - Remove some extra math operations.
* MFC r259765:mav2014-01-221-7/+11
| | | | | | | | | | | | Fix RPC server threads file handle affinity to work better with ZFS. Instead of taking 8 specific bytes of file handle to identify file during RPC thread affitinity handling, use trivial hash of the full file handle. ZFS's struct zfid_short does not have padding field after the length field, as result, originally picked 8 bytes are loosing lower 16 bits of object ID, causing many false matches and unneeded requests affinity to same thread. This fix substantially improves NFS server latency and scalability in SPEC NFS benchmark by more flexible use of multiple NFS threads.
* MFC r260545:pfg2014-01-141-2/+2
| | | | | | | | | | | | | | | | | | | ext2fs: fix inode flag conversion. After r252890 we are naively attempting to pass through the inode flags. This is technically incorrect as the ext2 inode flags don't match the UFS/system values used in FreeBSD and a clean conversion is needed. Some filtering was left in place so the change didn't cause significant changes in FreeBSD but some of the garbage passed is likely to be the cause for warning messages in linux. Fix the issue by resetting the flags before conversion as was done previously. This also means we will not pass the EXT4_* inode flags into FreeBSD's inode. PR: kern/185448
OpenPOWER on IntegriCloud