aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs
AgeCommit message (Collapse)AuthorFilesLines
2009-02-19Revert "[XFS] remove old vmap cache"Felix Blyakher1-1/+74
This reverts commit d2859751cd0bf586941ffa7308635a293f943c17. This commit caused regression. We'll try to fix use of new vmap API for next release. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-02-19Revert "[XFS] use scalable vmap API"Felix Blyakher1-3/+3
This reverts commit 95f8e302c04c0b0c6de35ab399a5551605eeb006. This commit caused regression. We'll try to fix use of new vmap API for next release. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-02-18Revert "[XFS] remove old vmap cache"Felix Blyakher1-1/+74
This reverts commit d2859751cd0bf586941ffa7308635a293f943c17. This commit caused regression. We'll try to fix use of new vmap API for next release. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-02-18Revert "[XFS] use scalable vmap API"Felix Blyakher1-3/+3
This reverts commit 95f8e302c04c0b0c6de35ab399a5551605eeb006. This commit caused regression. We'll try to fix use of new vmap API for next release. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-02-12xfs: reject swapext ioctl on swapfilesChristoph Hellwig1-0/+6
Swapfiles are magic - I/O is directly initialized by the VM without involving the filesystem. Swapping out extents underneath the VM thus can cause severe problems. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-12xfs: fix error handling in xfs_log_mountChristoph Hellwig1-6/+8
We can't just call xfs_log_unmount_dealloc on any failure because the ail thread which is torn down by xfs_log_unmount_dealloc might not be initialized yet. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Reported-by: Lachlan McIlroy <[email protected]>
2009-02-09xfs: get rid of indirections in the quotaops implementationChristoph Hellwig12-262/+181
Currently we call from the nicely abstracted linux quotaops into a ugly multiplexer just to split the calls out at the same boundary again. Rewrite the quota ops handling to remove that obfucation. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-02-09xfs: sanitize qh_lock wrappersChristoph Hellwig4-81/+37
Get rid of various obsfucating wrappers for accessing the quota hash lock, we only keep the accessors for accessing the mplist and freelist locks as they encode a multi-level datastructure walk. But make sure all of them are defined in the same way as simple macros. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-02-09xfs: use mutex_is_locked in XFS_DQ_IS_LOCKEDChristoph Hellwig1-13/+1
Now that we have a helper to test if a mutex is held use it instead of our own little hacks. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-02-09xfs: remove XFS_QM_LOCK/XFS_QM_UNLOCK/XFS_QM_HOLD/XFS_QM_RELEChristoph Hellwig2-12/+6
Remove these macros which only obsfucated the code in rather nast ways. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-02-09xfs: merge xfs_mkdir into xfs_createChristoph Hellwig3-291/+92
xfs_create and xfs_mkdir only have minor differences, so merge both of them into a sigle function. While we're at it also make the error handling code more straight-forward. Signed-off-by: Christoph Hellwig <[email protected]> Dave Chinner <[email protected]>
2009-02-09xfs: remove uchar_t/ushort_t/uint_t/ulong_t typesChristoph Hellwig7-18/+10
Just another set of types obsfucating the code, remove them. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-02-09xfs: remove superflous inobt macrosChristoph Hellwig5-31/+17
xfs_ialloc_btree.h has a a cuple of macros that only obsfucate the code but don't provide any abstraction benefits. This patches removes those and cleans up the reamaining defintions up a little. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-02-09xfs: remove iclog calculation special casesChristoph Hellwig1-26/+2
Our default has been to always use 8 32KB log buffers for a while now, so remove the special casing for larger block size filesystem to use the same or even lower number of buffers. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-02-08xfs: remove the unused XFS_QMOPT_DQLOCK flagChristoph Hellwig3-113/+50
The XFS_QMOPT_DQLOCK flag introduces major complexity in the quota subsystem but isn't actually used anywhere. So remove it and all the hazzles it introduces. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-08xfs: cleanup xfs_find_handleChristoph Hellwig1-62/+44
Remove the superflous igrab by keeping a reference on the path/file all the time and clean up various bits of surrounding code. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-04xfs: cleanup error handling in xfs_swap_extentsJosef 'Jeff' Sipek1-35/+27
Use multiple lables for proper error unwinding and get rid of some now superflous variables. Signed-off-by: Josef 'Jeff' Sipek <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-04xfs: merge xfs_inode_flush into xfs_fs_write_inodeChristoph Hellwig4-57/+37
Splitting the task for a VFS-induced inode flush into two functions doesn't make any sense, so merge the two functions dealing with it. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-02-04xfs: factor out attr fork reset handlingChristoph Hellwig1-30/+25
We currently duplicate code to reset the attribute fork after the last attribute has been deleted. Factor this out into a small helper. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-04xfs: remove unused XFS_MOUNT_ILOCK/XFS_MOUNT_IUNLOCKChristoph Hellwig1-3/+0
These aren't only unused but also reference a lock that doesn't exist anymore. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-04xfs: tiny cleanup for xfs_linkChristoph Hellwig1-2/+4
The source and target inodes are guaranteed to never be the same by the VFS, so no need to check for that (and we would get into bad trouble later anyway if that were the case). Also clean up the error handling to use two gotos instead of nested conditions. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-04xfs: make sure to free the real-time inodes in the mount error pathChristoph Hellwig3-8/+21
When mount fails after allocating the real-time inodes we currently leak them. Add a new helper to free the real-time inodes which can be used by both the mount and unmount path. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-04xfs: cleanup error handling in xfs_mountfs:Christoph Hellwig1-42/+35
Clean up the error handling in xfs_mountfs. Use readable goto label names, simplify the uuid handling and other error conditions. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
2009-02-03[XFS] Warn on transaction in flight on read-only remountFelix Blyakher1-1/+5
Till VFS can correctly support read-only remount without racing, use WARN_ON instead of BUG_ON on detecting transaction in flight after quiescing filesystem. Signed-off-by: Felix Blyakher <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
2009-02-03xfs: Check buffer lengths in log recoveryDave Chinner1-6/+25
Before trying to obtain, read or write a buffer, check that the buffer length is actually valid. If it is not valid, then something read in the recovery process has been corrupted and we should abort recovery. Reported-by: Eric Sesterhenn <[email protected]> Tested-by: Eric Sesterhenn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Dave Chinner <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-02-03xfs: Check buffer lengths in log recoveryDave Chinner1-6/+25
Before trying to obtain, read or write a buffer, check that the buffer length is actually valid. If it is not valid, then something read in the recovery process has been corrupted and we should abort recovery. Reported-by: Eric Sesterhenn <[email protected]> Tested-by: Eric Sesterhenn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Dave Chinner <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-01-27don't reallocate sxp variable passed into xfs_swapextEric Sandeen1-9/+1
fixes kernel.org bugzilla 12538, xfs_fsr fails on 2.6.29-rc kernels Regression caused by 743bb4650da9e2595d6cedd01c680b5b9398c74a This was an embarrasing mistake, reallocating the sxp pointer passed in from the main ioctl switch. Signed-off-by: Eric Sandeen <[email protected] Reported-by: Paul Martin <[email protected]> Tested-by: Paul Martin <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-01-27don't reallocate sxp variable passed into xfs_swapextEric Sandeen1-9/+1
fixes kernel.org bugzilla 12538, xfs_fsr fails on 2.6.29-rc kernels Regression caused by 743bb4650da9e2595d6cedd01c680b5b9398c74a This was an embarrasing mistake, reallocating the sxp pointer passed in from the main ioctl switch. Signed-off-by: Eric Sandeen <[email protected] Reported-by: Paul Martin <[email protected]> Tested-by: Paul Martin <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-01-27[XFS] Warn on transaction in flight on read-only remountFelix Blyakher1-1/+5
Till VFS can correctly support read-only remount without racing, use WARN_ON instead of BUG_ON on detecting transaction in flight after quiescing filesystem. Signed-off-by: Felix Blyakher <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
2009-01-22Long btree pointers are still 64 bit on diskDave Chinner1-5/+5
[XFS] Long btree pointers are still 64 bit on disk On 32 bit machines with CONFIG_LBD=n, XFS reduces the in memory size of xfs_fsblock_t to 32 bits so that it will fit within 32 bit addressing. However, the disk format for long btree pointers are still 64 bits in size. The recent btree rewrite failed to take this into account when initialising new btree blocks, setting sibling pointers to NULL and checking if they are NULL. Hence checking whether a 64 bit NULL was the same as a 32 bit NULL was failingi resulting in NULL sibling pointers failing to be detected correctly. This showed up as WANT_CORRUPTED_GOTO shutdowns in xfs_btree_delrec. Fix this by making all the comparisons and setting of long pointer btree NULL blocks to the disk format, not the in memory format. i.e. use NULLDFSBNO. Reported-by: Alexander Beregalov <[email protected]> Reported-by: Jacek Luczak <[email protected]> Reported-by: Danny ter Haar <[email protected]> Tested-by: Jacek Luczak <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Dave Chinner <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-01-21Merge branch 'master' of git+ssh://oss.sgi.com/oss/git/xfs/xfsFelix Blyakher2-8/+0
2009-01-22[XFS] remove always-true #ifndef HAVE_FORMAT32 testsEric Sandeen2-8/+0
There are several tests for #ifndef HAVE_FORMAT32, but this is never defined anywhere so it is always the default behavior; just remove the ifndef goop. Signed-off-by: Eric Sandeen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Lachlan McIlroy <[email protected]>
2009-01-21Long btree pointers are still 64 bit on diskDave Chinner1-5/+5
[XFS] Long btree pointers are still 64 bit on disk On 32 bit machines with CONFIG_LBD=n, XFS reduces the in memory size of xfs_fsblock_t to 32 bits so that it will fit within 32 bit addressing. However, the disk format for long btree pointers are still 64 bits in size. The recent btree rewrite failed to take this into account when initialising new btree blocks, setting sibling pointers to NULL and checking if they are NULL. Hence checking whether a 64 bit NULL was the same as a 32 bit NULL was failingi resulting in NULL sibling pointers failing to be detected correctly. This showed up as WANT_CORRUPTED_GOTO shutdowns in xfs_btree_delrec. Fix this by making all the comparisons and setting of long pointer btree NULL blocks to the disk format, not the in memory format. i.e. use NULLDFSBNO. Reported-by: Alexander Beregalov <[email protected]> Reported-by: Jacek Luczak <[email protected]> Reported-by: Danny ter Haar <[email protected]> Tested-by: Jacek Luczak <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Dave Chinner <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-01-19[XFS] Remove the rest of the macro-to-function indirections.Eric Sandeen23-158/+142
Remove the last of the macros-defined-to-static-functions. Signed-off-by: Eric Sandeen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Lachlan McIlroy <[email protected]>
2009-01-19xfs: sanity check attr fork sizeChristoph Hellwig1-0/+13
Recently we have quite a few kerneloops reports about dereferencing a NULL if_data in the attribute fork. From looking over the code this can only happen if we pass a 0 size argument to xfs_iformat_local. This implies some sort of corruption and in fact the only mailinglist report about this from earlier this year was after a powerfail presumably on a system with write cache and without barriers. Add a quick sanity check for the attr fork size in xfs_iformat to catch these early and without an oops. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: fix bad_features2 fixups for the root filesystemChristoph Hellwig3-14/+32
Currently the bad_features2 fixup and the alignment updates in the superblock are skipped if we mount a filesystem read-only. But for the root filesystem the typical case is to mount read-only first and only later remount writeable so we'll never perform this update at all. It's not a big problem but means the logs of people needing the fixup get spammed at every boot because they never happen on disk. Reported-by: Arkadiusz Miskiewicz <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: add a lock class for group/project dquotsChristoph Hellwig1-1/+11
We can have both a user and a group/project dquot locked at the same time, as long as the user dquot is locked first. Tell lockdep about that fact by making the group/project dquots a different lock class. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: lockdep annotations for xfs_dqlock2Christoph Hellwig2-10/+24
xfs_dqlock2 locks two xfs_dquots, which is fine as it always locks the dquot with the lower id first. Use mutex_lock_nested to tell lockdep about this fact. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: add a separate lock class for the per-mount list of dquotsChristoph Hellwig1-0/+9
We can have both a a quota hash chain and the per-mount list locked at the same time. But given that both use the same struct dqhash as list head we have to tell lockdep that they are different lock classes. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: use mnt_want_write in compat_attrmulti ioctlChristoph Hellwig1-0/+9
The compat version of the attrmulti ioctl needs to ask for and then later release write access to the mount just like the native version, otherwise we could potentially write to read-only mounts. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: fix dentry aliasing issues in open_by_handleChristoph Hellwig4-300/+196
Open by handle just grabs an inode by handle and then creates itself a dentry for it. While this works for regular files it is horribly broken for directories, where the VFS locking relies on the fact that there is only just one single dentry for a given inode, and that these are always connected to the root of the filesystem so that it's locking algorithms work (see Documentations/filesystems/Locking) Remove all the existing open by handle code and replace it with a small wrapper around the exportfs code which deals with all these issues. At the same time we also make the checks for a valid handle strict enough to reject all not perfectly well formed handles - given that we never hand out others that's okay and simplifies the code. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: sanity check attr fork sizeChristoph Hellwig1-0/+13
Recently we have quite a few kerneloops reports about dereferencing a NULL if_data in the attribute fork. From looking over the code this can only happen if we pass a 0 size argument to xfs_iformat_local. This implies some sort of corruption and in fact the only mailinglist report about this from earlier this year was after a powerfail presumably on a system with write cache and without barriers. Add a quick sanity check for the attr fork size in xfs_iformat to catch these early and without an oops. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: fix bad_features2 fixups for the root filesystemChristoph Hellwig3-14/+32
Currently the bad_features2 fixup and the alignment updates in the superblock are skipped if we mount a filesystem read-only. But for the root filesystem the typical case is to mount read-only first and only later remount writeable so we'll never perform this update at all. It's not a big problem but means the logs of people needing the fixup get spammed at every boot because they never happen on disk. Reported-by: Arkadiusz Miskiewicz <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: add a lock class for group/project dquotsChristoph Hellwig1-1/+11
We can have both a user and a group/project dquot locked at the same time, as long as the user dquot is locked first. Tell lockdep about that fact by making the group/project dquots a different lock class. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: lockdep annotations for xfs_dqlock2Christoph Hellwig2-10/+24
xfs_dqlock2 locks two xfs_dquots, which is fine as it always locks the dquot with the lower id first. Use mutex_lock_nested to tell lockdep about this fact. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: add a separate lock class for the per-mount list of dquotsChristoph Hellwig1-0/+9
We can have both a a quota hash chain and the per-mount list locked at the same time. But given that both use the same struct dqhash as list head we have to tell lockdep that they are different lock classes. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: use mnt_want_write in compat_attrmulti ioctlChristoph Hellwig1-0/+9
The compat version of the attrmulti ioctl needs to ask for and then later release write access to the mount just like the native version, otherwise we could potentially write to read-only mounts. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-19xfs: fix dentry aliasing issues in open_by_handleChristoph Hellwig4-300/+196
Open by handle just grabs an inode by handle and then creates itself a dentry for it. While this works for regular files it is horribly broken for directories, where the VFS locking relies on the fact that there is only just one single dentry for a given inode, and that these are always connected to the root of the filesystem so that it's locking algorithms work (see Documentations/filesystems/Locking) Remove all the existing open by handle code and replace it with a small wrapper around the exportfs code which deals with all these issues. At the same time we also make the checks for a valid handle strict enough to reject all not perfectly well formed handles - given that we never hand out others that's okay and simplifies the code. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
2009-01-16[XFS] Remove the rest of the macro-to-function indirections.Eric Sandeen23-158/+142
Remove the last of the macros-defined-to-static-functions. Signed-off-by: Eric Sandeen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Lachlan McIlroy <[email protected]>
2009-01-14Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into ↵Lachlan McIlroy6-28/+14
for-linus