Commit 659b3613 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull dlm updates from David Teigland:

 - Allow blocking posix lock requests to be interrupted while waiting.
   This requires a cancel request to be sent to the userspace daemon
   where posix lock requests are processed across the cluster.

 - Fix a posix lock patch from the previous cycle in which lock requests
   from different file systems could be mixed up.

 - Fix some long standing problems with nfs posix lock cancelation.

 - Add a new debugfs file for printing queued callbacks.

 - Stop modifying buffers that have been used to receive a message.

 - Misc cleanups and some refactoring.

* tag 'dlm-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
  dlm: fix plock lookup when using multiple lockspaces
  fs: dlm: don't use RCOM_NAMES for version detection
  fs: dlm: create midcomms nodes when configure
  fs: dlm: constify receive buffer
  fs: dlm: drop rxbuf manipulation in dlm_recover_master_copy
  fs: dlm: drop rxbuf manipulation in dlm_copy_master_names
  fs: dlm: get recovery sequence number as parameter
  fs: dlm: cleanup lock order
  fs: dlm: remove clear_members_cb
  fs: dlm: add plock dev tracepoints
  fs: dlm: check on plock ops when exit dlm
  fs: dlm: debugfs for queued callbacks
  fs: dlm: remove unused processed_nodes
  fs: dlm: add missing spin_unlock
  fs: dlm: fix F_CANCELLK to cancel pending request
  fs: dlm: allow to F_SETLKW getting interrupted
  fs: dlm: remove twice newline
parents e7e9423d 7c53e847
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -664,7 +664,7 @@ static ssize_t comm_addr_store(struct config_item *item, const char *buf,

	memcpy(addr, buf, len);

	rv = dlm_lowcomms_addr(cm->nodeid, addr, len);
	rv = dlm_midcomms_addr(cm->nodeid, addr, len);
	if (rv) {
		kfree(addr);
		return rv;
+100 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "dlm_internal.h"
#include "midcomms.h"
#include "lock.h"
#include "ast.h"

#define DLM_DEBUG_BUF_LEN 4096
static char debug_buf[DLM_DEBUG_BUF_LEN];
@@ -365,6 +366,52 @@ static void print_format4(struct dlm_rsb *r, struct seq_file *s)
	unlock_rsb(r);
}

static void print_format5_lock(struct seq_file *s, struct dlm_lkb *lkb)
{
	struct dlm_callback *cb;

	/* lkb_id lkb_flags mode flags sb_status sb_flags */

	spin_lock(&lkb->lkb_cb_lock);
	list_for_each_entry(cb, &lkb->lkb_callbacks, list) {
		seq_printf(s, "%x %x %d %x %d %x\n",
			   lkb->lkb_id,
			   dlm_iflags_val(lkb),
			   cb->mode,
			   cb->flags,
			   cb->sb_status,
			   cb->sb_flags);
	}
	spin_unlock(&lkb->lkb_cb_lock);
}

static void print_format5(struct dlm_rsb *r, struct seq_file *s)
{
	struct dlm_lkb *lkb;

	lock_rsb(r);

	list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue) {
		print_format5_lock(s, lkb);
		if (seq_has_overflowed(s))
			goto out;
	}

	list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue) {
		print_format5_lock(s, lkb);
		if (seq_has_overflowed(s))
			goto out;
	}

	list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue) {
		print_format5_lock(s, lkb);
		if (seq_has_overflowed(s))
			goto out;
	}
 out:
	unlock_rsb(r);
}

struct rsbtbl_iter {
	struct dlm_rsb *rsb;
	unsigned bucket;
@@ -408,6 +455,13 @@ static int table_seq_show(struct seq_file *seq, void *iter_ptr)
		}
		print_format4(ri->rsb, seq);
		break;
	case 5:
		if (ri->header) {
			seq_puts(seq, "lkb_id lkb_flags mode flags sb_status sb_flags\n");
			ri->header = 0;
		}
		print_format5(ri->rsb, seq);
		break;
	}

	return 0;
@@ -417,6 +471,7 @@ static const struct seq_operations format1_seq_ops;
static const struct seq_operations format2_seq_ops;
static const struct seq_operations format3_seq_ops;
static const struct seq_operations format4_seq_ops;
static const struct seq_operations format5_seq_ops;

static void *table_seq_start(struct seq_file *seq, loff_t *pos)
{
@@ -448,6 +503,8 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos)
		ri->format = 3;
	if (seq->op == &format4_seq_ops)
		ri->format = 4;
	if (seq->op == &format5_seq_ops)
		ri->format = 5;

	tree = toss ? &ls->ls_rsbtbl[bucket].toss : &ls->ls_rsbtbl[bucket].keep;

@@ -602,10 +659,18 @@ static const struct seq_operations format4_seq_ops = {
	.show  = table_seq_show,
};

static const struct seq_operations format5_seq_ops = {
	.start = table_seq_start,
	.next  = table_seq_next,
	.stop  = table_seq_stop,
	.show  = table_seq_show,
};

