aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
Commit message (Collapse)AuthorAge
* GFS2: Fix bmap allocation corner-case bugSteven Whitehouse2010-02-12
| | | | | | | | | | | | | This patch solves a corner case during allocation which occurs if both metadata (indirect) and data blocks are required but there is an obstacle in the filesystem (e.g. a resource group header or another allocated block) such that when the allocation is requested only enough blocks for the metadata are returned. By changing the exit condition of this loop, we ensure that a minimum of one data block will always be returned. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Fix error codeAbhijith Das2010-02-12
| | | | | | | We need this one-liner to signal the mount helper of the 'insufficient journals' condition. Signed-off-by: Abhijith Das <adas@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Extend umount wait coverage to full glock lifetimeSteven Whitehouse2010-02-03
| | | | | | | | | | | | | | Although all glocks are, by the time of the umount glock wait, scheduled for demotion, some of them haven't made it far enough through the process for the original set of waiting code to wait for them. This extends the ref count to the whole glock lifetime in order to ensure that the waiting does catch all glocks. It does make it a bit more invasive, but it seems the only sensible solution at the moment. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Wait for unlock completion on umountSteven Whitehouse2010-02-03
| | | | | | | | | | This patch adds a wait on umount between the point at which we dispose of all glocks and the point at which we unmount the lock protocol. This ensures that we've received all the replies to our unlock requests before we stop the locking. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Reported-by: Fabio M. Di Nitto <fdinitto@redhat.com>
* GFS2: Use GFP_NOFS for alloc structureSteven Whitehouse2010-02-01
| | | | | | This is called under a glock, so its a good plan to use GFP_NOFS Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Fix previous patchSteven Whitehouse2010-02-01
| | | | | | The do_div() call needs to remain. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Don't withdraw on partial rindex entriesBenjamin Marzinski2010-02-01
| | | | | | | | | | | | | ince gfs2 writes the rindex file a block at a time, and releases the exclusive lock after each block, it is possible that another process will grab the lock in the middle of the write. Since rindex entries are not an even divisor of blocks, that other process may see partial entries. On grows, this is fine. The process can simply ignore the the partial entires. Previously, the code withdrew when it saw partial entries. Now it simply ignores them. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Fix refcnt leak on gfs2_follow_link() error pathOGAWA Hirofumi2010-01-12
| | | | | | | | | | If ->follow_link handler return the error, it should decrement nd->path refcnt. This patch fix it. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Use MAX_LFS_FILESIZE for meta inode sizeSteven Whitehouse2010-01-11
| | | | | | | Using ~0ULL was cauing sign issues in filemap_fdatawrite_range, so use MAX_LFS_FILESIZE instead. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Fix gfs2_xattr_acl_chmod()Steven Whitehouse2010-01-08
| | | | | | | | The ref counting for the bh returned by gfs2_ea_find() was wrong. This patch ensures that we always drop the ref count to that bh correctly. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Fix locking bug in renameSteven Whitehouse2010-01-08
| | | | | | | | | The rename code was taking a resource group lock in cases where it wasn't actually needed, this caused problems if the rename was resulting in an inode being unlinked. The patch ensures that we only take the rgrp lock early if it is really needed. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Ensure uptodate inode size when using O_APPENDSteven Whitehouse2010-01-08
| | | | | | | | | | | | | | The VFS reads the inode size during generic_file_aio_write() but with no locking around it. In order to get the expected result from O_APPEND opens, this patch updated the inode size before calling generic_file_aio_write() There is of course still a race here, in that there is nothing to prevent another node coming in and extending the file in the mean time. On the other hand, when used with file locking this will ensure that the expected results are obtained. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* Revert "task_struct: make journal_info conditional"Linus Torvalds2009-12-17
| | | | | | | | | | | | | | | | | | This reverts commit e4c570c4cb7a95dbfafa3d016d2739bf3fdfe319, as requested by Alexey: "I think I gave a good enough arguments to not merge it. To iterate: * patch makes impossible to start using ext3 on EXT3_FS=n kernels without reboot. * this is done only for one pointer on task_struct" None of config options which define task_struct are tristate directly or effectively." Requested-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* kill I_LOCKChristoph Hellwig2009-12-17
| | | | | | | | After I_SYNC was split from I_LOCK the leftover is always used together with I_NEW and thus superflous. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* sanitize xattr handler prototypesChristoph Hellwig2009-12-16
| | | | | | | | | | | | | | | | | | | | | Add a flags argument to struct xattr_handler and pass it to all xattr handler methods. This allows using the same methods for multiple handlers, e.g. for the ACL methods which perform exactly the same action for the access and default ACLs, just using a different underlying attribute. With a little more groundwork it'll also allow sharing the methods for the regular user/trusted/secure handlers in extN, ocfs2 and jffs2 like it's already done for xfs in this patch. Also change the inode argument to the handlers to a dentry to allow using the handlers mechnism for filesystems that require it later, e.g. cifs. [with GFS2 bits updated by Steven Whitehouse <swhiteho@redhat.com>] Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: James Morris <jmorris@namei.org> Acked-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* fs/gfs2/sys.c: use %pUB to print UUIDsJoe Perches2009-12-15
| | | | | | | Signed-off-by: Joe Perches <joe@perches.com> Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* task_struct: make journal_info conditionalHiroshi Shimamoto2009-12-15
| | | | | | | | | | | | | journal_info in task_struct is used in journaling file system only. So introduce CONFIG_FS_JOURNAL_INFO and make it conditional. Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Cc: Chris Mason <chris.mason@oracle.com> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* GFS2: Fix glock refcount issuesSteven Whitehouse2009-12-03
| | | | | | | | | | | | | | This patch fixes some ref counting issues. Firstly by moving the point at which we drop the ref count after a dlm lock operation has completed we ensure that we never call gfs2_glock_hold() on a lock with a zero ref count. Secondly, by using atomic_dec_and_lock() in gfs2_glock_put() we ensure that at no time will a glock with zero ref count appear on the lru_list. That means that we can remove the check for this in our shrinker (which was racy). Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* writeback: remove unused nonblocking and congestion checks (gfs2)Wu Fengguang2009-12-03
| | | | | | | | | No one is calling wb_writeback and write_cache_pages with wbc.nonblocking=1 any more. And lumpy pageout will want to do nonblocking writeback without the congestion wait. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: drop rindex glock to refresh rindex listBenjamin Marzinski2009-12-03
| | | | | | | | | | | | When a gfs2 filesystem is grown, it needs to rebuild the rindex list to be able to use the new space. gfs2 does this when the rindex is marked not uptodate, which happens when the rindex glock is dropped. However, on a single node setup, there is never any reason to drop the rindex glock, so gfs2 never invalidates the the rindex. This patch makes gfs2 automatically drop the rindex glock after filesystem grows, so it can refresh the rindex list. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Tag all metadata with jidSteven Whitehouse2009-12-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two spare field in the header common to all GFS2 metadata. One is just the right size to fit a journal id in it, and this patch updates the journal code so that each time a metadata block is modified, we tag it with the journal id of the node which is performing the modification. The reason for this is that it should make it much easier to debug issues which arise if we can tell which node was the last to modify a particular metadata block. Since the field is updated before the block is written into the journal, each journal should only contain metadata which is tagged with its own journal id. The one exception to this is the journal header block, which might have a different node's id in it, if that journal was recovered by another node in the cluster. Thus each journal will contain a record of which nodes recovered it, via the journal header. The other field in the metadata header could potentially be used to hold information about what kind of operation was performed, but for the time being we just zero it on each transaction so that if we use it for that in future, we'll know that the information (where it exists) is reliable. I did consider using the other field to hold the journal sequence number, however since in GFS2's journaling we write the modified data into the journal and not the original data, this gives no information as to what action caused the modification, so I think we can probably come up with a better use for those 64 bits in the future. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Locking order fix in gfs2_check_blk_stateSteven Whitehouse2009-12-03
| | | | | | | In some cases we already have the rindex lock when we enter this function. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Remove dirent_first() functionSteven Whitehouse2009-12-03
| | | | | | | | | | This function only had one caller left, and that caller only called it for leaf blocks, hence one branch of the "if" was never taken. In addition the call to get_left had already verified the metadata type, so the function can be reduced to a single line of code in its caller. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Display nobarrier option in /proc/mountsSteven Whitehouse2009-12-03
| | | | | | | Since the default is barriers on, this only displays the nobarrier option when that is active. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: add barrier/nobarrier mount optionsChristoph Hellwig2009-12-03
| | | | | | | | | | | Currently gfs2 issues barrier unconditionally. There are various reasons to disable them, be that just for testing or for stupid devices flushing large battert backed caches. Add a nobarrier option that matches xfs and btrfs for this. Also add a symmetric barrier option to turn it back on at remount time. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: remove division from new statfs codeBenjamin Marzinski2009-12-03
| | | | | | | | It's not necessary to do any 64bit division for the statfs sync code, so remove it. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Improve statfs and quota usabilityBenjamin Marzinski2009-12-03
| | | | | | | | | | | | | | GFS2 now has three new mount options, statfs_quantum, quota_quantum and statfs_percent. statfs_quantum and quota_quantum simply allow you to set the tunables of the same name. Setting setting statfs_quantum to 0 will also turn on the statfs_slow tunable. statfs_percent accepts an integer between 0 and 100. Numbers between 1 and 100 will cause GFS2 to do any early sync when the local number of blocks free changes by at least statfs_percent from the totoal number of blocks free. Setting statfs_percent to 0 disables this. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Use dquot_send_warning()Steven Whitehouse2009-12-03
| | | | | | | | This adds support to GFS2 to send quota warnings via netlink. Also it removes a stray \r which was left over from when the code used to print warnings on the console. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Add set_xquota supportSteven Whitehouse2009-12-03
| | | | | | | This patch adds the ability to set GFS2 quota limit and warning levels via the XFS quota API. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Add get_xquota supportSteven Whitehouse2009-12-03
| | | | | | | | | | This adds support for viewing the current GFS2 quota settings via the XFS quota API. The setting of quotas will be addressed in a later patch. Fields which are not supported here are left set to zero. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Reviewed-by: Bob Peterson <rpeterso@redhat.com>
* GFS2: Clean up gfs2_adjust_quota() and do_glock()Steven Whitehouse2009-12-03
| | | | | | | | | | | | | Both of these functions contained confusing and in one case duplicate code. This patch adds a new check in do_glock() so that we report -ENOENT if we are asked to sync a quota entry which doesn't exist. Due to the previous patch this is now reported correctly to userspace. Also there are a few new comments, and I hope that the code is easier to understand now. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Remove constant argument from qd_get()Steven Whitehouse2009-12-03
| | | | | | | This function was only ever called with the "create" argument set to true, so we can remove it. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Remove constant argument from qdsb_get()Steven Whitehouse2009-12-03
| | | | | | | The "create" argument to qdsb_get() was only ever set to true, so this patch removes that argument. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Add proper error reporting to quota sync via sysfsSteven Whitehouse2009-12-03
| | | | | | For some reason, the errors were not making it to userspace. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Add get_xstate quota functionSteven Whitehouse2009-12-03
| | | | | | | This allows querying of the quota state via the XFS quota API. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Remove obsolete code in quota.cSteven Whitehouse2009-12-03
| | | | | | | There is no point in testing for GLF_DEMOTE here, we might as well always release the glock at that point. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Hook gfs2_quota_sync into VFS via gfs2_quotactl_opsSteven Whitehouse2009-12-03
| | | | | | | | | | | The plan is to add further operations to the gfs2_quotactl_ops in future patches. The sync operation is easy, so we start with that one. We plan to use the XFS quota control functions because they more closely match the GFS2 ones. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Alter arguments of gfs2_quota/statfs_syncSteven Whitehouse2009-12-03
| | | | | | | | | These two functions are altered so that gfs2_quota_sync may in future be called directly from the VFS. The GFS2 superblock changes to a VFS super block and there is an addition of an int argument which is currently ignored. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Add cached ACLs supportSteven Whitehouse2009-12-03
| | | | | | | | | | The other patches in this series have been building towards being able to support cached ACLs like other filesystems. The only real difference with GFS2 is that we have to invalidate the cache when we drop a glock, but that is dealt with in earlier patches. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Clean up ACLsSteven Whitehouse2009-12-03
| | | | | | | | | To prepare for support for caching of ACLs, this cleans up the GFS2 ACL support by pushing the xattr code back into xattr.c and changing the acl_get function into one which only returns ACLs so that we can drop the caching function into it shortly. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Use gfs2_set_mode() instead of munge_mode()Steven Whitehouse2009-12-03
| | | | | | | These two functions do the same thing, so lets only use one of them. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Use forget_all_cached_acls()Steven Whitehouse2009-12-03
| | | | | | Invalidate all the cached ACLs when we drop the glock. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* GFS2: Fix up system xattrsSteven Whitehouse2009-12-03
| | | | | | | | | | This code has been shamelessly stolen from XFS at the suggestion of Christoph Hellwig. I've not added support for cached ACLs so far... watch for that in a later patch, although this is designed in such a way that they should be easy to add. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Christoph Hellwig <hch@infradead.org>
* GFS2: Fix -o meta mounts for subsequent mounts (i.e. all but the first one)Steven Whitehouse2009-12-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have a long term plan to use the "-o meta" flag to GFS2 mounts to access the alternate root which is used to store metadata for a GFS2 filesystem. This will allow us to eventually remove support for the gfs2meta filesystem type (which is in any case just a "front end" to the gfs2 filesystem type with the meta/master root). Currently the "-o meta" option is only taken into account on the initial mount of the filesystem. Subsequent mounts of the same filesystem (i.e. on the same device) result in basically the same as bind mounting the root of the original mount. This patch changes that by using what is more or less a copy of get_sb_bdev() and extending it so that it will take into account the alternate root in all cases. The main difference is that we have to parse the mount options a bit earlier. We can then use them to select the appropriate root towards the end of the function. In addition this also fixes a bug where it was possible (but certainly not desirable) to set different ro/rw options for the meta root when mounted via the gfs2meta fs compared with the original mount. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Alexander Viro <aviro@redhat.com>
* GFS2: Fix potential race in glock codeSteven Whitehouse2009-12-03
| | | | | | | We need to be careful of the ordering between clearing the GLF_LOCK bit and scheduling the workqueue. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* SLOW_WORK: Fix GFS2 to #include <linux/module.h> before using THIS_MODULEDavid Howells2009-11-20
| | | | | | | | | | | | GFS2 has been altered to pass THIS_MODULE to slow_work_register_user(), but hasn't been altered to #include <linux/module.h> to provide it, resulting in the following error: fs/gfs2/recovery.c:596: error: 'THIS_MODULE' undeclared here (not in a function) Add the missing #include. Signed-off-by: David Howells <dhowells@redhat.com>
* SLOW_WORK: Wait for outstanding work items belonging to a module to clearDavid Howells2009-11-19
| | | | | | | | Wait for outstanding slow work items belonging to a module to clear when unregistering that module as a user of the facility. This prevents the put_ref code of a work item from being taken away before it returns. Signed-off-by: David Howells <dhowells@redhat.com>
* const: mark struct vm_struct_operationsAlexey Dobriyan2009-09-27
| | | | | | | | | | | * mark struct vm_area_struct::vm_ops as const * mark vm_ops in AGP code But leave TTM code alone, something is fishy there with global vm_ops being used. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'hwpoison' of ↵Linus Torvalds2009-09-24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6 * 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6: (21 commits) HWPOISON: Enable error_remove_page on btrfs HWPOISON: Add simple debugfs interface to inject hwpoison on arbitary PFNs HWPOISON: Add madvise() based injector for hardware poisoned pages v4 HWPOISON: Enable error_remove_page for NFS HWPOISON: Enable .remove_error_page for migration aware file systems HWPOISON: The high level memory error handler in the VM v7 HWPOISON: Add PR_MCE_KILL prctl to control early kill behaviour per process HWPOISON: shmem: call set_page_dirty() with locked page HWPOISON: Define a new error_remove_page address space op for async truncation HWPOISON: Add invalidate_inode_page HWPOISON: Refactor truncate to allow direct truncating of page v2 HWPOISON: check and isolate corrupted free pages v2 HWPOISON: Handle hardware poisoned pages in try_to_unmap HWPOISON: Use bitmask/action code for try_to_unmap behaviour HWPOISON: x86: Add VM_FAULT_HWPOISON handling to x86 page fault handler v2 HWPOISON: Add poison check to page fault handling HWPOISON: Add basic support for poisoned pages in fault handler v3 HWPOISON: Add new SIGBUS error codes for hardware poison signals HWPOISON: Add support for poison swap entries v2 HWPOISON: Export some rmap vma locking to outside world ...
| * HWPOISON: Enable .remove_error_page for migration aware file systemsAndi Kleen2009-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable removing of corrupted pages through truncation for a bunch of file systems: ext*, xfs, gfs2, ocfs2, ntfs These should cover most server needs. I chose the set of migration aware file systems for this for now, assuming they have been especially audited. But in general it should be safe for all file systems on the data area that support read/write and truncate. Caveat: the hardware error handler does not take i_mutex for now before calling the truncate function. Is that ok? Cc: tytso@mit.edu Cc: hch@infradead.org Cc: mfasheh@suse.com Cc: aia21@cantab.net Cc: hugh.dickins@tiscali.co.uk Cc: swhiteho@redhat.com Signed-off-by: Andi Kleen <ak@linux.intel.com>