aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* Remove useless variable assignment.Edward Tomasz Napierala2009-09-081-3/+0
| | | | Notes: svn path=/head/; revision=196987
* insmntque_stddtr() clears vp->v_data and resets vp->v_op toKonstantin Belousov2009-09-071-0/+1
| | | | | | | | | | | | dead_vnodeops before calling vgone(). Revert r189706 and corresponding part of the r186560. Noted and reviewed by: tegge Approved by: des (pseudofs part) MFC after: 3 days Notes: svn path=/head/; revision=196920
* The clear_remove() and clear_inodedeps() call vn_start_write(NULL, &mp,Konstantin Belousov2009-09-061-5/+21
| | | | | | | | | | | | | | V_NOWAIT) on the non-busied mount point. Unmount might free ufs-specific mp data, causing ffs_vgetf() to access freed memory. Busy mountpoint before dropping softdep lk. Noted and reviewed by: tegge Tested by: pho MFC after: 1 week Notes: svn path=/head/; revision=196888
* When a UFS node is truncated to the zero length, e.g. by explicitKonstantin Belousov2009-08-141-1/+8
| | | | | | | | | | | | | | | | | | | | truncate(2) call, or by being removed or truncated on open, either new softupdate freeblks structure is allocated to track the freed blocks of the node, or truncation is done syncronously when too many SU dependencies are accumulated. The decision does not take into account the allocated freeblks dependencies, allowing workloads that do huge amount of truncations to exhaust the kernel memory. Take the number of allocated freeblks into consideration for softdep_slowdown(). Reported by: pluknet gmail com Diagnosed and tested by: pho Approved by: re (rwatson) MFC after: 1 month Notes: svn path=/head/; revision=196206
* Fix fpathconf(3) on fifos, in effect making ls(1) properlyEdward Tomasz Napierala2009-07-021-0/+25
| | | | | | | | | | | | display '+' on them. Taken from kern/125613, with cosmetic changes. PR: kern/125613 Submitted by: Jaakko Heinonen <jh at saunalahti dot fi> Approved by: re (kib) Notes: svn path=/head/; revision=195296
* In vn_vget_ino() and their inline equivalents, mnt_ref() the mount pointKonstantin Belousov2009-07-021-0/+2
| | | | | | | | | | | | | | around the sequence that drop vnode lock and then busies the mount point. Not having vlocked node or direct reference to the mp allows for the forced unmount to proceed, making mp unmounted or reused. Tested by: pho Reviewed by: jeff Approved by: re (kensmith) MFC after: 2 weeks Notes: svn path=/head/; revision=195294
* Don't panic on attempt to set ACL on a block device file.Edward Tomasz Napierala2009-07-011-6/+6
| | | | | | | | | | | | This is just a part of kern/125613. PR: kern/125613 Submitted by: Jaakko Heinonen <jh at saunalahti dot fi> Reviewed by: rwatson Approved by: re (kib) Notes: svn path=/head/; revision=195265
* For SU mounts, softdep_fsync() might drop vnode lock, allowing otherKonstantin Belousov2009-06-301-4/+25
| | | | | | | | | | | | | threads to put dirty buffers on the vnode bufobj list. For regular files and synchronous fsync requests, check for the condition and restart the fsync vop if a new dirty buffer arrived. Tested by: pho Approved by: re (kensmith) MFC after: 1 month Notes: svn path=/head/; revision=195187
* Softdep_fsync() may need to lock parent directory of the synced vnode.Konstantin Belousov2009-06-301-0/+18
| | | | | | | | | | | | Use inlined (due to FFSV_FORCEINSMQ) version of vn_vget_ino() to prevent mountpoint from being unmounted and freed while no vnodes are locked. Tested by: pho Approved by: re (kensmith) MFC after: 1 month Notes: svn path=/head/; revision=195186
* Fix a bug reported by pho@ where one can induce a panic by decreasingSean Nicholas Barkas2009-06-251-1/+4
| | | | | | | | | | | | | | | | | | vfs.ufs.dirhash_maxmem below the current amount of memory used by dirhash. When ufsdirhash_build() is called with the memory in use greater than dirhash_maxmem, it attempts to free up memory by calling ufsdirhash_recycle(). If successful in freeing enough memory, ufsdirhash_recycle() leaves the dirhash list locked. But at this point in ufsdirhash_build(), the list is not explicitly unlocked after the call(s) to ufsdirhash_recycle(). When we next attempt to lock the dirhash list, we will get a "panic: _mtx_lock_sleep: recursed on non-recursive mutex dirhash list". Tested by: pho Approved by: dwmalone (mentor) MFC after: 3 weeks Notes: svn path=/head/; revision=195003
* Rework the credential code to support larger values of NGROUPS andBrooks Davis2009-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024 and 1023 respectively. (Previously they were equal, but under a close reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it is the number of supplemental groups, not total number of groups.) The bulk of the change consists of converting the struct ucred member cr_groups from a static array to a pointer. Do the equivalent in kinfo_proc. Introduce new interfaces crcopysafe() and crsetgroups() for duplicating a process credential before modifying it and for setting group lists respectively. Both interfaces take care for the details of allocating groups array. crsetgroups() takes care of truncating the group list to the current maximum (NGROUPS) if necessary. In the future, crsetgroups() may be responsible for insuring invariants such as sorting the supplemental groups to allow groupmember() to be implemented as a binary search. Because we can not change struct xucred without breaking application ABIs, we leave it alone and introduce a new XU_NGROUPS value which is always 16 and is to be used or NGRPS as appropriate for things such as NFS which need to use no more than 16 groups. When feasible, truncate the group list rather than generating an error. Minor changes: - Reduce the number of hand rolled versions of groupmember(). - Do not assign to both cr_gid and cr_groups[0]. - Modify ipfw to cache ucreds instead of part of their contents since they are immutable once referenced by more than one entity. Submitted by: Isilon Systems (initial implementation) X-MFC after: never PR: bin/113398 kern/133867 Notes: svn path=/head/; revision=194498
* Keep dirhash tailq locked throughout the entirety of ufsdirhash_destroy() to fixSean Nicholas Barkas2009-06-171-11/+11
| | | | | | | | | | | | | a potential race pointed out by pjd. Also use TAILQ_FOREACH_SAFE to iterate over dirhashes in ufsdirhash_lowmem(), so that we can continue iterating even after a dirhash is destroyed. Suggested by: pjd Tested by: pho Approved by: dwmalone (mentor) Notes: svn path=/head/; revision=194387
* Do not use casts (int *)0 and (struct thread *)0 for the arguments ofKonstantin Belousov2009-06-162-2/+2
| | | | | | | | | | vn_rdwr, use NULL. Reviewed by: jhb MFC after: 1 week Notes: svn path=/head/; revision=194296
* Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERICRobert Watson2009-06-052-2/+0
| | | | | | | | | | | and used in a large number of files, but also because an increasing number of incorrect uses of MAC calls were sneaking in due to copy-and-paste of MAC-aware code without the associated opt_mac.h include. Discussed with: pjd Notes: svn path=/head/; revision=193511
* Add vm_lowmem event handler for dirhash. This will cause dirhashes to beSean Nicholas Barkas2009-06-032-26/+109
| | | | | | | | | | | | | | | | deleted when the system is low on memory. This ought to allow an increase to vfs.ufs.dirhash_maxmem on machines that have lots of memory, without degrading performance by having too much memory reserved for dirhash when other things need it. The default value for dirhash_maxmem is being kept at 2MB for now, though. This work was mostly done during the 2008 Google Summer of Code. Approved by: dwmalone (mentor), re MFC after: 3 months Notes: svn path=/head/; revision=193375
* Handle lock recursion differenty by always checking against LO_RECURSABLEAttilio Rao2009-06-021-2/+2
| | | | | | | | | instead the lock own flag itself. Tested by: pho Notes: svn path=/head/; revision=193307
* Add hierarchical jails. A jail may further virtualize its environmentJamie Gritton2009-05-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | by creating a child jail, which is visible to that jail and to any parent jails. Child jails may be restricted more than their parents, but never less. Jail names reflect this hierarchy, being MIB-style dot-separated strings. Every thread now points to a jail, the default being prison0, which contains information about the physical system. Prison0's root directory is the same as rootvnode; its hostname is the same as the global hostname, and its securelevel replaces the global securelevel. Note that the variable "securelevel" has actually gone away, which should not cause any problems for code that properly uses securelevel_gt() and securelevel_ge(). Some jail-related permissions that were kept in global variables and set via sysctls are now per-jail settings. The sysctls still exist for backward compatibility, used only by the now-deprecated jail(2) system call. Approved by: bz (mentor) Notes: svn path=/head/; revision=192895
* Make 'struct acl' larger, as required to support NFSv4 ACLs. ProvideEdward Tomasz Napierala2009-05-221-126/+162
| | | | | | | | | compatibility interfaces in both kernel and libc. Reviewed by: rwatson Notes: svn path=/head/; revision=192586
* Introduce vfs_bio_set_valid() and use it from ffs_realloccg(). ThisAlan Cox2009-05-171-8/+6
| | | | | | | | | eliminates the misuse of vfs_bio_clrbuf() by ffs_realloccg(). In collaboration with: tegge Notes: svn path=/head/; revision=192260
* Remove the thread argument from the FSD (File-System Dependent) parts ofAttilio Rao2009-05-114-20/+26
| | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=191990
* Do not embed struct ucred into larger netcred parent structures.Alexander Kabaev2009-05-091-1/+0
| | | | | | | | | | | | | | | | Credential might need to hang around longer than its parent and be used outside of mnt_explock scope controlling netcred lifetime. Use separate reference-counted ucred allocated separately instead. While there, extend mnt_explock coverage in vfs_stdexpcheck and clean-up some unused declarations in new NFS code. Reported by: John Hickey PR: kern/133439 Reviewed by: dfr, kib Notes: svn path=/head/; revision=191940
* Change the semantics of i_modrev/va_filerev to what is required forRick Macklem2009-04-273-6/+6
| | | | | | | | | | | | | | | | | | | the nfsv4 Change attribute. There are 2 changes: 1 - The value now changes on metadata changes as well as data modifications (incremented for IN_CHANGE instead of IN_UPDATE). 2 - It is now saved in spare space in the on-disk i-node so that it survives a crash. Since va_filerev is not passed out into user space, the only current use of va_filerev is in the nfs server, which uses it as the directory cookie verifier. Since this verifier is only passed back to the server by a client verbatim and then the server doesn't check it, changing the semantics should not break anything currently in FreeBSD. Reviewed by: bde Approved by: kib (mentor) Notes: svn path=/head/; revision=191564
* In ufs_checkpath(), recheck that '..' still points to the inode withKonstantin Belousov2009-04-203-41/+55
| | | | | | | | | | | | | | | | | | | | | the same inode number after VFS_VGET() and relock of the vp. If '..' changed, redo the lookup. To reduce code duplication, move the code to read '..' dirent into the static helper function ufs_dir_dd_ino(). Supply the source inode number as an argument to ufs_checkpath() instead of the source inode itself. The inode is unlocked, thus it might be reclaimed, causing accesses to the freed memory. Use vn_vget_ino() to get the '..' vnode by its inode number, instead of directly code VFS_VGET() and relock, to properly busy the mount point while vp lock is dropped. Noted and reviewed by: tegge Tested by: pho MFC after: 1 month Notes: svn path=/head/; revision=191315
* When verifying '..' after VFS_VGET() in ufs_lookup(), do not returnKonstantin Belousov2009-04-191-15/+17
| | | | | | | | | | | | | | | | error if '..' is still there but changed between lookup and check. Start relookup instead. Rename is supposed to change '..' reference atomically, so transient failures introduced by r191137 are wrong. While rearranging the code to allow lookup restart in ufs_lookup(), remove the comment that only distracts the reader. Noted and reviewed by: tegge Also reported by: pho MFC after: 1 month Notes: svn path=/head/; revision=191260
* Use acl_alloc() and acl_free() instead of using uma(9) directly.Edward Tomasz Napierala2009-04-181-19/+19
| | | | | | | | | This will make switching to malloc(9) easier; also, it would be neccessary to add these routines if/when we implement variable-size ACLs. Notes: svn path=/head/; revision=191249
* Verify that '..' still exists with the same inode number afterKonstantin Belousov2009-04-161-9/+35
| | | | | | | | | | | | | | | | | | VFS_VGET() has returned in ufs_lookup(). If the '..' lookup started immediately before the parent directory was removed, we might return either cleared or unrelated inode otherwise. Ufs_lookup() is split into new function ufs_lookup_() that either does lookup, or verifies that directory entry exists and references supplied inode number. Reviewed by: tegge Tested by: pho, Andreas Tobler <andreast-list fgznet ch> (previous version) MFC after: 1 month Notes: svn path=/head/; revision=191137
* Remove VOP_LEASE and supporting functions. This hasn't been used sinceRobert Watson2009-04-101-1/+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 Notes: svn path=/head/; revision=190888
* When removing or renaming snaphost, do not delve into request_cleanup().Konstantin Belousov2009-04-041-1/+1
| | | | | | | | | | | The later may need blocks from the underlying device that belongs to normal files, that should not be locked while snap lock is held. Reported and tested by: pho MFC after: 1 month Notes: svn path=/head/; revision=190690
* Correct typo.Konstantin Belousov2009-03-271-2/+2
| | | | | | | Noted by: kensmith Notes: svn path=/head/; revision=190469
* Fix two issues with bufdaemon, often causing the processes to hang inKonstantin Belousov2009-03-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the "nbufkv" sleep. First, ffs background cg group block write requests a new buffer for the shadow copy. When ffs_bufwrite() is called from the bufdaemon due to buffers shortage, requesting the buffer deadlock bufdaemon. Introduce a new flag for getnewbuf(), GB_NOWAIT_BD, to request getblk to not block while allocating the buffer, and return failure instead. Add a flag argument to the geteblk to allow to pass the flags to getblk(). Do not repeat the getnewbuf() call from geteblk if buffer allocation failed and either GB_NOWAIT_BD is specified, or geteblk() is called from bufdaemon (or its helper, see below). In ffs_bufwrite(), fall back to synchronous cg block write if shadow block allocation failed. Since r107847, buffer write assumes that vnode owning the buffer is locked. The second problem is that buffer cache may accumulate many buffers belonging to limited number of vnodes. With such workload, quite often threads that own the mentioned vnodes locks are trying to read another block from the vnodes, and, due to buffer cache exhaustion, are asking bufdaemon for help. Bufdaemon is unable to make any substantial progress because the vnodes are locked. Allow the threads owning vnode locks to help the bufdaemon by doing the flush pass over the buffer cache before getnewbuf() is going to uninterruptible sleep. Move the flushing code from buf_daemon() to new helper function buf_do_flush(), that is called from getnewbuf(). The number of buffers flushed by single call to buf_do_flush() from getnewbuf() is limited by new sysctl vfs.flushbufqtarget. Prevent recursive calls to buf_do_flush() by marking the bufdaemon and threads that temporarily help bufdaemon by TDP_BUFNEED flag. In collaboration with: pho Reviewed by: tegge (previous version) Tested by: glebius, yandex ... MFC after: 3 weeks Notes: svn path=/head/; revision=189878
* The non-modifying EA VOPs are executed with only shared vnode lock taken.Konstantin Belousov2009-03-123-63/+94
| | | | | | | | | | | | | | | | Provide a custom lock around initializing and tearing down EA area, to prevent both memory leaks and double-free of it. Count the number of EA area accessors. Lock protocol requires either holding exclusive vnode lock to modify i_ea_area, or shared vnode lock and owning IN_EA_LOCKED flag in i_flag. Noted by: YAMAMOTO, Taku <taku tackymt homeip net> Tested by: pho (previous version) MFC after: 2 weeks Notes: svn path=/head/; revision=189737
* Do not double-free the struct inode when insmntque failed. DefaultKonstantin Belousov2009-03-111-1/+0
| | | | | | | | | | insmntque destructor reclaims the vnode, and ufs_reclaim frees the memory. Reviewed by: tegge MFC after: 3 days Notes: svn path=/head/; revision=189706
* Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that aJohn Baldwin2009-03-111-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=189696
* Adjust some variables (mostly related to the buffer cache) that holdJohn Baldwin2009-03-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | address space sizes to be longs instead of ints. Specifically, the follow values are now longs: runningbufspace, bufspace, maxbufspace, bufmallocspace, maxbufmallocspace, lobufspace, hibufspace, lorunningspace, hirunningspace, maxswzone, maxbcache, and maxpipekva. Previously, a relatively small number (~ 44000) of buffers set in kern.nbuf would result in integer overflows resulting either in hangs or bogus values of hidirtybuffers and lodirtybuffers. Now one has to overflow a long to see such problems. There was a check for a nbuf setting that would cause overflows in the auto-tuning of nbuf. I've changed it to always check and cap nbuf but warn if a user-supplied tunable would cause overflow. Note that this changes the ABI of several sysctls that are used by things like top(1), etc., so any MFC would probably require a some gross shims to allow for that. MFC after: 1 month Notes: svn path=/head/; revision=189595
* Right now, when trying to unmount a device that's already gone,Edward Tomasz Napierala2009-02-231-2/+2
| | | | | | | | | | | | | | | msdosfs_unmount() and ffs_unmount() exit early after getting ENXIO. However, dounmount() treats ENXIO as a success and proceeds with unmounting. In effect, the filesystem gets unmounted without closing GEOM provider etc. Reviewed by: kib Approved by: rwatson (mentor) Tested by: dho Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=188956
* Refactor, moving error checking outside of theEdward Tomasz Napierala2009-02-231-7/+7
| | | | | | | | | | | | | 'if (mp->mnt_flag & MNT_SOFTDEP)' conditional. No functional changes. Reviewed by: kib Approved by: rwatson (mentor) Tested by: pho Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=188954
* - If the g_access() call for the initial root mount fails, then fullyJohn Baldwin2009-02-111-6/+6
| | | | | | | | | | | cleanup. Before the GEOM consumer would not have been closed. - Bump the reference on the character device being mounted while the associated devfs vnode is locked. Reviewed by: kib Notes: svn path=/head/; revision=188501
* When a device containing mounted UFS filesystem disappears, the typeEdward Tomasz Napierala2009-02-061-4/+4
| | | | | | | | | | | | | | | | | | of devvp becomes VBAD, which UFS incorrectly interprets as snapshot vnode, which in turns causes panic. Fix it by replacing '!= VCHR' with '== VREG'. With this fix in place, you should no longer be able to panic the system by removing a device with an UFS filesystem mounted from it - assuming you don't use softupdates. Reviewed by: kib Tested by: pho Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=188240
* Make sure the cdev doesn't go away while the filesystem is still mounted.Edward Tomasz Napierala2009-01-291-0/+3
| | | | | | | | | | | Otherwise dev2udev() could return garbage. Reviewed by: kib Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=187894
* Following a fair amount of real world experience with ACLs andRobert Watson2009-01-275-39/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | extended attributes since FreeBSD 5, make the following semantic changes: - Don't update the inode modification time (mtime) when extended attributes (and hence also ACLs) are added, modified, or removed. - Don't update the inode access tie (atime) when extended attributes (and hence also ACLs) are queried. This means that rsync (and related tools) won't improperly think that the data in the file has changed when only the ACL has changed. Note that ffs_reallocblks() has not been changed to not update on an IO_EXT transaction, but currently EAs don't use the cluster write routines so this shouldn't be a problem. If EAs grow support for clustering, then VOP_REALLOCBLKS() will need to grow a flag argument to carry down IO_EXT to UFS. MFC after: 1 week PR: ports/125739 Reported by: Alexander Zagrebin <alexz@visp.ru> Tested by: pluknet <pluknet@gmail.com>, Greg Byshenk <freebsd@byshenk.net> Discussed with: kib, kientzle, timur, Alexander Bokovoy <ab@samba.org> Notes: svn path=/head/; revision=187790
* Fix a few style bogons.John Baldwin2009-01-211-2/+2
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=187564
* Move the code from ufs_lookup.c used to do dotdot lookup, intoKonstantin Belousov2009-01-211-22/+1
| | | | | | | | | | | | the helper function. It is supposed to be useful for any filesystem that has to unlock dvp to walk to the ".." entry in lookup routine. Requested by: jhb Tested by: pho MFC after: 1 month Notes: svn path=/head/; revision=187528
* Move the VA_MARKATIME flag for VOP_SETATTR() out into its own VOP:John Baldwin2009-01-211-11/+22
| | | | | | | | | | | | | | | VOP_MARKATIME() since unlike the rest of VOP_SETATTR(), VA_MARKATIME can be performed while holding a shared vnode lock (the same functionality is done internally by VOP_READ which can run with a shared vnode lock). Add missing locking of the vnode interlock to the ufs implementation and remove a special note and test from the NFS client about not supporting the feature. Inspired by: ups Tested by: pho Notes: svn path=/head/; revision=187526
* The r187467 should remove all pages for V_NORMAL case too, becauseKonstantin Belousov2009-01-201-8/+17
| | | | | | | | | | | | | | indirect block pages are not removed by the mentioned invocation of the vnode_pager_setsize(). Put a common code into the helper function ffs_pages_remove(). Reported and tested by: dchagin Reviewed by: ups MFC after: 3 weeks Notes: svn path=/head/; revision=187490
* Add a comment explaining why the "bufwait" / "dirhash" LOR reported byJohn Baldwin2009-01-201-0/+12
| | | | | | | | | | WITNESS will not actually result in a deadlock. Discussed with: kib MFC after: 1 week Notes: svn path=/head/; revision=187474
* When extending inode size, we call vnode_pager_setsize(), to have aKonstantin Belousov2009-01-202-2/+6
| | | | | | | | | | | | | | | | | address space where to put vnode pages, and then call UFS_BALLOC(), to actually allocate new block and map it. When UFS_BALLOC() returns error, sometimes we forget to revert the vm object size increase, allowing for the pages that are not backed by the logical disk blocks. Revert vnode_pager_setsize() back when UFS_BALLOC() failed, for ffs_truncate() and ffs_write(). PR: 129956 Reviewed by: ups MFC after: 3 weeks Notes: svn path=/head/; revision=187468
* FFS puts the extended attributes blocks at the negative blocks for theKonstantin Belousov2009-01-201-0/+9
| | | | | | | | | | | | | | | | | | | | | vnode, from -1 down. When vinvalbuf(vp, V_ALT) is done for the vnode, it incorrectly does vm_object_page_remove(0, 0), removing all pages from the underlying vm object, not only the pages that back the extended attributes data. Change vinvalbuf() to not remove any pages from the object when V_NORMAL or V_ALT are specified. Instead, the only in-tree caller in ffs_inode.c:ffs_truncate() that specifies V_ALT explicitely removes the corresponding page range. The V_NORMAL caller does vnode_pager_setsize(vp, 0) immediately after the call to vinvalbuf(V_NORMAL) already. Reported by: csjp Reviewed by: ups MFC after: 3 weeks Notes: svn path=/head/; revision=187467
* Lock the uepm_lock around the autostart of extattrs.Konstantin Belousov2009-01-081-15/+30
| | | | | | | | | Reported and tested by: pho Reviewed by: rwatson MFC after: 3 weeks Notes: svn path=/head/; revision=186898
* If unmount of the ffs mp failed, reinitialize the extended attributesKonstantin Belousov2009-01-081-0/+14
| | | | | | | | | | | for the mp, and restart them if autostart is enabled. Reported and tested by: pho Reviewed by: rwatson MFC after: 3 weeks Notes: svn path=/head/; revision=186897
* Do not busy twice the mount point where a quota operation is performed.Konstantin Belousov2008-12-181-4/+0
| | | | | | | | Tested by: pho MFC after: 1 month Notes: svn path=/head/; revision=186278