static const struct file_operations format1_fops;
static const struct file_operations format2_fops;
static const struct file_operations format3_fops;
static const struct file_operations format4_fops;
static const struct file_operations format5_fops;

static int table_open1(struct inode *inode, struct file *file)
{
@@ -683,7 +748,21 @@ static int table_open4(struct inode *inode, struct file *file)
	struct seq_file *seq;
	int ret;

	ret = seq_open(file, &format4_seq_ops);
	ret = seq_open(file, &format5_seq_ops);
	if (ret)
		return ret;

	seq = file->private_data;
	seq->private = inode->i_private; /* the dlm_ls */
	return 0;
}

static int table_open5(struct inode *inode, struct file *file)
{
	struct seq_file *seq;
	int ret;

	ret = seq_open(file, &format5_seq_ops);
	if (ret)
		return ret;

@@ -725,6 +804,14 @@ static const struct file_operations format4_fops = {
	.release = seq_release
};

static const struct file_operations format5_fops = {
	.owner   = THIS_MODULE,
	.open    = table_open5,
	.read    = seq_read,
	.llseek  = seq_lseek,
	.release = seq_release
};

/*
 * dump lkb's on the ls_waiters list
 */
@@ -793,6 +880,7 @@ void dlm_delete_debug_file(struct dlm_ls *ls)
	debugfs_remove(ls->ls_debug_locks_dentry);
	debugfs_remove(ls->ls_debug_all_dentry);
	debugfs_remove(ls->ls_debug_toss_dentry);
	debugfs_remove(ls->ls_debug_queued_asts_dentry);
}

static int dlm_state_show(struct seq_file *file, void *offset)
@@ -936,6 +1024,17 @@ void dlm_create_debug_file(struct dlm_ls *ls)
							  dlm_root,
							  ls,
							  &waiters_fops);

	/* format 5 */

	memset(name, 0, sizeof(name));
	snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_queued_asts", ls->ls_name);

	ls->ls_debug_queued_asts_dentry = debugfs_create_file(name,
							      0644,
							      dlm_root,
							      ls,
							      &format5_fops);
}

void __init dlm_register_debugfs(void)
+7 −7
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ void dlm_recover_dir_nodeid(struct dlm_ls *ls)
	up_read(&ls->ls_root_sem);
}

int dlm_recover_directory(struct dlm_ls *ls)
int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq)
{
	struct dlm_member *memb;
	char *b, *last_name = NULL;
@@ -90,7 +90,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
			}

			error = dlm_rcom_names(ls, memb->nodeid,
					       last_name, last_len);
					       last_name, last_len, seq);
			if (error)
				goto out_free;

@@ -196,7 +196,8 @@ int dlm_recover_directory(struct dlm_ls *ls)
	return error;
}

static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, char *name, int len)
static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, const char *name,
				     int len)
{
	struct dlm_rsb *r;
	uint32_t hash, bucket;
@@ -232,7 +233,7 @@ static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, char *name, int len)
   for rsb's we're master of and whose directory node matches the requesting
   node.  inbuf is the rsb name last sent, inlen is the name's length */

void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
void dlm_copy_master_names(struct dlm_ls *ls, const char *inbuf, int inlen,
 			   char *outbuf, int outlen, int nodeid)
{
	struct list_head *list;
@@ -245,9 +246,8 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
	if (inlen > 1) {
		r = find_rsb_root(ls, inbuf, inlen);
		if (!r) {
			inbuf[inlen - 1] = '\0';
			log_error(ls, "copy_master_names from %d start %d %s",
				  nodeid, inlen, inbuf);
			log_error(ls, "copy_master_names from %d start %d %.*s",
				  nodeid, inlen, inlen, inbuf);
			goto out;
		}
		list = r->res_root_list.next;
+3 −3
Original line number Diff line number Diff line
@@ -15,8 +15,8 @@
int dlm_dir_nodeid(struct dlm_rsb *rsb);
int dlm_hash2nodeid(struct dlm_ls *ls, uint32_t hash);
void dlm_recover_dir_nodeid(struct dlm_ls *ls);
int dlm_recover_directory(struct dlm_ls *ls);
void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq);
void dlm_copy_master_names(struct dlm_ls *ls, const char *inbuf, int inlen,
			   char *outbuf, int outlen, int nodeid);

#endif				/* __DIR_DOT_H__ */
+1 −0
Original line number Diff line number Diff line
@@ -598,6 +598,7 @@ struct dlm_ls {
	struct dentry		*ls_debug_locks_dentry; /* debugfs */
	struct dentry		*ls_debug_all_dentry; /* debugfs */
	struct dentry		*ls_debug_toss_dentry; /* debugfs */
	struct dentry		*ls_debug_queued_asts_dentry; /* debugfs */

	wait_queue_head_t	ls_uevent_wait;	/* user part of join/leave */
	int			ls_uevent_result;
Loading