Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61011677 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull dlm updates from David Teigland:
 "This set includes some minor fixes and improvements.  The one large
  patch addresses the special "nodir" mode, which has been a long
  neglected proof of concept, but with these fixes seems to be quite
  usable.  It allows the resource master to be assigned statically
  instead of dynamically, which can improve performance if there is
  little locality and most resources are shared."

* tag 'dlm-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
  dlm: NULL dereference on failure in kmem_cache_create()
  gfs2: fix recovery during unmount
  dlm: fixes for nodir mode
  dlm: improve error and debug messages
  dlm: avoid unnecessary search in search_rsb
  dlm: limit rcom debug messages
  dlm: fix waiter recovery
  dlm: prevent connections during shutdown
parents 6133308a 75af271e
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -310,6 +310,7 @@ void dlm_callback_resume(struct dlm_ls *ls)
	}
	}
	mutex_unlock(&ls->ls_cb_mutex);
	mutex_unlock(&ls->ls_cb_mutex);


	if (count)
		log_debug(ls, "dlm_callback_resume %d", count);
		log_debug(ls, "dlm_callback_resume %d", count);
}
}
+14 −2
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@
#include <linux/miscdevice.h>
#include <linux/miscdevice.h>
#include <linux/mutex.h>
#include <linux/mutex.h>
#include <linux/idr.h>
#include <linux/idr.h>
#include <linux/ratelimit.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>


#include <linux/dlm.h>
#include <linux/dlm.h>
@@ -74,6 +75,13 @@ do { \
		       (ls)->ls_name , ##args); \
		       (ls)->ls_name , ##args); \
} while (0)
} while (0)


