[Cluster-devel] GFS2: -nmw git tree

2011-07-25 Thread Steven Whitehouse
Hi,

Linus pulled the content of the -nmw git tree over the weekend, so that
the tree is now empty again,

Steve.




[Cluster-devel] GFS2: Fix mount hang caused by certain access pattern to sysfs files

2011-07-25 Thread Steven Whitehouse

Depending upon the order of userspace/kernel during the
mount process, this can result in a hang without the
_all version of the completion.

Signed-off-by: Steven Whitehouse swhit...@redhat.com

diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 516516e..3bc073a 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1018,13 +1018,13 @@ hostdata_error:
fsname++;
if (lm-lm_mount == NULL) {
fs_info(sdp, Now mounting FS...\n);
-   complete(sdp-sd_locking_init);
+   complete_all(sdp-sd_locking_init);
return 0;
}
ret = lm-lm_mount(sdp, fsname);
if (ret == 0)
fs_info(sdp, Joined cluster. Now mounting FS...\n);
-   complete(sdp-sd_locking_init);
+   complete_all(sdp-sd_locking_init);
return ret;
 }
 




[Cluster-devel] GFS2: Clean up dir hash table reading

2011-07-25 Thread Steven Whitehouse

Since there is now only a single caller to gfs2_dir_read_data()
and it has a number of constant arguments, we can factor
those out. Also some tests relating to the inode size were
being done twice.

Signed-off-by: Steven Whitehouse swhit...@redhat.com

diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 1cc2f8e..2045d70 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -240,16 +240,15 @@ fail:
return error;
 }
 
