#
7b7a9115 |
| 10-Sep-2014 |
Benjamin Coddington <bcodding@redhat.com> |
GFS2: Hash the negative dentry during inode lookup
Fix a regression introduced by: 6d4ade986f9c8df31e68 GFS2: Add atomic_open support where an early return misses d_splice_alias() which had been add
GFS2: Hash the negative dentry during inode lookup
Fix a regression introduced by: 6d4ade986f9c8df31e68 GFS2: Add atomic_open support where an early return misses d_splice_alias() which had been adding the negative dentry.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
24972557 |
| 01-May-2014 |
Benjamin Marzinski <bmarzins@redhat.com> |
GFS2: remove transaction glock
GFS2 has a transaction glock, which must be grabbed for every transaction, whose purpose is to deal with freezing the filesystem. Aside from this involving a large amo
GFS2: remove transaction glock
GFS2 has a transaction glock, which must be grabbed for every transaction, whose purpose is to deal with freezing the filesystem. Aside from this involving a large amount of locking, it is very easy to make the current fsfreeze code hang on unfreezing.
This patch rewrites how gfs2 handles freezing the filesystem. The transaction glock is removed. In it's place is a freeze glock, which is cached (but not held) in a shared state by every node in the cluster when the filesystem is mounted. This lock only needs to be grabbed on freezing, and actions which need to be safe from freezing, like recovery.
When a node wants to freeze the filesystem, it grabs this glock exclusively. When the freeze glock state changes on the nodes (either from shared to unlocked, or shared to exclusive), the filesystem does a special log flush. gfs2_log_flush() does all the work for flushing out the and shutting down the incore log, and then it tries to grab the freeze glock in a shared state again. Since the filesystem is stuck in gfs2_log_flush, no new transaction can start, and nothing can be written to disk. Unfreezing the filesytem simply involes dropping the freeze glock, allowing gfs2_log_flush() to grab and then release the shared lock, so it is cached for next time.
However, in order for the unfreezing ioctl to occur, gfs2 needs to get a shared lock on the filesystem root directory inode to check permissions. If that glock has already been grabbed exclusively, fsfreeze will be unable to get the shared lock and unfreeze the filesystem.
In order to allow the unfreeze, this patch makes gfs2 grab a shared lock on the filesystem root directory during the freeze, and hold it until it unfreezes the filesystem. The functions which need to grab a shared lock in order to allow the unfreeze ioctl to be issued now use the lock grabbed by the freeze code instead.
The freeze and unfreeze code take care to make sure that this shared lock will not be dropped while another process is using it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
05978803 |
| 31-Mar-2014 |
Abhi Das <adas@redhat.com> |
GFS2: Fix uninitialized VFS inode in gfs2_create_inode
When gfs2_create_inode() fails due to quota violation, the VFS inode is not completely uninitialized. This can cause a list corruption error.
GFS2: Fix uninitialized VFS inode in gfs2_create_inode
When gfs2_create_inode() fails due to quota violation, the VFS inode is not completely uninitialized. This can cause a list corruption error.
This patch correctly uninitializes the VFS inode when a quota violation occurs in the gfs2_create_inode codepath.
Resolves: rhbz#1059808 Signed-off-by: Abhi Das <adas@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
f45dc26d |
| 19-Mar-2014 |
Bob Peterson <rpeterso@redhat.com> |
GFS2: Remove extraneous function gfs2_security_init
This patch eliminates function gfs2_security_init in favor of just calling security_inode_init_security directly.
Signed-off-by: Bob Peterson <rp
GFS2: Remove extraneous function gfs2_security_init
This patch eliminates function gfs2_security_init in favor of just calling security_inode_init_security directly.
Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
48f8f711 |
| 12-Mar-2014 |
Abhi Das <adas@redhat.com> |
GFS2: check NULL return value in gfs2_ok_to_move
gfs2_lookupi() can return NULL if the path to the root is broken by another rename/rmdir. In this case gfs2_ok_to_move() must check for this NULL poi
GFS2: check NULL return value in gfs2_ok_to_move
gfs2_lookupi() can return NULL if the path to the root is broken by another rename/rmdir. In this case gfs2_ok_to_move() must check for this NULL pointer and return error.
Resolves: rhbz#1060246 Signed-off-by: Abhi Das <adas@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
b2c8b3ea |
| 04-Feb-2014 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Allocate block for xattr at inode alloc time, if required
This is another step towards improving the allocation of xattr blocks at inode allocation time. Here we take advantage of Christoph's
GFS2: Allocate block for xattr at inode alloc time, if required
This is another step towards improving the allocation of xattr blocks at inode allocation time. Here we take advantage of Christoph's recent work on ACLs to allocate a block for the xattrs early if we know that we will be adding ACLs to the inode later on. The advantage of that is that it is much more likely that we'll get a contiguous run of two blocks where the first is the inode and the second is the xattr block.
We still have to fall back to the original system in case we don't get the requested two contiguous blocks, or in case the ACLs are too large to fit into the block.
Future patches will move more of the ACL setting code further up the gfs2_inode_create() function. Also, I'd like to be able to do the same thing with the xattrs from LSMs in due course, too. That way we should be able to slowly reduce the number of independent transactions, at least in the most common cases.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
e01580bf |
| 20-Dec-2013 |
Christoph Hellwig <hch@infradead.org> |
gfs2: use generic posix ACL infrastructure
This contains some major refactoring for the create path so that inodes are created with the right mode to start with instead of fixing it up later.
Signe
gfs2: use generic posix ACL infrastructure
This contains some major refactoring for the create path so that inodes are created with the right mode to start with instead of fixing it up later.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
d57b9c9a |
| 16-Jan-2014 |
J. Bruce Fields <bfields@fieldses.org> |
GFS2: revert "GFS2: d_splice_alias() can't return error"
0d0d110720d7960b77c03c9f2597faaff4b484ae asserts that "d_splice_alias() can't return error unless it was given an IS_ERR(inode)".
That was t
GFS2: revert "GFS2: d_splice_alias() can't return error"
0d0d110720d7960b77c03c9f2597faaff4b484ae asserts that "d_splice_alias() can't return error unless it was given an IS_ERR(inode)".
That was true of the implementation of d_splice_alias, but this is really a problem with d_splice_alias: at a minimum it should be able to return -ELOOP in the case where inserting the given dentry would cause a directory loop.
Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
ac3beb6a |
| 16-Jan-2014 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Don't use ENOBUFS when ENOMEM is the correct error code
Al Viro has tactfully pointed out that we are using the incorrect error code in some cases. This patch fixes that, and also removes the
GFS2: Don't use ENOBUFS when ENOMEM is the correct error code
Al Viro has tactfully pointed out that we are using the incorrect error code in some cases. This patch fixes that, and also removes the (unused) return value for glock dumping.
> * gfs2_iget() - ENOBUFS instead of ENOMEM. ENOBUFS is > "No buffer space available (POSIX.1 (XSI STREAMS option))" and since > we don't support STREAMS it's probably fair game, but... what the hell?
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Al Viro <viro@ZenIV.linux.org.uk>
show more ...
|
#
62e96cf8 |
| 06-Jan-2014 |
Bob Peterson <rpeterso@redhat.com> |
GFS2: Increase i_writecount during gfs2_setattr_chown
This patch calls get_write_access in function gfs2_setattr_chown, which merely increases inode->i_writecount for the duration of the function. T
GFS2: Increase i_writecount during gfs2_setattr_chown
This patch calls get_write_access in function gfs2_setattr_chown, which merely increases inode->i_writecount for the duration of the function. That will ensure that any file closes won't delete the inode's multi-block reservation while the function is running. It also ensures that a multi-block reservation exists when needed for quota change operations during the chown.
Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
2b47dad8 |
| 06-Jan-2014 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Remember directory insert point
When we look to see if there is enough space to add a dir entry without allocation, we have then been repeating the same search later when we do the actual inse
GFS2: Remember directory insert point
When we look to see if there is enough space to add a dir entry without allocation, we have then been repeating the same search later when we do the actual insertion. This patch caches the details of the location in the gfs2_diradd structure, so that we do not have to repeat the search.
This will provide a performance improvement which will be greater as the size of the directory increases.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
534cf9ca |
| 06-Jan-2014 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Consolidate transaction blocks calculation for dir add
There are three cases where we need to calculate the number of blocks to reserve in a transaction involving linking an inode into a direc
GFS2: Consolidate transaction blocks calculation for dir add
There are three cases where we need to calculate the number of blocks to reserve in a transaction involving linking an inode into a directory. The one in rename is a bit more complicated, but the basis of it is the same as for link and create. So it makes sense to move this calculation into a single function rather than repeating it three times.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
3c1c0ae1 |
| 06-Jan-2014 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Add directory addition info structure
The intent is that this structure will hold the information required when adding entries to a directory (linking). To start with, it will contain only the
GFS2: Add directory addition info structure
The intent is that this structure will hold the information required when adding entries to a directory (linking). To start with, it will contain only the number of blocks which are required to link the new entry into the directory. The current calculation returns either 0 or the maximim number of blocks that can ever be requested by such a transaction.
The intent is that in a later patch, we can update the dir code to calculate this value more accurately. In addition further patches will also add further fields to the new structure to increase its utility.
In addition this patch fixes a bug where the link used during inode creation was adding requesting too many blocks in some cases. This is harmless unless the fs is close to being full.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
ea0341e0 |
| 21-Nov-2013 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Fix ref count bug relating to atomic_open
In the case that atomic_open calls finish_no_open() with the dentry that was supplied to gfs2_atomic_open() an extra reference count is required. This
GFS2: Fix ref count bug relating to atomic_open
In the case that atomic_open calls finish_no_open() with the dentry that was supplied to gfs2_atomic_open() an extra reference count is required. This patch fixes that issue preventing a bug trap triggering at umount time.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
87dc800b |
| 16-Sep-2013 |
Al Viro <viro@zeniv.linux.org.uk> |
new helper: kfree_put_link()
duplicated to hell and back...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
7b9cff46 |
| 02-Oct-2013 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Add allocation parameters structure
This patch adds a structure to contain allocation parameters with the intention of future expansion of this structure. The idea is that we should be able to
GFS2: Add allocation parameters structure
This patch adds a structure to contain allocation parameters with the intention of future expansion of this structure. The idea is that we should be able to add more information about the allocation in the future in order to allow the allocator to make a better job of placing the requests on-disk.
There is no functional difference from applying this patch.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
af5c2697 |
| 27-Sep-2013 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Clean up reservation removal
The reservation for an inode should be cleared when it is truncated so that we can start again at a different offset for future allocations. We could try and do be
GFS2: Clean up reservation removal
The reservation for an inode should be cleared when it is truncated so that we can start again at a different offset for future allocations. We could try and do better than that, by resetting the search based on where the truncation started from, but this is only a first step.
In addition, there are three callers of gfs2_rs_delete() but only one of those should really be testing the value of i_writecount. While we get away with that in the other cases currently, I think it would be better if we made that test specific to the one case which requires it.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
5ca1db41 |
| 23-Sep-2013 |
Miklos Szeredi <miklos@szeredi.hu> |
GFS2: fix dentry leaks
We need to dput() the result of d_splice_alias(), unless it is passed to finish_no_open().
Edited by Steven Whitehouse in order to make it apply to the current GFS2 git tree,
GFS2: fix dentry leaks
We need to dput() the result of d_splice_alias(), unless it is passed to finish_no_open().
Edited by Steven Whitehouse in order to make it apply to the current GFS2 git tree, and taking account of a prerequisite patch which hasn't been applied.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: stable@vger.kernel.org
show more ...
|
#
0d0d1107 |
| 16-Sep-2013 |
Miklos Szeredi <mszeredi@suse.cz> |
GFS2: d_splice_alias() can't return error
unless it was given an IS_ERR(inode), which isn't the case here. So clean up the unnecessary error handling in gfs2_create_inode().
This paves the way for
GFS2: d_splice_alias() can't return error
unless it was given an IS_ERR(inode), which isn't the case here. So clean up the unnecessary error handling in gfs2_create_inode().
This paves the way for real fixes (hence the stable Cc).
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: stable@vger.kernel.org
show more ...
|
#
c5bf8fef |
| 16-Sep-2013 |
Miklos Szeredi <mszeredi@suse.cz> |
gfs2: set FILE_CREATED
In gfs2_create_inode() set FILE_CREATED in *opened.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Al Viro <viro@
gfs2: set FILE_CREATED
In gfs2_create_inode() set FILE_CREATED in *opened.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
7bd9ee58 |
| 16-Aug-2013 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Check for glock already held in gfs2_getxattr
Since the introduction of atomic_open, gfs2_getxattr can be called with the glock already held, so we need to allow for this.
Signed-off-by: Stev
GFS2: Check for glock already held in gfs2_getxattr
Since the introduction of atomic_open, gfs2_getxattr can be called with the glock already held, so we need to allow for this.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Reported-by: David Teigland <teigland@redhat.com> Tested-by: David Teigland <teigland@redhat.com>
show more ...
|
#
2523d47a |
| 17-Jul-2013 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Fix typo in gfs2_create_inode()
PTR_RET should be PTR_ERR
Reported-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Steven Whitehouse <swhit
GFS2: Fix typo in gfs2_create_inode()
PTR_RET should be PTR_ERR
Reported-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
6d4ade98 |
| 14-Jun-2013 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Add atomic_open support
I've restricted atomic_open to only operate on regular files, although I still don't understand why atomic_open should not be possible also for directories on GFS2. Tha
GFS2: Add atomic_open support
I've restricted atomic_open to only operate on regular files, although I still don't understand why atomic_open should not be possible also for directories on GFS2. That can always be added in later though, if it makes sense.
The ->atomic_open function can be passed negative dentries, which in most cases means either ENOENT (->lookup) or a call to d_instantiate (->create). In the GFS2 case though, we need to actually perform the look up, since we do not know whether there has been a new inode created on another node. The look up calls d_splice_alias which then tries to rehash the dentry - so the solution here is to simply check for that in d_splice_alias. The same issue is likely to affect any other cluster filesystem implementing ->atomic_open
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: "J. Bruce Fields" <bfields fieldses org> Cc: Jeff Layton <jlayton@redhat.com>
show more ...
|
#
5a00f3cc |
| 11-Jun-2013 |
Steven Whitehouse <swhiteho@redhat.com> |
GFS2: Only do one directory search on create
Creation of a new inode requires a directory search in order to ensure that we are not trying to create an inode with the same name as an existing one. T
GFS2: Only do one directory search on create
Creation of a new inode requires a directory search in order to ensure that we are not trying to create an inode with the same name as an existing one. This was hidden away inside the create_ok() function.
In the case that there was an existing inode, and a lookup can be substituted for a create (which is the case with regular files when the O_EXCL flag is not in use) then we were doing a second lookup in order to return the inode.
This patch merges these two lookups into one. This can be done by passing a flag to gfs2_dir_search() to tell it to just return -EEXIST in the cases where we don't actually want to look up the inode.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
show more ...
|
#
2b6f8860 |
| 01-Jun-2013 |
Thomas Meyer <thomas@m3y3r.de> |
GFS2: Cocci spatch "ptr_ret.spatch"
Use PTR_RET in place of open coding this function.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
|