Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89555
b: refs/heads/master
c: 1693a5c
h: refs/heads/master
i:
  89553: badfec3
  89551: 0306ec2
v: v3
  • Loading branch information
David Teigland authored and Mark Fasheh committed Apr 18, 2008
1 parent c7294c7 commit 3236a8a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 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: de551246e7bc5558371c3427889a8db1b8cc60f4
refs/heads/master: 1693a5c0117f8ccd010a666f97aaf0f14fb0a0e4
27 changes: 23 additions & 4 deletions trunk/fs/ocfs2/dlmglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,20 @@ static void ocfs2_locking_ast(void *opaque)
struct ocfs2_lock_res *lockres = opaque;
struct ocfs2_super *osb = ocfs2_get_lockres_osb(lockres);
unsigned long flags;
int status;

spin_lock_irqsave(&lockres->l_lock, flags);

if (ocfs2_dlm_lock_status(&lockres->l_lksb)) {
status = ocfs2_dlm_lock_status(&lockres->l_lksb);

if (status == -EAGAIN) {
lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
goto out;
}

if (status) {
mlog(ML_ERROR, "lockres %s: lksb status value of %d!\n",
lockres->l_name,
ocfs2_dlm_lock_status(&lockres->l_lksb));
lockres->l_name, status);
spin_unlock_irqrestore(&lockres->l_lock, flags);
return;
}
Expand All @@ -909,7 +916,7 @@ static void ocfs2_locking_ast(void *opaque)
lockres->l_unlock_action);
BUG();
}

out:
/* set it to something invalid so if we get called again we
* can catch it. */
lockres->l_action = OCFS2_AST_INVALID;
Expand Down Expand Up @@ -1113,6 +1120,7 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb,
int ret = 0; /* gcc doesn't realize wait = 1 guarantees ret is set */
unsigned long flags;
unsigned int gen;
int noqueue_attempted = 0;

mlog_entry_void();

Expand Down Expand Up @@ -1157,6 +1165,13 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb,
}

if (level > lockres->l_level) {
if (noqueue_attempted > 0) {
ret = -EAGAIN;
goto unlock;
}
if (lkm_flags & DLM_LKF_NOQUEUE)
noqueue_attempted = 1;

if (lockres->l_action != OCFS2_AST_INVALID)
mlog(ML_ERROR, "lockres %s has action %u pending\n",
lockres->l_name, lockres->l_action);
Expand Down Expand Up @@ -1621,6 +1636,10 @@ int ocfs2_file_lock(struct file *file, int ex, int trylock)
* to just bubble sucess back up to the user.
*/
ret = ocfs2_flock_handle_signal(lockres, level);
} else if (!ret && (level > lockres->l_level)) {
/* Trylock failed asynchronously */
BUG_ON(!trylock);
ret = -EAGAIN;
}

out:
Expand Down

0 comments on commit 3236a8a

Please sign in to comment.