-static int gfs2_dir_read_stuffed(struct gfs2_inode *ip, char *buf,
-u64 offset, unsigned int size)
+static int gfs2_dir_read_stuffed(struct gfs2_inode *ip, __be64 *buf,
+unsigned int size)
 {
struct buffer_head *dibh;
int error;
 
error = gfs2_meta_inode_buffer(ip, dibh);
if (!error) {
-   offset += sizeof(struct gfs2_dinode);
-   memcpy(buf, dibh-b_data + offset, size);
+   memcpy(buf, dibh-b_data + sizeof(struct gfs2_dinode), size);
brelse(dibh);
}
 
@@ -261,13 +260,12 @@ static int gfs2_dir_read_stuffed(struct gfs2_inode *ip, 
char *buf,
  * gfs2_dir_read_data - Read a data from a directory inode
  * @ip: The GFS2 Inode
  * @buf: The buffer to place result into
- * @offset: File offset to begin jdata_readng from
  * @size: Amount of data to transfer
  *
  * Returns: The amount of data actually copied or the error
  */
-static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf, u64 offset,
- unsigned int size, unsigned ra)
+static int gfs2_dir_read_data(struct gfs2_inode *ip, __be64 *buf,
+ unsigned int size)
 {
struct gfs2_sbd *sdp = GFS2_SB(ip-i_inode);
u64 lblock, dblock;
@@ -275,24 +273,14 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char 
*buf, u64 offset,
unsigned int o;
int copied = 0;
int error = 0;
-   u64 disksize = i_size_read(ip-i_inode);
-
-   if (offset = disksize)
-   return 0;
-
-   if (offset + size  disksize)
-   size = disksize - offset;
-
-   if (!size)
-   return 0;
 
if (gfs2_is_stuffed(ip))
-   return gfs2_dir_read_stuffed(ip, buf, offset, size);
+   return gfs2_dir_read_stuffed(ip, buf, size);
 
if (gfs2_assert_warn(sdp, gfs2_is_jdata(ip)))
return -EINVAL;
 
-   lblock = offset;
+   lblock = 0;
o = do_div(lblock, sdp-sd_jbsize) + sizeof(struct gfs2_meta_header);
 
while (copied  size) {
@@ -311,8 +299,6 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char 
*buf, u64 offset,
if (error || !dblock)
goto fail;
BUG_ON(extlen  1);
-   if (!ra)
-   extlen = 1;
bh = gfs2_meta_ra(ip-i_gl, dblock, extlen);
} else {
error = gfs2_meta_read(ip-i_gl, dblock, DIO_WAIT, bh);
@@ -328,7 +314,7 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char 
*buf, u64 offset,
extlen--;
memcpy(buf, bh-b_data + o, amount);
brelse(bh);
-   buf += amount;
+   buf += (amount/sizeof(__be64));
copied += amount;
lblock++;
o = sizeof(struct gfs2_meta_header);
@@ -371,7 +357,7 @@ static __be64 *gfs2_dir_get_hash_table(struct gfs2_inode 
*ip)
if (hc == NULL)
return ERR_PTR(-ENOMEM);
 
-   ret = gfs2_dir_read_data(ip, (char *)hc, 0, hsize, 1);
+   ret = gfs2_dir_read_data(ip, hc, hsize);
if (ret  0) {
kfree(hc);
return ERR_PTR(ret);




Re: [Cluster-devel] [PATCH RHEL6 1/2] tunegfs2: Ensure we don't try to open a null device

2011-07-25 Thread Bob Peterson
- Original Message -
| This is based on upstream commit
| a830c8747cf7dcc899dc92ad13c3a3b1a3738092
| 
| Return codes are now taken from sysexits.h rather than trying to pass
| negative
| errno values as per kernel code. There is not an exact error code for
| all
| potential events, but they are close enough I think.
| 
| The code also checks that there is exactly one non-option argument
| (i.e. the
| device) given before attempting to open it.
| 
| rhbz#719124
| 
| Signed-off-by: Andrew Price anpr...@redhat.com
| Signed-off-by: Steven Whitehouse swhit...@redhat.com
| Reported-by: Nathan Straz nst...@redhat.com

Hi,

Looks good.  ACK.

Bob Peterson
Red Hat File Systems



Re: [Cluster-devel] [PATCH RHEL6 2/2] tunegfs2: Fix usage message

2011-07-25 Thread Bob Peterson
- Original Message -
| This is based on upstream commit
| a830c8747cf7dcc899dc92ad13c3a3b1a3738092
| 
| The help message is updated to include all supported options.
| 
| rhbz#719126
| 
| Signed-off-by: Steven Whitehouse swhit...@redhat.com
| Signed-off-by: Andrew Price anpr...@redhat.com
| Reported-by: Nathan Straz nst...@redhat.com
| ---

Hi,

ACK,

Regards,

Bob Peterson
Red Hat File Systems



Re: [Cluster-devel] [PATCH RHEL6 2/2] tunegfs2: Fix usage message

2011-07-25 Thread Steven Whitehouse
Hi,

Both look good to me,

Steve.

On Mon, 2011-07-25 at 18:03 +0100, Andrew Price wrote:
 This is based on upstream commit a830c8747cf7dcc899dc92ad13c3a3b1a3738092
 
 The help message is updated to include all supported options.
 
 rhbz#719126
 
 Signed-off-by: Steven Whitehouse swhit...@redhat.com
 Signed-off-by: Andrew Price anpr...@redhat.com
 Reported-by: Nathan Straz nst...@redhat.com
 ---
  gfs2/tune/main.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/gfs2/tune/main.c b/gfs2/tune/main.c
 index be542d7..6a0daff 100644
 --- a/gfs2/tune/main.c
 +++ b/gfs2/tune/main.c
 @@ -52,8 +52,8 @@ void parse_mount_options(char *arg)
  
  static void usage(char *name)
  {
 - printf(Usage: %s -L volume label -U UUID -l -o 
 - mount options device \n, basename(name));
 + printf(Usage: %s [-hlV] [-L volume_label] [-U UUID]\n\t
 + [-o mount_options] device \n, basename(name));
  }
  
  static void version(void)