#define log_limit(ls, fmt, args...) \
do { \
	if (dlm_config.ci_log_debug) \
		printk_ratelimited(KERN_DEBUG "dlm: %s: " fmt "\n", \
			(ls)->ls_name , ##args); \
} while (0)

#define DLM_ASSERT(x, do) \
#define DLM_ASSERT(x, do) \
{ \
{ \
  if (!(x)) \
  if (!(x)) \
@@ -263,6 +271,8 @@ struct dlm_lkb {
	ktime_t			lkb_last_cast_time;	/* for debugging */
	ktime_t			lkb_last_cast_time;	/* for debugging */
	ktime_t			lkb_last_bast_time;	/* for debugging */
	ktime_t			lkb_last_bast_time;	/* for debugging */


	uint64_t		lkb_recover_seq; /* from ls_recover_seq */

	char			*lkb_lvbptr;
	char			*lkb_lvbptr;
	struct dlm_lksb		*lkb_lksb;      /* caller's status block */
	struct dlm_lksb		*lkb_lksb;      /* caller's status block */
	void			(*lkb_astfn) (void *astparam);
	void			(*lkb_astfn) (void *astparam);
@@ -317,7 +327,7 @@ enum rsb_flags {
	RSB_NEW_MASTER,
	RSB_NEW_MASTER,
	RSB_NEW_MASTER2,
	RSB_NEW_MASTER2,
	RSB_RECOVER_CONVERT,
	RSB_RECOVER_CONVERT,
	RSB_LOCKS_PURGED,
	RSB_RECOVER_GRANT,
};
};


static inline void rsb_set_flag(struct dlm_rsb *r, enum rsb_flags flag)
static inline void rsb_set_flag(struct dlm_rsb *r, enum rsb_flags flag)
@@ -563,6 +573,7 @@ struct dlm_ls {
	struct mutex		ls_requestqueue_mutex;
	struct mutex		ls_requestqueue_mutex;
	struct dlm_rcom		*ls_recover_buf;
	struct dlm_rcom		*ls_recover_buf;
	int			ls_recover_nodeid; /* for debugging */
	int			ls_recover_nodeid; /* for debugging */
	unsigned int		ls_recover_locks_in; /* for log info */
	uint64_t		ls_rcom_seq;
	uint64_t		ls_rcom_seq;
	spinlock_t		ls_rcom_spin;
	spinlock_t		ls_rcom_spin;
	struct list_head	ls_recover_list;
	struct list_head	ls_recover_list;
@@ -589,6 +600,7 @@ struct dlm_ls {
#define LSFL_UEVENT_WAIT	5
#define LSFL_UEVENT_WAIT	5
#define LSFL_TIMEWARN		6
#define LSFL_TIMEWARN		6
#define LSFL_CB_DELAY		7
#define LSFL_CB_DELAY		7
#define LSFL_NODIR		8


/* much of this is just saving user space pointers associated with the
/* much of this is just saving user space pointers associated with the
   lock that we pass back to the user lib with an ast */
   lock that we pass back to the user lib with an ast */
@@ -636,7 +648,7 @@ static inline int dlm_recovery_stopped(struct dlm_ls *ls)


static inline int dlm_no_directory(struct dlm_ls *ls)
static inline int dlm_no_directory(struct dlm_ls *ls)
{
{
	return (ls->ls_exflags & DLM_LSFL_NODIR) ? 1 : 0;
	return test_bit(LSFL_NODIR, &ls->ls_flags);
}
}


int dlm_netlink_init(void);
int dlm_netlink_init(void);
+371 −170

File changed.

Preview size limit exceeded, changes collapsed.

+4 −3
Original line number Original line Diff line number Diff line
@@ -15,7 +15,8 @@


void dlm_dump_rsb(struct dlm_rsb *r);
void dlm_dump_rsb(struct dlm_rsb *r);
void dlm_print_lkb(struct dlm_lkb *lkb);
void dlm_print_lkb(struct dlm_lkb *lkb);
void dlm_receive_message_saved(struct dlm_ls *ls, struct dlm_message *ms);
void dlm_receive_message_saved(struct dlm_ls *ls, struct dlm_message *ms,
			       uint32_t saved_seq);
void dlm_receive_buffer(union dlm_packet *p, int nodeid);
void dlm_receive_buffer(union dlm_packet *p, int nodeid);
int dlm_modes_compat(int mode1, int mode2);
int dlm_modes_compat(int mode1, int mode2);
void dlm_put_rsb(struct dlm_rsb *r);
void dlm_put_rsb(struct dlm_rsb *r);
@@ -31,9 +32,9 @@ void dlm_adjust_timeouts(struct dlm_ls *ls);
int dlm_search_rsb_tree(struct rb_root *tree, char *name, int len,
int dlm_search_rsb_tree(struct rb_root *tree, char *name, int len,
			unsigned int flags, struct dlm_rsb **r_ret);
			unsigned int flags, struct dlm_rsb **r_ret);


int dlm_purge_locks(struct dlm_ls *ls);
void dlm_recover_purge(struct dlm_ls *ls);
void dlm_purge_mstcpy_locks(struct dlm_rsb *r);
void dlm_purge_mstcpy_locks(struct dlm_rsb *r);
void dlm_grant_after_purge(struct dlm_ls *ls);
void dlm_recover_grant(struct dlm_ls *ls);
int dlm_recover_waiters_post(struct dlm_ls *ls);
int dlm_recover_waiters_post(struct dlm_ls *ls);
void dlm_recover_waiters_pre(struct dlm_ls *ls);
void dlm_recover_waiters_pre(struct dlm_ls *ls);
int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
+20 −0
Original line number Original line Diff line number Diff line
@@ -74,6 +74,19 @@ static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len)
	return len;
	return len;
}
}


static ssize_t dlm_nodir_show(struct dlm_ls *ls, char *buf)
{
	return snprintf(buf, PAGE_SIZE, "%u\n", dlm_no_directory(ls));
}

static ssize_t dlm_nodir_store(struct dlm_ls *ls, const char *buf, size_t len)
{
	int val = simple_strtoul(buf, NULL, 0);
	if (val == 1)
		set_bit(LSFL_NODIR, &ls->ls_flags);
	return len;
}

static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf)
static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf)
{
{
	uint32_t status = dlm_recover_status(ls);
	uint32_t status = dlm_recover_status(ls);
@@ -107,6 +120,12 @@ static struct dlm_attr dlm_attr_id = {
	.store = dlm_id_store
	.store = dlm_id_store
};
};


static struct dlm_attr dlm_attr_nodir = {
	.attr  = {.name = "nodir", .mode = S_IRUGO | S_IWUSR},
	.show  = dlm_nodir_show,
	.store = dlm_nodir_store
};

static struct dlm_attr dlm_attr_recover_status = {
static struct dlm_attr dlm_attr_recover_status = {
	.attr  = {.name = "recover_status", .mode = S_IRUGO},
	.attr  = {.name = "recover_status", .mode = S_IRUGO},
	.show  = dlm_recover_status_show
	.show  = dlm_recover_status_show
@@ -121,6 +140,7 @@ static struct attribute *dlm_attrs[] = {
	&dlm_attr_control.attr,
	&dlm_attr_control.attr,
	&dlm_attr_event.attr,
	&dlm_attr_event.attr,
	&dlm_attr_id.attr,
	&dlm_attr_id.attr,
	&dlm_attr_nodir.attr,
	&dlm_attr_recover_status.attr,
	&dlm_attr_recover_status.attr,
	&dlm_attr_recover_nodeid.attr,
	&dlm_attr_recover_nodeid.attr,
	NULL,
	NULL,
Loading