Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254920
b: refs/heads/master
c: 3942ae5
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Jul 12, 2011
1 parent 63b7c66 commit d08aea3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ce533686c7d40bf900dc346a7279c17a9ee8e0e
refs/heads/master: 3942ae5319640ced5844b75f44884e4bcb8a2f16
2 changes: 2 additions & 0 deletions trunk/fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/buffer_head.h>
#include <linux/rcupdate.h>
#include <linux/rculist_bl.h>
#include <linux/completion.h>

#define DIO_WAIT 0x00000010
#define DIO_METADATA 0x00000020
Expand Down Expand Up @@ -546,6 +547,7 @@ struct gfs2_sbd {
struct gfs2_glock *sd_trans_gl;
wait_queue_head_t sd_glock_wait;
atomic_t sd_glock_disposal;
struct completion sd_locking_init;

/* Inode Stuff */

Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)

init_waitqueue_head(&sdp->sd_glock_wait);
atomic_set(&sdp->sd_glock_disposal, 0);
init_completion(&sdp->sd_locking_init);
spin_lock_init(&sdp->sd_statfs_spin);

spin_lock_init(&sdp->sd_rindex_spin);
Expand Down Expand Up @@ -1017,11 +1018,13 @@ static int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent)
fsname++;
if (lm->lm_mount == NULL) {
fs_info(sdp, "Now mounting FS...\n");
complete(&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);
return ret;
}

Expand Down
7 changes: 6 additions & 1 deletion trunk/fs/gfs2/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ static ssize_t lkfirst_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
rv = sscanf(buf, "%u", &first);
if (rv != 1 || first > 1)
return -EINVAL;
rv = wait_for_completion_killable(&sdp->sd_locking_init);
if (rv)
return rv;
spin_lock(&sdp->sd_jindex_spin);
rv = -EBUSY;
if (test_bit(SDF_NOJOURNALID, &sdp->sd_flags) == 0)
Expand Down Expand Up @@ -414,7 +417,9 @@ static ssize_t jid_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
rv = sscanf(buf, "%d", &jid);
if (rv != 1)
return -EINVAL;

rv = wait_for_completion_killable(&sdp->sd_locking_init);
if (rv)
return rv;
spin_lock(&sdp->sd_jindex_spin);
rv = -EINVAL;
if (sdp->sd_lockstruct.ls_ops->lm_mount == NULL)
Expand Down

0 comments on commit d08aea3

Please sign in to comment.