Skip to content

Commit bcfad42

Browse files
Alexander Aringteigland
authored andcommitted
dlm: improve plock logging if interrupted
This patch changes the log level if a plock is removed when interrupted from debug to info. Additional it signals now that the plock entity was removed to let the user know what's happening. If on a dev_write() a pending plock cannot be find it will signal that it might have been removed because wait interruption. Before this patch there might be a "dev_write no op ..." info message and the users can only guess that the plock was removed before because the wait interruption. To be sure that is the case we log both messages on the same log level. Let both message be logged on info layer because it should not happened a lot and if it happens it should be clear why the op was not found. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent a800ba7 commit bcfad42

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

fs/dlm/plock.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,12 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
161161

162162
rv = wait_event_interruptible(recv_wq, (op->done != 0));
163163
if (rv == -ERESTARTSYS) {
164-
log_debug(ls, "%s: wait killed %llx", __func__,
165-
(unsigned long long)number);
166164
spin_lock(&ops_lock);
167165
list_del(&op->list);
168166
spin_unlock(&ops_lock);
167+
log_print("%s: wait interrupted %x %llx, op removed",
168+
__func__, ls->ls_global_id,
169+
(unsigned long long)number);
169170
dlm_release_plock_op(op);
170171
do_unlock_close(ls, number, file, fl);
171172
goto out;
@@ -443,8 +444,8 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
443444
else
444445
wake_up(&recv_wq);
445446
} else
446-
log_print("dev_write no op %x %llx", info.fsid,
447-
(unsigned long long)info.number);
447+
log_print("%s: no op %x %llx - may got interrupted?", __func__,
448+
info.fsid, (unsigned long long)info.number);
448449
return count;
449450
}
450451

0 commit comments

Comments
 (0)