#
c9f6a6bb |
| 10-Jul-2008 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Remove support for unused and pointless flag
The ability to mark files for direct i/o access when opened normally is both unused and pointless, so this patch removes support for that feature.
[GFS2] Remove support for unused and pointless flag
The ability to mark files for direct i/o access when opened normally is both unused and pointless, so this patch removes support for that feature.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
f58ba889 |
| 02-Jul-2008 |
Miklos Szeredi <miklos@szeredi.hu> |
[GFS2] don't call permission()
GFS2 calls permission() to verify permissions after locks on the files have been taken.
For this it's sufficient to call gfs2_permission() instead. This results in t
[GFS2] don't call permission()
GFS2 calls permission() to verify permissions after locks on the files have been taken.
For this it's sufficient to call gfs2_permission() instead. This results in the following changes:
- IS_RDONLY() check is not performed - IS_IMMUTABLE() check is not performed - devcgroup_inode_permission() is not called - security_inode_permission() is not called
IS_RDONLY() should be unnecessary anyway, as the per-mount read-only flag should provide protection against read-only remounts during operations. do_gfs2_set_flags() has been fixed to perform mnt_want_write()/mnt_drop_write() to protect against remounting read-only.
IS_IMMUTABLE has been added to gfs2_permission()
Repeating the security checks seems to be pointless, as they don't normally change, and if they do, it's independent of the filesystem state.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
091806ed |
| 29-Apr-2008 |
Bob Peterson <rpeterso@redhat.com> |
[GFS2] filesystem consistency error from do_strip
This patch fixes a GFS2 filesystem consistency error reported from function do_strip. The problem was caused by a timing window that allowed two vf
[GFS2] filesystem consistency error from do_strip
This patch fixes a GFS2 filesystem consistency error reported from function do_strip. The problem was caused by a timing window that allowed two vfs inodes to be created in memory that point to the same file. The problem is fixed by making the vfs's iget_test, iget_set mechanism check and set a new bit in the in-core gfs2_inode structure while the vfs inode spin_lock is held.
Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
16c5f06f |
| 09-Apr-2008 |
Josef Bacik <jbacik@redhat.com> |
[GFS2] fix GFP_KERNEL misuses
There are several places where GFP_KERNEL allocations happen under a glock, which will result in hangs if we're under memory pressure and go to re-enter the fs in order
[GFS2] fix GFP_KERNEL misuses
There are several places where GFP_KERNEL allocations happen under a glock, which will result in hangs if we're under memory pressure and go to re-enter the fs in order to flush stuff out. This patch changes the culprits to GFS_NOFS to keep this problem from happening. Thank you,
Signed-off-by: Josef Bacik <jbacik@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
182fe5ab |
| 03-Mar-2008 |
Cyrill Gorcunov <gorcunov@gmail.com> |
[GFS2] possible null pointer dereference fixup
gfs2_alloc_get may fail so we have to check it to prevent NULL pointer dereference.
Signed-off-by: Cyrill Gorcunov <gorcunov@gamil.com> Signed-off-by:
[GFS2] possible null pointer dereference fixup
gfs2_alloc_get may fail so we have to check it to prevent NULL pointer dereference.
Signed-off-by: Cyrill Gorcunov <gorcunov@gamil.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
43a33c53 |
| 26-Feb-2008 |
Denis Cheng <crquan@gmail.com> |
[GFS2] re-support special inode
a previous commit removed call to init_special_inode from inode lookuping, this cause problems as:
# mknod /mnt/gfs2/dev/null c 1 3 # cat /mnt/gfs2/dev/null cat:
[GFS2] re-support special inode
a previous commit removed call to init_special_inode from inode lookuping, this cause problems as:
# mknod /mnt/gfs2/dev/null c 1 3 # cat /mnt/gfs2/dev/null cat: /mnt/gfs2/dev/null: Invalid argument
without special inode, GFS2 cannot support char device file, block device file, fifo pipe, and socket file, lose many important features as a common file system.
this one line patch re add special inode support.
Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
d83225d4 |
| 26-Feb-2008 |
Denis Cheng <crquan@gmail.com> |
[GFS2] remove gfs2_dev_iops
struct inode_operations gfs2_dev_iops is always the same as gfs2_file_iops, since Jan 2006, when GFS2 merged into mainstream kernel.
So one of them could be removed.
Si
[GFS2] remove gfs2_dev_iops
struct inode_operations gfs2_dev_iops is always the same as gfs2_file_iops, since Jan 2006, when GFS2 merged into mainstream kernel.
So one of them could be removed.
Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
7afd88d9 |
| 22-Feb-2008 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Fix a page lock / glock deadlock
We've previously been using a "try lock" in readpage on the basis that it would prevent deadlocks due to the inverted lock ordering (our normal lock ordering
[GFS2] Fix a page lock / glock deadlock
We've previously been using a "try lock" in readpage on the basis that it would prevent deadlocks due to the inverted lock ordering (our normal lock ordering is glock first and then page lock). Unfortunately tests have shown that this isn't enough. If the glock has a demote request queued such that run_queue() in the glock code tries to do a demote when its called under readpage then it will try and write out all the dirty pages which requires locking them. This then deadlocks with the page locked by readpage.
The solution is to always require two calls into readpage. The first unlocks the page, gets the glock and returns AOP_TRUNCATED_PAGE, the second does the actual readpage and unlocks the glock & page as required.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
77658aad |
| 12-Feb-2008 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Eliminate (almost) duplicate field from gfs2_inode
The blocks counter is almost a duplicate of the i_blocks field in the VFS inode. The only difference is that i_blocks can be only 32bits lon
[GFS2] Eliminate (almost) duplicate field from gfs2_inode
The blocks counter is almost a duplicate of the i_blocks field in the VFS inode. The only difference is that i_blocks can be only 32bits long for 32bit arch without large single file support. Since GFS2 doesn't handle the non-large single file case (for 32 bit anyway) this adds a new config dependency on 64BIT || LSF. This has always been the case, however we've never explicitly said so before.
Even if we do add support for the non-LSF case, we will still not require this field to be duplicated since we will not be able to access oversized files anyway.
So the net result of all this is that we shave 8 bytes from a gfs2_inode and get our config deps correct.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
ce276b06 |
| 06-Feb-2008 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Reduce inode size by merging fields
There were three fields being used to keep track of the location of the most recently allocated block for each inode. These have been merged into a single
[GFS2] Reduce inode size by merging fields
There were three fields being used to keep track of the location of the most recently allocated block for each inode. These have been merged into a single field in order to better keep the data and metadata for an inode close on disk, and also to reduce the space required for storage.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
9a004508 |
| 01-Feb-2008 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Shrink & rename di_depth
This patch forms a pair with the previous patch which shrunk di_height. Like that patch di_depth is renamed i_depth and moved into struct gfs2_inode directly. Also th
[GFS2] Shrink & rename di_depth
This patch forms a pair with the previous patch which shrunk di_height. Like that patch di_depth is renamed i_depth and moved into struct gfs2_inode directly. Also the field goes from 16 bits to 8 bits since it is also limited to a max value which is rather small (17 in this case). In addition we also now validate the field against this maximum value when its read in.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
ca390601 |
| 28-Jan-2008 |
Bob Peterson <rpeterso@redhat.com> |
[GFS2] Fix debug inode printing
I noticed that the latest change to i_height got rid of the value from the inode dump. This patch adds it back.
Signed-off-by: Bob Peterson <rpeterso@redhat.com> Si
[GFS2] Fix debug inode printing
I noticed that the latest change to i_height got rid of the value from the inode dump. This patch adds it back.
Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
ecc30c79 |
| 28-Jan-2008 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Streamline indirect pointer tree height calculation
This patch improves the calculation of the tree height in order to reduce the number of operations which are carried out on each call to gf
[GFS2] Streamline indirect pointer tree height calculation
This patch improves the calculation of the tree height in order to reduce the number of operations which are carried out on each call to gfs2_block_map. In the common case, we now make a single comparison, rather than calculating the required tree height from scratch each time. Also in the case that the tree does need some extra height, we start from the current height rather from zero when we work out what the new height ought to be.
In addition the di_height field is moved into the inode proper and reduced in size to a u8 since the value must be between 0 and GFS2_MAX_META_HEIGHT (10).
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
69840b0d |
| 07-Feb-2008 |
David Howells <dhowells@redhat.com> |
iget: use iget_failed() in GFS2
Use iget_failed() in GFS2 to kill a failed inode.
Signed-off-by: David Howells <dhowells@redhat.com> Cc: Steven Whitehouse <swhiteho@redhat.com> Acked-by: Christoph
iget: use iget_failed() in GFS2
Use iget_failed() in GFS2 to kill a failed inode.
Signed-off-by: David Howells <dhowells@redhat.com> Cc: Steven Whitehouse <swhiteho@redhat.com> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
#
1b8177ec |
| 19-Jan-2008 |
Bob Peterson <rpeterso@redhat.com> |
[GFS2] Lockup on error
I spotted this bug while I was digging around. Looks like it could cause a lockup in some rare error condition.
Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-
[GFS2] Lockup on error
I spotted this bug while I was digging around. Looks like it could cause a lockup in some rare error condition.
Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
6dbd8224 |
| 10-Jan-2008 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Reduce inode size by moving i_alloc out of line
It is possible to reduce the size of GFS2 inodes by taking the i_alloc structure out of the gfs2_inode. This patch allocates the i_alloc struct
[GFS2] Reduce inode size by moving i_alloc out of line
It is possible to reduce the size of GFS2 inodes by taking the i_alloc structure out of the gfs2_inode. This patch allocates the i_alloc structure whenever its needed, and frees it afterward. This decreases the amount of low memory we use at the expense of requiring a memory allocation for each page or partial page that we write. A quick test with postmark shows that the overhead is not measurable and I also note that OCFS2 use the same approach.
In the future I'd like to solve the problem by shrinking down the size of the members of the i_alloc structure, but for now, this reduces the immediate problem of using too much low-memory on x86 and doesn't add too much overhead.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
c97bfe43 |
| 29-Nov-2007 |
Wendy Cheng <wcheng@redhat.com> |
[GFS2] Remove lock methods for lock_nolock protocol
GFS2 supports two modes of locking - lock_nolock for single node filesystem and lock_dlm for cluster mode locking. The gfs2 lock methods are remov
[GFS2] Remove lock methods for lock_nolock protocol
GFS2 supports two modes of locking - lock_nolock for single node filesystem and lock_dlm for cluster mode locking. The gfs2 lock methods are removed from file operation table for lock_nolock protocol. This would allow VFS to handle posix lock and flock logics just like other in-tree filesystems without duplication.
Signed-off-by: S. Wendy Cheng <wcheng@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
2bcd610d |
| 08-Nov-2007 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Don't add glocks to the journal
The only reason for adding glocks to the journal was to keep track of which locks required a log flush prior to release. We add a flag to the glock to allow th
[GFS2] Don't add glocks to the journal
The only reason for adding glocks to the journal was to keep track of which locks required a log flush prior to release. We add a flag to the glock to allow this check to be made in a simpler way.
This reduces the size of a glock (by 12 bytes on i386, 24 on x86_64) and means that we can avoid extra work during the journal flush.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
5561093e |
| 17-Oct-2007 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Introduce gfs2_set_aops()
Just like ext3 we now have three sets of address space operations to cover the cases of writeback, ordered and journalled data writes. This means that the individual
[GFS2] Introduce gfs2_set_aops()
Just like ext3 we now have three sets of address space operations to cover the cases of writeback, ordered and journalled data writes. This means that the individual operations can now become less complicated as we are able to remove some of the tests for file data mode from the code.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
f91a0d3e |
| 15-Oct-2007 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Remove useless i_cache from inodes
The i_cache was designed to keep references to the indirect blocks used during block mapping so that they didn't have to be looked up continually. The idea
[GFS2] Remove useless i_cache from inodes
The i_cache was designed to keep references to the indirect blocks used during block mapping so that they didn't have to be looked up continually. The idea failed because there are too many places where the i_cache needs to be freed, and this has in the past been the cause of many bugs.
In addition there was no performance benefit being gained since the disk blocks in question were cached anyway. So this patch removes it in order to simplify the code to prepare for other changes which would otherwise have had to add further support for this feature.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
51ff87bd |
| 15-Oct-2007 |
Steven Whitehouse <swhiteho@redhat.com> |
[GFS2] Clean up internal read function
As requested by Christoph, this patch cleans up GFS2's internal read function so that it no longer uses the do_generic_mapping_read function. This function is
[GFS2] Clean up internal read function
As requested by Christoph, this patch cleans up GFS2's internal read function so that it no longer uses the do_generic_mapping_read function. This function is obsolete and GFS2 is the last user of it.
As a side effect the internal read code gets smaller and easier to read and gfs2_readpage is split into two. One function has the locking and the other function has the rest of the logic.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Christoph Hellwig <hch@infradead.org>
show more ...
|
#
7a9f53b3 |
| 18-Sep-2007 |
Benjamin Marzinski <bmarzins@redhat.com> |
[GFS2] Alternate gfs2_iget to avoid looking up inodes being freed
There is a possible deadlock between two processes on the same node, where one process is deleting an inode, and another process is
[GFS2] Alternate gfs2_iget to avoid looking up inodes being freed
There is a possible deadlock between two processes on the same node, where one process is deleting an inode, and another process is looking for allocated but unused inodes to delete in order to create more space.
process A does an iput() on inode X, and it's i_count drops to 0. This causes iput_final() to be called, which puts an inode into state I_FREEING at generic_delete_inode(). There no point between when iput_final() is called, and when I_FREEING is set where GFS2 could acquire any glocks. Once I_FREEING is set, no other process on that node can successfully look up that inode until the delete finishes.
process B locks the the resource group for the same inode in get_local_rgrp(), which is called by gfs2_inplace_reserve_i()
process A tries to lock the resource group for the inode in gfs2_dinode_dealloc(), but it's already locked by process B
process B waits in find_inode for the inode to have the I_FREEING state cleared.
Deadlock.
This patch solves the problem by adding an alternative to gfs2_iget(), gfs2_iget_skip(), that simply skips any inodes that are in the I_FREEING state.o The alternate test function is just like the original one, except that it fails if the inode is being freed, and sets a skipped flag. The alternate set function is just like the original, except that it fails if the skipped flag is set. Only try_rgrp_unlink() calls gfs2_iget_skip() instead of gfs2_iget().
Signed-off-by: Benjamin E. Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
e9bd2b3b |
| 24-Aug-2007 |
Wendy Cheng <wcheng@redhat.com> |
[GFS2] fix inode meta data corruption
Fix a nasty inode meta data corruption issue by keeping the buffer head in icache array. This buffer needs to stay in memory until journal flush occurs Otherwis
[GFS2] fix inode meta data corruption
Fix a nasty inode meta data corruption issue by keeping the buffer head in icache array. This buffer needs to stay in memory until journal flush occurs Otherwise, gfs2_meta_inode_buffer could do a disk read before the inode hits disk. It ends up with meta data corruptions. The buffer will be released as part of the existing journal flush logic.
Signed-off-by: S. Wendy Cheng <wcheng@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
35dcc52e |
| 27-Jun-2007 |
Wendy Cheng <wcheng@redhat.com> |
[GFS2] Remove i_mode passing from NFS File Handle
GFS2 has been passing i_mode within NFS File Handle. Other than the wrong assumption that there is always room for this extra 16 bit value, the curr
[GFS2] Remove i_mode passing from NFS File Handle
GFS2 has been passing i_mode within NFS File Handle. Other than the wrong assumption that there is always room for this extra 16 bit value, the current gfs2_get_dentry doesn't really need the i_mode to work correctly. Note that GFS2 NFS code does go thru the same lookup code path as direct file access route (where the mode is obtained from name lookup) but gfs2_get_dentry() is coded for different purpose. It is not used during lookup time. It is part of the file access procedure call. When the call is invoked, if on-disk inode is not in-memory, it has to be read-in. This makes i_mode passing a useless overhead.
Signed-off-by: S. Wendy Cheng <wcheng@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
bb9bcf06 |
| 27-Jun-2007 |
Wendy Cheng <wcheng@redhat.com> |
[GFS2] Obtaining no_formal_ino from directory entry
GFS2 lookup code doesn't ask for inode shared glock. This implies during in-memory inode creation for existing file, GFS2 will not disk-read in th
[GFS2] Obtaining no_formal_ino from directory entry
GFS2 lookup code doesn't ask for inode shared glock. This implies during in-memory inode creation for existing file, GFS2 will not disk-read in the inode contents. This leaves no_formal_ino un-initialized during lookup time. The un-initialized no_formal_ino is subsequently encoded into file handle. Clients will get ESTALE error whenever it tries to access these files.
Signed-off-by: S. Wendy Cheng <wcheng@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|