Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
  ocfs2: remove redundant NULL checks in ocfs2_direct_IO_get_blocks()
  ocfs2: clean up some osb fields
  ocfs2: fix init of uuid_net_key
  ocfs2: silence a debug print
  ocfs2: silence ENOENT during lookup of broken links
  ocfs2: Cleanup message prints
  ocfs2: silence -EEXIST from ocfs2_extent_map_insert/lookup
  [PATCH] fs/ocfs2/dlm/dlmrecovery.c: make dlm_lockres_master_requery() static
  ocfs2: warn the user on a dead timeout mismatch
  ocfs2: OCFS2_FS must depend on SYSFS
  ocfs2: Compile-time disabling of ocfs2 debugging output.
  configfs: Clear up a few extra spaces where there should be TABs.
  configfs: Release memory in configfs_example.
  • Loading branch information
Linus Torvalds committed Jun 30, 2006
2 parents 74e651f + 184d7d2 commit 501b7c7
Show file tree
Hide file tree
Showing 21 changed files with 131 additions and 97 deletions.
19 changes: 15 additions & 4 deletions Documentation/filesystems/configfs/configfs_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ static struct config_item_type simple_child_type = {
};


struct simple_children {
struct config_group group;
};

static inline struct simple_children *to_simple_children(struct config_item *item)
{
return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
}

static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
{
struct simple_child *simple_child;
Expand Down Expand Up @@ -304,7 +313,13 @@ static ssize_t simple_children_attr_show(struct config_item *item,
"items have only one attribute that is readable and writeable.\n");
}

static void simple_children_release(struct config_item *item)
{
kfree(to_simple_children(item));
}

static struct configfs_item_operations simple_children_item_ops = {
.release = simple_children_release,
.show_attribute = simple_children_attr_show,
};

