summaryrefslogtreecommitdiffstats
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* Journal start looks up .sujournal file by doing lookup on the root dvp.kib2010-12-011-0/+1
| | | | | | | | | | As result, failed softdep_mount() might leave up to two vnodes on the mp mountlist, preventing mnt_ref from going to zero. Call ffs_flushfiles() after failed softdep_mount() to clean mountlist. Initial report by: Garrett Cooper Reproduced and tested by: pho
* First step in fixing the handle_workitem_freeblocks panic.pho2010-11-271-5/+6
| | | | In collaboration with: kib
* Delete /sys/ufs/ffs/README.snapshot as it is no longer relevant.mckusick2010-11-201-110/+0
| | | | | | Drop reference to it in mount(8). MFC: 3 days
* Remove prtactive variable and related printf()s in the vop_inactivekib2010-11-191-4/+0
| | | | | | | | and vop_reclaim() methods. They seems to be unused, and the reported situation is normal for the forced unmount. MFC after: 1 week X-MFC-note: keep prtactive symbol in vfs_subr.c
* The softdep_setup_freeblocks() adds worklist items beforekib2010-11-111-2/+5
| | | | | | | | | | | | | | | | | | | | deallocate_dependencies() is done. This opens a race between softdep thread and the thread that does the truncation: A write of the indirect block causes the freeblks to become ALLCOMPLETE while softdep_setup_freeblocks() dropped softdep lock. And then, softdep_disk_write_complete() would reassign the workitem to the mount point worklist, causing premature processing of the workitem, or journal write exhaust the fb_jfreeblkhd and handle_written_jfreeblk does the same reassign. indir_trunc() then would find the indirect block that is locked (with lock owned by kernel) but without any dependencies, causing it to hang in getblk() waiting for buffer lock. Do not mark freeblks as DEPCOMPLETE until deallocate_dependencies() finished. Analyzed, suggested and reviewed by: jeff Tested by: pho
* Change #ifdef INVARIANTS panic into KASSERT, and print some usefulkib2010-11-111-5/+5
| | | | | | | information to diagnose the issue, in handle_complete_freeblocks(). Reviewed by: jeff Tested by: pho
* In journal_mount(), only set MNTK_SUJ flag after the jblocks are mapped.kib2010-11-111-13/+18
| | | | | | | | I believe there is a window otherwise where jblocks can be accessed without proper initialization. Reviewed by: jeff Tested by: pho
* Add function lbn_offset to calculate offset of the indirect block ofkib2010-11-113-11/+18
| | | | | | | given level. Reviewed by: jeff Tested by: pho
* Fix typo. Function is called ffs_blkfree.kib2010-11-111-2/+2
|
* Remove unused includes of <sys/mutex.h> and <machine/mutex.h>.jhb2010-11-091-2/+0
|
* Bring vfs.ufs.dirhash_maxmem into the age of the fruitbat and make itivoras2010-10-251-1/+5
| | | | | | | | autotuned. It is only an upper bound (the memory is not always allocated) and the system contains a vm_lowmem handler so nothing will crash and burn if it's tuned too high. Reviewed by: mckusick
* The r184588 changed the layout of struct export_args, causing an ABIkib2010-10-102-2/+4
| | | | | | | | | | breakage for old mount(2) syscall, since most struct <filesystem>_args embed export_args. The mount(2) is supposed to provide ABI compatibility for pre-nmount mount(8) binaries, so restore ABI to pre-r184588. Requested and reviewed by: bde MFC after: 2 weeks
* M_USE_RESERVE has been deprecated for a decade. Eliminate any uses thatalc2010-10-021-1/+1
| | | | have no run-time effect.
* Since local variable 'i' is used only in a KASSERT, declare andmckusick2010-09-291-2/+3
| | | | | | | initialize it only if INVARIANTS is defined to avoid a declared but unused warning. Suggested by: Brian Somers <brian@FreeBSD.org>
* Fix typo in comment.kib2010-09-291-1/+1
|
* Correct some non-code typos.obrien2010-09-171-13/+11
|
* Update comments in soft updates code to more fully describemckusick2010-09-143-80/+103
| | | | | | | the addition of journalling. Only functional change is to tighten a KASSERT. Reviewed by: jeff Roberson
* Add dedicated routines to toggle lockmgr flags such as LK_NOSHARE andjhb2010-08-202-3/+3
| | | | | | | | | | | | LK_CANRECURSE after a lock is created. Use them to implement macros that otherwise manipulated the flags directly. Assert that the associated lockmgr lock is exclusively locked by the current thread when manipulating these flags to ensure the flag updates are safe. This last change required some minor shuffling in a few filesystems to exclusively lock a brand new vnode slightly earlier. Reviewed by: kib MFC after: 3 days
* Softdep_process_worklist() should unsuspend not only before processingkib2010-08-121-8/+26
| | | | | | | | | | | | | the worklist (in softdep_process_journal), but also after flushing the workitems. Might be, we should even do this before bwillwrite() too, but this seems to be not needed for now. Fs might be suspended during processing the queue, and then there is nobody around to unsuspend. In collaboration with: pho Tested by: bz Reviewed by: jeff
* Revert the previous commit. The race is not applicable to the lockmgrjhb2010-07-161-2/+0
| | | | | | | | implementation in 8.0 and later as its flags field does not hold dynamic state such as waiters flags, but is only modified in lockinit() aside from VN_LOCK_*(). Discussed with: attilio
* When the MNTK_EXTENDED_SHARED mount option was added, some filesystems werejhb2010-07-161-0/+2
| | | | | | | | | | | | | | changed to defer the setting of VN_LOCK_ASHARE() (which clears LK_NOSHARE in the vnode lock's flags) until after they had determined if the vnode was a FIFO. This occurs after the vnode has been inserted a VFS hash or some similar table, so it is possible for another thread to find this vnode via vget() on an i-node number and block on the vnode lock. If the lockmgr interlock (vnode interlock for vnode locks) is not held when clearing the LK_NOSHARE flag, then the lk_flags field can be clobbered. As a result the thread blocked on the vnode lock may never get woken up. Fix this by holding the vnode interlock while modifying the lock flags in this case. MFC after: 3 days
* - Handle the truncation of an inode with an effective link count of 0 injeff2010-07-069-128/+34
| | | | | | | | | | | | | | | the context of the process that reduced the effective count. Previously all truncation as a result of unlink happened in the softdep flush thread. This had the effect of being impossible to rate limit properly with the journal code. Now the process issuing unlinks is suspended when the journal files. This has a side-effect of improving rm performance by allowing more concurrent work. - Handle two cases in inactive, one for effnlink == 0 and another when nlink finally reaches 0. - Eliminate the SPACECOUNTED related code since the truncation is no longer delayed. Discussed with: mckusick
* Ensure that VOP_ACCESSX is called with exclusively locked vnode forkib2010-06-201-0/+33
| | | | | | | | | | | | the kernel compiled with QUOTA option. ufs_accessx() upgrades the vdp vnode lock from shared to exclusive to assign the dquot structure to the vnode, and ufs_delete_denied() is called when tvp is locked. Since upgrade drops shared lock when non-blocked upgrade failed, LOR is there. Reported and tested by: Dmitry Pryanishnikov <lynx.ripe gmail com> Tested by: pho PR: kern/147890 MFC after: 1 week
* ffs_softdep: change K&R in function defintions to ANSI prototypesavg2010-06-111-19/+6
| | | | | | | | Apparently it's bad when we first have an ANSI prototype in function declaration, but then use K&R in its defintion. Complaint from: clang MFC after: 2 weeks
* Extend the scope of the lock on the quota file vnode in quotaon() tokib2010-06-031-4/+6
| | | | | | cover the initial read by dqopen(). Assert that vnode is locked in dqopen(). Remove VFS_LOCK_GIANT() from dqopen(), since quotaon() keeps Giant locked if needed around the call.
* ffs_mount: accept and drop userland-only options that can be passed fromavg2010-05-191-3/+12
| | | | | | | | | | | | | | | | | | | loader(8) In r193192 loader(8) has grown an ability to pass root mount options from fstab via vfs.root.mountfrom.options. Unfortunately, some options that can be present in fstab are for userland only and lead to root mounting failure when seen by kernel. Rather than teaching loader about FFS-specific options that should be filtered out, ffs_mount recognizes those options as valid, but ignores and deletes[1] them. [1] is suggested by jh. PR: kern/141050 Reported by: many Reviewed by: jh, bde MFC after: 4 days
* - Don't immediately re-run softdepflush if we didn't make any progressjeff2010-05-192-51/+72
| | | | | | | | | | | | on the last iteration. This can lead to a deadlock when we have worklist items that cannot be immediately satisfied. Reported by: uqs, Dimitry Andric <dimitry@andric.com> - Remove some unnecessary debugging code and place some other under SUJ_DEBUG. - Examine the journal state in softdep_slowdown(). - Re-format some comments so I may more easily add flag descriptions.
* - Call softdep_prealloc() before any of the balloc routines in thejeff2010-05-072-1/+10
| | | | | | | | snapshot code. - Don't fsync() vnodes in prealloc if copy on write is in progress. It is not safe to recurse back into the write path here. Reported by: Vladimir Grebenschikov <vova@fbsd.ru>
* - Use the correct flag mask when determining whether an inode hasjeff2010-05-071-1/+1
| | | | | | | | | successfully made it to the free list yet or not. This fixes a deadlock that can occur with unlinked but referenced files. Journal space and inodedeps were not correctly reclaimed because the inode block was not left dirty. Tested/Reported by: lwindschuh@googlemail.com
* Merger of the quota64 project into head.mckusick2010-05-074-38/+417
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This joint work of Dag-Erling Smørgrav and myself updates the FFS quota system to support both traditional 32-bit and new 64-bit quotas (for those of you who want to put 2+Tb quotas on your users). By default quotas are not compiled into the kernel. To include them in your kernel configuration you need to specify: options QUOTA # Enable FFS quotas If you are already running with the current 32-bit quotas, they should continue to work just as they have in the past. If you wish to convert to using 64-bit quotas, use `quotacheck -c 64'; if you wish to revert from 64-bit quotas back to 32-bit quotas, use `quotacheck -c 32'. There is a new library of functions to simplify the use of the quota system, do `man quotafile' for details. If your application is currently using the quotactl(2), it is highly recommended that you convert your application to use the quotafile interface. Note that existing binaries will continue to work. Special thanks to John Kozubik of rsync.net for getting me interested in pursuing 64-bit quota support and for funding part of my development time on this project.
| * Final update to current version of head in preparation for reintegration.mckusick2010-05-063-20/+181
| |\
| * \ Update to current version of head.mckusick2010-04-2818-1803/+7576
| |\ \
| * | | Debugging nits found while testing the new 64-bit quota code.mckusick2010-03-163-3/+42
| | | |
| * | | IFH@204581des2010-03-0410-332/+919
| |\ \ \
| * \ \ \ Sync with headdes2009-09-251-4/+0
| |\ \ \ \
| * | | | | Further improve comments.des2009-09-251-12/+6
| | | | | |
| * | | | | Improve comments, and remove a bogus 0 id check.des2009-09-251-16/+35
| | | | | |
| * | | | | Merge from headdes2009-09-1716-369/+660
| |\ \ \ \ \
| * \ \ \ \ \ Merge from head up to r188941 (last revision before the USB stack switch)des2009-09-1712-105/+174
| |\ \ \ \ \ \
| * | | | | | | WIPdes2009-01-304-37/+364
| | | | | | | |
* | | | | | | | Eliminate page queues locking around most calls to vm_page_free().alc2010-05-061-2/+0
| |_|_|_|_|_|/ |/| | | | | |
* | | | | | | Acquire the page lock around all remaining calls to vm_page_free() onalc2010-05-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | managed pages that didn't already have that lock held. (Freeing an unmanaged page, such as the various pmaps use, doesn't require the page lock.) This allows a change in vm_page_remove()'s locking requirements. It now expects the page lock to be held instead of the page queues lock. Consequently, the page queues lock is no longer required at all by callers to vm_page_rename(). Discussed with: kib
* | | | | | | Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize().trasz2010-05-051-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: kib
* | | | | | | ffs_vfsops: restore alphabetic order of options in ffs_optsavg2010-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The order was not correct only for nfsv4acls. ("no" prefix is ignored) MFC after: 1 week
* | | | | | | - When canceling jaddrefs they may not yet be in the journal if this is viajeff2010-04-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a revert call. In this case don't attempt to remove something that has not yet been added. Otherwise this jaddref must hang around to prevent the bitmap write as normal.
* | | | | | | - Fix builds without SOFTUPDATES defined in the kernel config.jeff2010-04-281-0/+171
| |_|_|_|_|/ |/| | | | |
* | | | | | Fix build for UFS without SOFTUPDATES.pjd2010-04-241-1/+2
| | | | | |
* | | | | | - Merge soft-updates journaling from projects/suj/head into head. Thisjeff2010-04-2418-1801/+7566
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | brings in support for an optional intent log which eliminates the need for background fsck on unclean shutdown. Sponsored by: iXsystems, Yahoo!, and Juniper. With help from: McKusick and Peter Holm
* | | | | | The cache_enter(9) function shall not be called for doomed dvp.kib2010-04-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | ffs_mount: remove redundant assignment of geom consumer to devvp.v_bufobjavg2010-04-031-1/+0
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assignment is already done in g_vfs_open. Redundant assignment is harmless, but can become a problem if g_vfs_open logic is changed. MFC after: 1 week
OpenPOWER on IntegriCloud