[AFS]: Fix VLocation record update wakeup
Fix the wakeup transitions after a VLocation record update completes one way or another. This builds on Dave Miller's partial fix. Also move wakeups outside the spinlocked sections. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1a028e5072
commit
47051a2152
|
@ -416,8 +416,8 @@ fill_in_record:
|
||||||
goto error_abandon;
|
goto error_abandon;
|
||||||
spin_lock(&vl->lock);
|
spin_lock(&vl->lock);
|
||||||
vl->state = AFS_VL_VALID;
|
vl->state = AFS_VL_VALID;
|
||||||
wake_up(&vl->waitq);
|
|
||||||
spin_unlock(&vl->lock);
|
spin_unlock(&vl->lock);
|
||||||
|
wake_up(&vl->waitq);
|
||||||
|
|
||||||
/* schedule for regular updates */
|
/* schedule for regular updates */
|
||||||
afs_vlocation_queue_for_updates(vl);
|
afs_vlocation_queue_for_updates(vl);
|
||||||
|
@ -442,7 +442,7 @@ found_in_memory:
|
||||||
|
|
||||||
_debug("invalid [state %d]", state);
|
_debug("invalid [state %d]", state);
|
||||||
|
|
||||||
if ((state == AFS_VL_NEW || state == AFS_VL_NO_VOLUME)) {
|
if (state == AFS_VL_NEW || state == AFS_VL_NO_VOLUME) {
|
||||||
vl->state = AFS_VL_CREATING;
|
vl->state = AFS_VL_CREATING;
|
||||||
spin_unlock(&vl->lock);
|
spin_unlock(&vl->lock);
|
||||||
goto fill_in_record;
|
goto fill_in_record;
|
||||||
|
@ -453,11 +453,10 @@ found_in_memory:
|
||||||
_debug("wait");
|
_debug("wait");
|
||||||
|
|
||||||
spin_unlock(&vl->lock);
|
spin_unlock(&vl->lock);
|
||||||
ret = wait_event_interruptible(
|
ret = wait_event_interruptible(vl->waitq,
|
||||||
vl->waitq,
|
vl->state == AFS_VL_NEW ||
|
||||||
vl->state == AFS_VL_NEW ||
|
vl->state == AFS_VL_VALID ||
|
||||||
vl->state == AFS_VL_VALID ||
|
vl->state == AFS_VL_NO_VOLUME);
|
||||||
vl->state == AFS_VL_NO_VOLUME);
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
spin_lock(&vl->lock);
|
spin_lock(&vl->lock);
|
||||||
|
@ -471,8 +470,8 @@ success:
|
||||||
error_abandon:
|
error_abandon:
|
||||||
spin_lock(&vl->lock);
|
spin_lock(&vl->lock);
|
||||||
vl->state = AFS_VL_NEW;
|
vl->state = AFS_VL_NEW;
|
||||||
wake_up(&vl->waitq);
|
|
||||||
spin_unlock(&vl->lock);
|
spin_unlock(&vl->lock);
|
||||||
|
wake_up(&vl->waitq);
|
||||||
error:
|
error:
|
||||||
ASSERT(vl != NULL);
|
ASSERT(vl != NULL);
|
||||||
afs_put_vlocation(vl);
|
afs_put_vlocation(vl);
|
||||||
|
@ -675,7 +674,6 @@ static void afs_vlocation_updater(struct work_struct *work)
|
||||||
case 0:
|
case 0:
|
||||||
afs_vlocation_apply_update(vl, &vldb);
|
afs_vlocation_apply_update(vl, &vldb);
|
||||||
vl->state = AFS_VL_VALID;
|
vl->state = AFS_VL_VALID;
|
||||||
wake_up(&vl->waitq);
|
|
||||||
break;
|
break;
|
||||||
case -ENOMEDIUM:
|
case -ENOMEDIUM:
|
||||||
vl->state = AFS_VL_VOLUME_DELETED;
|
vl->state = AFS_VL_VOLUME_DELETED;
|
||||||
|
@ -685,6 +683,7 @@ static void afs_vlocation_updater(struct work_struct *work)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
spin_unlock(&vl->lock);
|
spin_unlock(&vl->lock);
|
||||||
|
wake_up(&vl->waitq);
|
||||||
|
|
||||||
/* and then reschedule */
|
/* and then reschedule */
|
||||||
_debug("reschedule");
|
_debug("reschedule");
|
||||||
|
|
Loading…
Reference in New Issue