Expand Down Expand Up @@ -345,10 +360,6 @@ static struct configfs_subsystem simple_children_subsys = {
* children of its own.
*/

struct simple_children {
struct config_group group;
};

static struct config_group *group_children_make_group(struct config_group *group, const char *name)
{
struct simple_children *simple_children;
Expand Down
12 changes: 11 additions & 1 deletion fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ source "fs/xfs/Kconfig"

config OCFS2_FS
tristate "OCFS2 file system support (EXPERIMENTAL)"
depends on NET && EXPERIMENTAL
depends on NET && SYSFS && EXPERIMENTAL
select CONFIGFS_FS
select JBD
select CRC32
Expand Down Expand Up @@ -356,6 +356,16 @@ config OCFS2_FS
- POSIX ACLs
- readpages / writepages (not user visible)

config OCFS2_DEBUG_MASKLOG
bool "OCFS2 logging support"
depends on OCFS2_FS
default y
help
The ocfs2 filesystem has an extensive logging system. The system
allows selection of events to log via files in /sys/o2cb/logmask/.
This option will enlarge your kernel, but it allows debugging of
ocfs2 filesystem issues.

config MINIX_FS
tristate "Minix fs support"
help
Expand Down
6 changes: 3 additions & 3 deletions fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static void remove_dir(struct dentry * d)
struct configfs_dirent * sd;

sd = d->d_fsdata;
list_del_init(&sd->s_sibling);
list_del_init(&sd->s_sibling);
configfs_put(sd);
if (d->d_inode)
simple_rmdir(parent->d_inode,d);
Expand Down Expand Up @@ -330,7 +330,7 @@ static int configfs_detach_prep(struct dentry *dentry)

ret = configfs_detach_prep(sd->s_dentry);
if (!ret)
continue;
continue;
} else
ret = -ENOTEMPTY;

Expand Down Expand Up @@ -931,7 +931,7 @@ int configfs_rename_dir(struct config_item * item, const char *new_name)

new_dentry = lookup_one_len(new_name, parent, strlen(new_name));
if (!IS_ERR(new_dentry)) {
if (!new_dentry->d_inode) {
if (!new_dentry->d_inode) {
error = config_item_set_name(item, "%s", new_name);
if (!error) {
d_add(new_dentry, NULL);
Expand Down
2 changes: 1 addition & 1 deletion fs/configfs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void fill_item_path(struct config_item * item, char * buffer, int length)
}

static int create_link(struct config_item *parent_item,
struct config_item *item,
struct config_item *item,
struct dentry *dentry)
{
struct configfs_dirent *target_sd = item->ci_dentry->d_fsdata;
Expand Down
9 changes: 1 addition & 8 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,16 +558,9 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock,
u64 vbo_max; /* file offset, max_blocks from iblock */
u64 p_blkno;
int contig_blocks;
unsigned char blocksize_bits;
unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits;
unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits;

if (!inode || !bh_result) {
mlog(ML_ERROR, "inode or bh_result is null\n");
return -EIO;
}

blocksize_bits = inode->i_sb->s_blocksize_bits;

/* This function won't even be called if the request isn't all
* nicely aligned and of the right size, so there's no need
* for us to check any of that. */
Expand Down
20 changes: 20 additions & 0 deletions fs/ocfs2/cluster/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ static inline void o2hb_prepare_block(struct o2hb_region *reg,
hb_block->hb_seq = cpu_to_le64(cputime);
hb_block->hb_node = node_num;
hb_block->hb_generation = cpu_to_le64(generation);
hb_block->hb_dead_ms = cpu_to_le32(o2hb_dead_threshold * O2HB_REGION_TIMEOUT_MS);

/* This step must always happen last! */
hb_block->hb_cksum = cpu_to_le32(o2hb_compute_block_crc_le(reg,
Expand Down Expand Up @@ -645,6 +646,8 @@ static int o2hb_check_slot(struct o2hb_region *reg,
struct o2nm_node *node;
struct o2hb_disk_heartbeat_block *hb_block = reg->hr_tmp_block;
u64 cputime;
unsigned int dead_ms = o2hb_dead_threshold * O2HB_REGION_TIMEOUT_MS;
unsigned int slot_dead_ms;

memcpy(hb_block, slot->ds_raw_block, reg->hr_block_bytes);

Expand Down Expand Up @@ -733,6 +736,23 @@ static int o2hb_check_slot(struct o2hb_region *reg,
&o2hb_live_slots[slot->ds_node_num]);

slot->ds_equal_samples = 0;

/* We want to be sure that all nodes agree on the
* number of milliseconds before a node will be
* considered dead. The self-fencing timeout is
* computed from this value, and a discrepancy might
* result in heartbeat calling a node dead when it
* hasn't self-fenced yet. */
slot_dead_ms = le32_to_cpu(hb_block->hb_dead_ms);
if (slot_dead_ms && slot_dead_ms != dead_ms) {
/* TODO: Perhaps we can fail the region here. */
mlog(ML_ERROR, "Node %d on device %s has a dead count "
"of %u ms, but our count is %u ms.\n"
"Please double check your configuration values "
"for 'O2CB_HEARTBEAT_THRESHOLD'\n",
slot->ds_node_num, reg->hr_dev_name, slot_dead_ms,
dead_ms);
}
goto out;
}

Expand Down
22 changes: 21 additions & 1 deletion fs/ocfs2/cluster/masklog.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@
#define MLOG_MASK_PREFIX 0
#endif

/*
* When logging is disabled, force the bit test to 0 for anything other
* than errors and notices, allowing gcc to remove the code completely.
* When enabled, allow all masks.
*/
#if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
#define ML_ALLOWED_BITS ~0
#else
#define ML_ALLOWED_BITS (ML_ERROR|ML_NOTICE)
#endif

#define MLOG_MAX_BITS 64

struct mlog_bits {
Expand Down Expand Up @@ -187,7 +198,8 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;

#define mlog(mask, fmt, args...) do { \
u64 __m = MLOG_MASK_PREFIX | (mask); \
if (__mlog_test_u64(__m, mlog_and_bits) && \
if ((__m & ML_ALLOWED_BITS) && \
__mlog_test_u64(__m, mlog_and_bits) && \
!__mlog_test_u64(__m, mlog_not_bits)) { \
if (__m & ML_ERROR) \
__mlog_printk(KERN_ERR, "ERROR: "fmt , ##args); \
Expand All @@ -204,6 +216,7 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
mlog(ML_ERROR, "status = %lld\n", (long long)_st); \
} while (0)

#if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
#define mlog_entry(fmt, args...) do { \
mlog(ML_ENTRY, "ENTRY:" fmt , ##args); \
} while (0)
Expand Down Expand Up @@ -247,6 +260,13 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
#define mlog_exit_void() do { \
mlog(ML_EXIT, "EXIT\n"); \
} while (0)
#else
#define mlog_entry(...) do { } while (0)
#define mlog_entry_void(...) do { } while (0)
#define mlog_exit(...) do { } while (0)
#define mlog_exit_ptr(...) do { } while (0)
#define mlog_exit_void(...) do { } while (0)
#endif /* defined(CONFIG_OCFS2_DEBUG_MASKLOG) */

#define mlog_bug_on_msg(cond, fmt, args...) do { \
if (cond) { \
Expand Down
1 change: 1 addition & 0 deletions fs/ocfs2/cluster/ocfs2_heartbeat.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct o2hb_disk_heartbeat_block {
__u8 hb_pad1[3];
__le32 hb_cksum;
__le64 hb_generation;
__le32 hb_dead_ms;
};

#endif /* _OCFS2_HEARTBEAT_H */
14 changes: 7 additions & 7 deletions fs/ocfs2/cluster/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ static void o2net_set_nn_state(struct o2net_node *nn,
}

if (was_valid && !valid) {
mlog(ML_NOTICE, "no longer connected to " SC_NODEF_FMT "\n",
SC_NODEF_ARGS(old_sc));
printk(KERN_INFO "o2net: no longer connected to "
SC_NODEF_FMT "\n", SC_NODEF_ARGS(old_sc));
o2net_complete_nodes_nsw(nn);
}

Expand All @@ -409,10 +409,10 @@ static void o2net_set_nn_state(struct o2net_node *nn,
* the only way to start connecting again is to down
* heartbeat and bring it back up. */
cancel_delayed_work(&nn->nn_connect_expired);
mlog(ML_NOTICE, "%s " SC_NODEF_FMT "\n",
o2nm_this_node() > sc->sc_node->nd_num ?
"connected to" : "accepted connection from",
SC_NODEF_ARGS(sc));
printk(KERN_INFO "o2net: %s " SC_NODEF_FMT "\n",
o2nm_this_node() > sc->sc_node->nd_num ?
"connected to" : "accepted connection from",
SC_NODEF_ARGS(sc));
}

/* trigger the connecting worker func as long as we're not valid,
Expand Down Expand Up @@ -1280,7 +1280,7 @@ static void o2net_idle_timer(unsigned long data)

do_gettimeofday(&now);

mlog(ML_NOTICE, "connection to " SC_NODEF_FMT " has been idle for 10 "
printk(KERN_INFO "o2net: connection to " SC_NODEF_FMT " has been idle for 10 "
"seconds, shutting it down.\n", SC_NODEF_ARGS(sc));
mlog(ML_NOTICE, "here are some times that might help debug the "
"situation: (tmr %ld.%ld now %ld.%ld dr %ld.%ld adv "
Expand Down
6 changes: 2 additions & 4 deletions fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,9 @@ int ocfs2_find_files_on_disk(const char *name,
struct ocfs2_dir_entry **dirent)
{
int status = -ENOENT;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);

mlog_entry("(osb=%p, parent=%llu, name='%.*s', blkno=%p, inode=%p)\n",
osb, (unsigned long long)OCFS2_I(inode)->ip_blkno,
namelen, name, blkno, inode);
mlog_entry("(name=%.*s, blkno=%p, inode=%p, dirent_bh=%p, dirent=%p)\n",
namelen, name, blkno, inode, dirent_bh, dirent);

*dirent_bh = ocfs2_find_entry(name, namelen, inode, dirent);
if (!*dirent_bh || !*dirent) {
Expand Down
2 changes: 0 additions & 2 deletions fs/ocfs2/dlm/dlmcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,6 @@ int dlm_begin_reco_handler(struct o2net_msg *msg, u32 len, void *data);
int dlm_finalize_reco_handler(struct o2net_msg *msg, u32 len, void *data);
int dlm_do_master_requery(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
u8 nodenum, u8 *real_master);
int dlm_lockres_master_requery(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res, u8 *real_master);


int dlm_dispatch_assert_master(struct dlm_ctxt *dlm,
Expand Down
9 changes: 6 additions & 3 deletions fs/ocfs2/dlm/dlmdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,13 @@ static void __dlm_print_nodes(struct dlm_ctxt *dlm)

assert_spin_locked(&dlm->spinlock);

mlog(ML_NOTICE, "Nodes in my domain (\"%s\"):\n", dlm->name);
printk(KERN_INFO "ocfs2_dlm: Nodes in domain (\"%s\"): ", dlm->name);

while ((node = find_next_bit(dlm->domain_map, O2NM_MAX_NODES,
node + 1)) < O2NM_MAX_NODES) {
mlog(ML_NOTICE, " node %d\n", node);
printk("%d ", node);
}
printk("\n");
}

static int dlm_exit_domain_handler(struct o2net_msg *msg, u32 len, void *data)
Expand All @@ -429,7 +430,7 @@ static int dlm_exit_domain_handler(struct o2net_msg *msg, u32 len, void *data)

node = exit_msg->node_idx;

mlog(0, "Node %u leaves domain %s\n", node, dlm->name);
printk(KERN_INFO "ocfs2_dlm: Node %u leaves domain %s\n", node, dlm->name);

spin_lock(&dlm->spinlock);
clear_bit(node, dlm->domain_map);
Expand Down Expand Up @@ -678,6 +679,8 @@ static int dlm_assert_joined_handler(struct o2net_msg *msg, u32 len, void *data)
set_bit(assert->node_idx, dlm->domain_map);
__dlm_set_joining_node(dlm, DLM_LOCK_RES_OWNER_UNKNOWN);

printk(KERN_INFO "ocfs2_dlm: Node %u joins domain %s\n",
assert->node_idx, dlm->name);
__dlm_print_nodes(dlm);

/* notify anything attached to the heartbeat events */
Expand Down
8 changes: 6 additions & 2 deletions fs/ocfs2/dlm/dlmrecovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ static void dlm_reco_unlock_ast(void *astdata, enum dlm_status st);
static void dlm_request_all_locks_worker(struct dlm_work_item *item,
void *data);
static void dlm_mig_lockres_worker(struct dlm_work_item *item, void *data);
static int dlm_lockres_master_requery(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res,
u8 *real_master);

static u64 dlm_get_next_mig_cookie(void);

Expand Down Expand Up @@ -1484,8 +1487,9 @@ static void dlm_mig_lockres_worker(struct dlm_work_item *item, void *data)



int dlm_lockres_master_requery(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res, u8 *real_master)
static int dlm_lockres_master_requery(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res,
u8 *real_master)
{
struct dlm_node_iter iter;
int nodenum;
Expand Down
3 changes: 1 addition & 2 deletions fs/ocfs2/dlmglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,8 +2071,7 @@ int ocfs2_dlm_init(struct ocfs2_super *osb)
}

/* launch vote thread */
osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote-%d",
osb->osb_id);
osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote");
if (IS_ERR(osb->vote_task)) {
status = PTR_ERR(osb->vote_task);
osb->vote_task = NULL;
Expand Down
Loading

0 comments on commit 501b7c7

Please sign in to comment.