summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add "maxfilesize" mount option for tmpfs to allow specifying thejh2010-01-291-57/+8
| | | | | | | | | | | | | | maximum file size limit. Default is UINT64_MAX when the option is not specified. It was useless to set the limit to the total amount of memory and swap in the system. Use tmpfs_mem_info() rather than get_swpgtotal() in tmpfs_mount() to check if there is enough memory available. Remove now unused get_swpgtotal(). Reviewed by: Gleb Kurtsou Approved by: trasz (mentor)
* Patch the experimental NFS client in a manner analogous tormacklem2010-01-285-18/+35
| | | | | | | | r203072 for the regular NFS client. Also, delete two fields of struct nfsmount that are not used by the FreeBSD port of the client. MFC after: 2 weeks
* Don't touch v_interlock; use VI_* macros instead.trasz2010-01-272-8/+8
|
* On LP64 struct ifid is 64-bit aligned while struct fid is 32-bit alignedmarius2010-01-232-10/+17
| | | | | | | | so on architectures with strict alignment requirements we can't just simply cast the latter to the former but need to copy it bytewise instead. PR: 143010 MFC after: 3 days
* Truncate read request rather than returning EIO if the request isjh2010-01-221-4/+2
| | | | | | | | | | larger than MAXPHYS + 1. This fixes a problem with cat(1) when it uses a large I/O buffer. Reported by: Fernando ApesteguĂ­a Suggested by: jilles Reviewed by: des Approved by: trasz (mentor)
* - Change the type of nodes_max to u_int and use "%u" format string tojh2010-01-202-7/+10
| | | | | | | | | | | | | convert its value. [1] - Set default tm_nodes_max to min(pages + 3, UINT32_MAX). It's more reasonable than the old four nodes per page (with page size 4096) because non-empty regular files always use at least one page. This fixes possible overflow in the calculation. [2] - Don't allow more than tm_nodes_max nodes allocated in tmpfs_alloc_node(). PR: kern/138367 Suggested by: bde [1], Gleb Kurtsou [2] Approved by: trasz (mentor)
* Revert parts of r202283:lulf2010-01-181-4/+7
| | | | | | | - Return EOPNOTSUPP before EROFS to be consistent with other filesystems. - Fix setting of the nodump flag for users without PRIV_VFS_SYSFLAGS privilege. Submitted by: jh@
* Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summerlulf2010-01-1417-0/+7533
| | | | | | | | | | | | | | | of Code 2009: - BSDL block and inode allocation policies for ext2fs. This involves the use FFS1 style block and inode allocation for ext2fs. Preallocation was removed since it was GPL'd. - Make ext2fs MPSAFE by introducing locks to per-mount datastructures. - Fixes for kern/122047 PR. - Various small bugfixes. - Move out of gnu/ directory. Sponsored by: Google Inc. Submitted by: Aditya Sarawgi <sarawgi.aditya AT SPAMFREE gmail DOT com>
* - Fix some style bugs in tmpfs_mount(). [1]jh2010-01-132-11/+7
| | | | | | - Remove a stale comment about tmpfs_mem_info() 'total' argument. Reported by: bde [1]
* Update the comment on printing group membership to reflect that factbrooks2010-01-091-1/+1
| | | | | | | that each groupt the process is a member of is printed rather than an entry for each group the user could be a member of. MFC after: 3 days
* Remove unused smbfs_smb_qpathinfo().trasz2010-01-081-110/+0
|
* - Change the type of size_max to u_quad_t because its value is convertedjh2010-01-081-3/+3
| | | | | | | | | | with vfs_scanopt(9) using the "%qu" format string. - Limit the maximum value of size_max to (SIZE_MAX - PAGE_SIZE) to prevent overflow in howmany() macro. PR: kern/141194 Approved by: trasz (mentor) MFC after: 2 weeks
* The test for "same client" for the experimental nfs server over NFSv4rmacklem2010-01-031-1/+1
| | | | | | | | was broken w.r.t. byte range lock conflicts when it was the same client and the request used the open_to_lock_owner4 case, since lckstp->ls_clp was not set. This patch fixes it by using "clp" instead of "lckstp->ls_clp". MFC after: 2 weeks
* Fix three related problems in the experimental nfs client whenrmacklem2010-01-031-24/+19
| | | | | | | checking for conflicts w.r.t. byte range locks for NFSv4. 1 - Return 0 instead of EACCES when a conflict is found, for F_GETLK. 2 - Check for "same file" when checking for a conflict. 3 - Don't check for a conflict for the F_UNLCK case.
* Fix the experimental NFS client so that it can create Unixrmacklem2009-12-311-4/+9
| | | | | | | | domain sockets on an NFSv4 mount point. It was generating incorrect XDR in the request for this case. Tested by: infofarmer MFC after: 2 weeks
* When porting the experimental nfs subsystem to the FreeBSD8 krpc,rmacklem2009-12-263-104/+8
| | | | | | | | | I added 3 functions that were already in the experimental client under different names. This patch deletes the functions in the experimental client and renames the calls to use the other set. (This is just removal of duplicated code and does not fix any bug.) MFC after: 2 weeks
OpenPOWER on IntegriCloud