summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* For the experimental NFS client, it should always flush dirtyrmacklem2010-04-281-2/+1
| | | | | | | | | | buffers before closing the NFSv4 opens, as the comment states. This patch deletes the call to nfscl_mustflush() which would return 0 for the case where a delegation still exists, which was incorrect and could cause crashes during recovery from an expired lease. MFC after: 1 week
* Delete a diagnostic statement that is no longer useful fromrmacklem2010-04-281-4/+0
| | | | | | the experimental NFS client. MFC after: 1 week
* An NFSv4 server will reply NFSERR_GRACE for non-recovery RPCsrmacklem2010-04-249-37/+46
| | | | | | | | | | | | during the grace period after startup. This grace period must be at least the lease duration, which is typically 1-2 minutes. It seems prudent for the experimental NFS client to wait a few seconds before retrying such an RPC, so that the server isn't flooded with non-recovery RPCs during recovery. This patch adds an argument to nfs_catnap() to implement a 5 second delay for this case. MFC after: 1 week
* When the experimental NFS client is handling an NFSv4 server rebootrmacklem2010-04-228-36/+91
| | | | | | | | | | | | with delegations enabled, the recovery could fail if the renew thread is trying to return a delegation, since it will not do the recovery. This patch fixes the above by having nfscl_recalldeleg() fail with the I/O operations returning EIO, so that they will be attempted later. Most of the patch consists of adding an argument to various functions to indicate the delegation recall case where this needs to be done. MFC after: 1 week
* The cache_enter(9) function shall not be called for doomed dvp.kib2010-04-201-1/+1
| | | | | | | | | | | | | | | | Assert this. In the reported panic, vdestroy() fired the assertion "vp has namecache for ..", because pseudofs may end up doing cache_enter() with reclaimed dvp, after dotdot lookup temporary unlocked dvp. Similar problem exists in ufs_lookup() for "." lookup, when vnode lock needs to be upgraded. Verify that dvp is not reclaimed before calling cache_enter(). Reported and tested by: pho Reviewed by: kan MFC after: 2 weeks
* For the experimental NFS client doing an NFSv4 mount,rmacklem2010-04-201-3/+6
| | | | | | | | | | set the NFSCLFLAGS_RECVRINPROG while doing recovery from an expired lease in a manner similar to r206818 for server reboot recovery. This will prevent the function that acquires stateids for I/O operations from acquiring out of date stateids during recovery. Also, fix up mutex locking on the nfsc_flags field. MFC after: 1 week
* Avoid extraneous recovery cycles in the experimental NFS clientrmacklem2010-04-182-4/+30
| | | | | | | | | | | | | | when an NFSv4 server reboots, by doing two things. 1 - Make the function that acquires a stateid for I/O operations block until recovery is complete, so that it doesn't acquire out of date stateids. 2 - Only allow a recovery once every 1/2 of a lease duration, since the NFSv4 server must provide a recovery grace period of at least a lease duration. This should avoid recoveries caused by an out of date stateid that was acquired for an I/O op. just before a recovery cycle started. MFC after: 1 week
* Revert r206560. The change doesn't work correctly in all cases withjh2010-04-162-24/+0
| | | | multiple devfs mounts.
* Add mutex lock calls to 2 cases in the experimental NFS client'srmacklem2010-04-151-2/+6
| | | | | | renew thread where they were missing. MFC after: 1 week
* The experimental NFS client was not filling in recovery credentialsrmacklem2010-04-155-3/+19
| | | | | | | | | | | for opens done locally in the client when a delegation for the file was held. This could cause the client to crash in crsetgroups() when recovering from a server crash/reboot. This patch fills in the recovery credentials for this case, in order to avoid the client crash. Also, add KASSERT()s to the credential copy functions, to catch any other cases where the credentials aren't filled in correctly. MFC after: 1 week
* - Ignore and report duplicate and empty device names in devfs_populate_loop()jh2010-04-132-0/+24
| | | | | | | | | | instead of causing erratic behavior. Currently make_dev(9) can't fail, so there is no way to report an error to make_dev(9) callers. - Disallow using "." and ".." in device path names. It didn't work previously but now it is reported rather than panicing. - Treat multiple sequential slashes as single in device path names. Discussed with: pjd
* Switch to our preferred 2-clause BSD license.joel2010-04-0719-125/+11
| | | | Approved by: bp
* Harden the experimental NFS server a little, by adding rangermacklem2010-04-061-0/+22
| | | | | | | | | checks on the length of the client's open/lock owner name. Also, add free()'s for one case where they were missing and would have caused a leak if NFSERR_BADXDR had been replied. Probably never happens, but the leak is now plugged, just in case. MFC after: 2 weeks
* Synchronize Coda kernel module definitions in our coda.h to Coda 6'srwatson2010-04-059-137/+149
| | | | | | | | | | | | | | | | | | | coda.h: - CodaFid typdef -> struct CodaFid throughout. - Use unsigned int instead of unsigned long for venus_dirent and other cosmetic fixes. - Introduce cuid_t and cgid_t and use instead of uid_t and gid_t in RPCs. - Synchronize comments and macros. - Use u_int32_t instead of unsigned long for coda_out_hdr. With these changes, a 64-bit Coda kernel module now works with coda6_client, whereas previous userspace and kernel versions of RPCs differed sufficiently to prevent using the file system. This has been verified only with casual testing, but /coda is now usable for at least basic operations on amd64. MFC after: 1 week
* Correct definition of CIOC_KERNEL_VERSION Coda ioctl() for systemsrwatson2010-04-051-1/+1
| | | | | | | where sizeof(int) != sizeof(sizeof(int)), or the ioctl will return EINVAL. MFC after: 3 days
* Harden the experimental NFS server a little, by adding extra checksrmacklem2010-04-041-12/+11
| | | | | | | | | | in the readdir functions for non-positive byte count arguments. For the negative case, set it to the maximum allowable, since it was actually a large positive value (unsigned) on the wire. Also, fix up the readdir function comment a bit. Suggested by: dillon AT apollo.backplane.com MFC after: 2 weeks
* mountmsdosfs: reject too high value of bytes per clusteravg2010-04-021-0/+1
| | | | | | | | | | | | | | | Bytes per cluster are calcuated as bytes per sector times sectors per cluster. Too high value can overflow an internal variable with type that can hold only values in valid range. Trying to use a wider type results in an attempt to read more than MAXBSIZE at once, a panic. Unfortunately, it is FreeBSD newfs_msdos that produces filesystems with invalid parameters for certain types of media. Reported by: Fabian Keil <freebsd-listen@fabiankeil.de>, Paul B. Mahol <onemda@gmail.com> Discussed with: bde, kib MFC after: 1 week X-ToDo: fix newfs_msdos
* Add function vop_rename_fail(9) that performs needed cleanup for lockskib2010-04-021-8/+2
| | | | | | | | and references of the VOP_RENAME(9) arguments. Use vop_rename_fail() in deadfs_rename(). Tested by: Mikolaj Golub MFC after: 1 week
* For the experimental NFS server, add a call to free the lookuprmacklem2010-04-021-0/+1
| | | | | | | | | path buffer for one case where it was missing when doing mkdir. This could have conceivably resulted in a leak of a buffer, but a leak was never observed during testing, so I suspect it would have occurred rarely, if ever, in practice. MFC after: 2 weeks
* Add SAVENAME to the cn_flags for all cases in the experimentalrmacklem2010-04-021-3/+5
| | | | | | | | | | NFS server for the CREATE cn_nameiop where SAVESTART isn't set. I was not aware that this needed to be done by the caller until recently. Tested by: lampa AT fit.vutbr.cz (link case) Submitted by: lampa AT fit.vutbr.cz (link case) MFC after: 2 weeks
* This patch should fix handling of byte range locks locallyrmacklem2010-03-306-279/+525
| | | | | | | | | | | on the server for the experimental nfs server. When enabled by setting vfs.newnfs.locallocks_enable to non-zero, the experimental nfs server will now acquire byte range locks on the file on behalf of NFSv4 clients, such that lock conflicts between the NFSv4 clients and processes running locally on the server, will be recognized and handled correctly. MFC after: 2 weeks
* Patch the experimental NFS server in a manner analagous to r205661rmacklem2010-03-261-0/+3
| | | | | | | for the regular NFS server, to ensure that ESTALE is returned to the client for all errors returned by VFS_FHTOVP(). MFC after: 2 weeks
* Fix the experimental NFS subsystem so that it uses the correctrmacklem2010-03-241-3/+3
| | | | | | | preprocessor macro name for not requiring strict data alignment. Suggested by: marius MFC after: 2 weeks
* Fix a long standing regression of readdir(3) in fdescfs(5) introducedjkim2010-03-161-16/+13
| | | | | | | | in r1.48. We were stopping at the first null pointer when multiple file descriptors were opened and one in the middle was closed. This restores traditional behaviour of fdescfs. MFC after: 3 days
* Provide groundwork for 32-bit binary compatibility on non-x86 platforms,nwhitehorn2010-03-115-19/+16
| | | | | | | | | for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb
* Update nfsrv_getsocksndseq() for changes in TCP internals since FreeBSD 6.x:rwatson2010-03-111-12/+11
| | | | | | | | | | | | | | | | | | | - so_pcb is now guaranteed to be non-NULL and valid if a valid socket reference is held. - Need to check INP_TIMEWAIT and INP_DROPPED before assuming inp_ppcb is a tcpcb, as it might be a tcptw or NULL otherwise. - tp can never be NULL by the end of the function, so only check TCPS_ESTABLISHED before extracting tcpcb fields. The NFS server arguably incorporates too many assumptions about TCP internals, but fixing that is left for nother day. MFC after: 1 week Reviewed by: bz Reviewed and tested by: rmacklem Sponsored by: Juniper Networks
* When returning error from msdosfs_lookup(), make sure that *vpp is NULL.kib2010-03-031-3/+6
| | | | | | | lookup() KASSERTs this condition. Reported and tested by: pho MFC after: 3 weeks
* Do not leak vnode lock when msdosfs mount is updated and specifiedkib2010-03-021-3/+2
| | | | | | | | | | device is different from the device used to the original mount. Note that update_mp does not need devvp locked, and pmp->pm_devvp cannot be freed meantime. Reported and tested by: pho MFC after: 3 weeks
* Only destroy pm_fatlock on error if it was initialized.kib2010-03-021-1/+1
| | | | MFC after: 3 weeks
* Mark msdosfs as mpsafe.kib2010-02-281-0/+1
| | | | | Tested by: pho MFC after: 3 weeks
* Fix the race between dotdot lookup and forced unmount, by usingkib2010-02-281-23/+81
| | | | | | | | | | | msdosfs-specific variant of vn_vget_ino(), msdosfs_deget_dotdot(). As was done for UFS, relookup the dotdot denode after the call to msdosfs_deget_dotdot(), because vnode lock is dropped and directory might be moved. Tested by: pho MFC after: 3 weeks
* Use pm_fatlock to protect per-filesystem rb tree used to allocate filenokib2010-02-281-10/+6
| | | | | | | on the large FAT volumes. Previously, a single global mutex was used. Tested by: pho MFC after: 3 weeks
* Add assertions for FAT bitmap state.kib2010-02-281-0/+8
| | | | | Tested by: pho MFC after: 3 weeks
* Use pm_fatlock to protect fat bitmap.kib2010-02-282-12/+38
| | | | | Tested by: pho MFC after: 3 weeks
* Add per-mountpoint lockmgr lock for msdosfs. It is intended to be usedkib2010-02-282-1/+19
| | | | | | | as fat bitmap lock and to replace global mutex protecting fileno rbtree. Tested by: pho MFC after: 3 weeks
* In msdosfs deget(), properly handle the case when the vnode is found in hash.kib2010-02-281-3/+2
| | | | | Tested by: pho MFC after: 3 weeks
* In msdosfs_inactive(), reclaim the vnodes both for SLOT_DELETED andkib2010-02-281-2/+2
| | | | | | | | | | SLOT_EMPTY deName[0] values. Besides conforming to FAT specification, it also clears the issue where vfs_hash_insert found the vnode in hash, and newly allocated vnode is vput()ed. There, deName[0] == 0, and vnode is not reclaimed, indefinitely kept on mountlist. Tested by: pho MFC after: 3 weeks
* Remove seemingly unneeded unlock/relock of the dvp in msdosfs_rmdir,kib2010-02-281-2/+0
| | | | | | | causing LOR. Reported and tested by: pho MFC after: 3 weeks
* Assert that the msdosfs vnode is (e)locked in several places.kib2010-02-282-8/+8
| | | | | | | | | | The plan is to use vnode lock to protect denode and fat cache, and having separate lock for block use map. Change the check and return on impossible condition into KASSERT(). Tested by: pho MFC after: 3 weeks
* Remove unused global statistic about fat cache usage.kib2010-02-281-21/+0
| | | | | Tested by: pho MFC after: 3 weeks
* Fix common misspelling of hierarchyuqs2010-02-202-2/+2
| | | | | Pointed out by: bf1783 at gmail Approved by: np (cxgb), kientzle (tar, etc.), philip (mentor)
* Invalid filesystem might cause the bp to be never read.kib2010-02-141-1/+2
| | | | | | Noted by: Pedro F. Giffuni <giffunip tutopia com> Obtanined from: NetBSD MFC after: 1 week
* Change the default value for vfs.newnfs.enable_locallocks to 0 forrmacklem2010-02-141-1/+1
| | | | | | | the experimental NFS server, since local locking is known to be broken and the patch to fix it is still a work in progress. MFC after: 5 days
* This fixes the experimental NFS server so that it won't crash in thermacklem2010-02-131-3/+3
| | | | | | | | caching code for IPv6 by fixing a typo that used the incorrect variable. It also fixes the indentation of the statement above it. Reported by: simon AT comsys.ntu-kpi.kiev.ua MFC after: 5 days
* Fix function name in the comment in the second location too.kib2010-02-131-1/+1
| | | | | Submitted by: ed MFC after: 1 week
* - Add idempotency guards so the structures can be used in other utilities.kib2010-02-136-23/+24
| | | | | | | | | | | | | - Update bpb structs with reserved fields. - In direntry struct join deName with deExtension. Although a fix was attempted in the past, these fields were being overflowed, Now this is consistent with the spec, and we can now share the WinChksum code with NetBSD. Submitted by: Pedro F. Giffuni <giffunip tutopia com> Mostly obtained from: NetBSD Reviewed by: bde MFC after: 2 weeks
* Use M_ZERO instead of calling bzero().kib2010-02-131-3/+2
| | | | | | Fix function name in the comment. MFC after: 1 week
* Remove unused macros.kib2010-02-131-3/+0
| | | | MFC after: 1 week
* Patch the experimental NFS client so that there is a timeoutrmacklem2010-01-314-58/+138
| | | | | | | | | | for negative name cache entries in a manner analogous to r202767 for the regular NFS client. Also, make the code in nfs_lookup() compatible with that of the regular client and replace the sysctl variable that enabled negative name caching with the mount point option. MFC after: 2 weeks
* Properly use dev_refl()/dev_rel() in kern.devname.ed2010-01-311-10/+13
| | | | | | | | While there, perform some clean-up fixes. Update some stale comments on struct cdev * instead of dev_t and devfs_random(). Also add some missing whitespace. MFC after: 1 week
OpenPOWER on IntegriCloud