diff options
Diffstat (limited to 'fs/ocfs2')
31 files changed, 772 insertions, 507 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 6b9812db377..edaab05a93e 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -566,9 +566,8 @@ static int ocfs2_do_insert_extent(struct ocfs2_super *osb, next_free = le16_to_cpu(el->l_next_free_rec); if (next_free == 0) { ocfs2_error(inode->i_sb, - "Dinode %"MLFu64" has a bad " - "extent list", - OCFS2_I(inode)->ip_blkno); + "Dinode %llu has a bad extent list", + (unsigned long long)OCFS2_I(inode)->ip_blkno); status = -EIO; goto bail; } @@ -611,9 +610,8 @@ static int ocfs2_do_insert_extent(struct ocfs2_super *osb, next_free = le16_to_cpu(el->l_next_free_rec); if (next_free == 0) { ocfs2_error(inode->i_sb, - "Dinode %"MLFu64" has a bad " - "extent list", - OCFS2_I(inode)->ip_blkno); + "Dinode %llu has a bad extent list", + (unsigned long long)OCFS2_I(inode)->ip_blkno); status = -EIO; goto bail; } @@ -652,8 +650,9 @@ static int ocfs2_do_insert_extent(struct ocfs2_super *osb, /* having an empty extent at eof is legal. */ if (el->l_recs[i].e_cpos != fe->i_clusters) { ocfs2_error(inode->i_sb, - "Dinode %"MLFu64" trailing extent is bad: " + "Dinode %llu trailing extent is bad: " "cpos (%u) != number of clusters (%u)", + (unsigned long long)OCFS2_I(inode)->ip_blkno, le32_to_cpu(el->l_recs[i].e_cpos), le32_to_cpu(fe->i_clusters)); status = -EIO; @@ -747,19 +746,19 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb, while(le16_to_cpu(el->l_tree_depth) > 1) { if (le16_to_cpu(el->l_next_free_rec) == 0) { - ocfs2_error(inode->i_sb, "Dinode %"MLFu64" has empty " + ocfs2_error(inode->i_sb, "Dinode %llu has empty " "extent list (next_free_rec == 0)", - OCFS2_I(inode)->ip_blkno); + (unsigned long long)OCFS2_I(inode)->ip_blkno); status = -EIO; goto bail; } i = le16_to_cpu(el->l_next_free_rec) - 1; blkno = le64_to_cpu(el->l_recs[i].e_blkno); if (!blkno) { - ocfs2_error(inode->i_sb, "Dinode %"MLFu64" has extent " + ocfs2_error(inode->i_sb, "Dinode %llu has extent " "list where extent # %d has no physical " "block start", - OCFS2_I(inode)->ip_blkno, i); + (unsigned long long)OCFS2_I(inode)->ip_blkno, i); status = -EIO; goto bail; } @@ -826,9 +825,9 @@ int ocfs2_insert_extent(struct ocfs2_super *osb, mlog_entry_void(); - mlog(0, "add %u clusters starting at block %"MLFu64" to " - "inode %"MLFu64"\n", - new_clusters, start_blk, OCFS2_I(inode)->ip_blkno); + mlog(0, "add %u clusters starting at block %llu to inode %llu\n", + new_clusters, (unsigned long long)start_blk, + (unsigned long long)OCFS2_I(inode)->ip_blkno); fe = (struct ocfs2_dinode *) fe_bh->b_data; el = &fe->id2.i_list; @@ -963,8 +962,8 @@ static int ocfs2_truncate_log_append(struct ocfs2_super *osb, struct ocfs2_dinode *di; struct ocfs2_truncate_log *tl; - mlog_entry("start_blk = %"MLFu64", num_clusters = %u\n", start_blk, - num_clusters); + mlog_entry("start_blk = %llu, num_clusters = %u\n", + (unsigned long long)start_blk, num_clusters); BUG_ON(mutex_trylock(&tl_inode->i_mutex)); @@ -981,8 +980,9 @@ static int ocfs2_truncate_log_append(struct ocfs2_super *osb, tl_count = le16_to_cpu(tl->tl_count); mlog_bug_on_msg(tl_count > ocfs2_truncate_recs_per_inode(osb->sb) || tl_count == 0, - "Truncate record count on #%"MLFu64" invalid (" - "wanted %u, actual %u\n", OCFS2_I(tl_inode)->ip_blkno, + "Truncate record count on #%llu invalid " + "wanted %u, actual %u\n", + (unsigned long long)OCFS2_I(tl_inode)->ip_blkno, ocfs2_truncate_recs_per_inode(osb->sb), le16_to_cpu(tl->tl_count)); @@ -1002,8 +1002,8 @@ static int ocfs2_truncate_log_append(struct ocfs2_super *osb, } mlog(0, "Log truncate of %u clusters starting at cluster %u to " - "%"MLFu64" (index = %d)\n", num_clusters, start_cluster, - OCFS2_I(tl_inode)->ip_blkno, index); + "%llu (index = %d)\n", num_clusters, start_cluster, + (unsigned long long)OCFS2_I(tl_inode)->ip_blkno, index); if (ocfs2_truncate_log_can_coalesce(tl, start_cluster)) { /* @@ -1134,8 +1134,8 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) } num_to_flush = le16_to_cpu(tl->tl_used); - mlog(0, "Flush %u records from truncate log #%"MLFu64"\n", - num_to_flush, OCFS2_I(tl_inode)->ip_blkno); + mlog(0, "Flush %u records from truncate log #%llu\n", + num_to_flush, (unsigned long long)OCFS2_I(tl_inode)->ip_blkno); if (!num_to_flush) { status = 0; goto bail; @@ -1360,8 +1360,8 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb, tl = &tl_copy->id2.i_dealloc; num_recs = le16_to_cpu(tl->tl_used); - mlog(0, "cleanup %u records from %"MLFu64"\n", num_recs, - tl_copy->i_blkno); + mlog(0, "cleanup %u records from %llu\n", num_recs, + (unsigned long long)tl_copy->i_blkno); mutex_lock(&tl_inode->i_mutex); for(i = 0; i < num_recs; i++) { @@ -1529,7 +1529,8 @@ static int ocfs2_find_new_last_ext_blk(struct ocfs2_super *osb, *new_last_eb = bh; get_bh(*new_last_eb); - mlog(0, "returning block %"MLFu64"\n", le64_to_cpu(eb->h_blkno)); + mlog(0, "returning block %llu\n", + (unsigned long long)le64_to_cpu(eb->h_blkno)); bail: if (bh) brelse(bh); @@ -1646,8 +1647,8 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb, /* if our tree depth > 0, update all the tree blocks below us. */ while (depth) { - mlog(0, "traveling tree (depth = %d, next_eb = %"MLFu64")\n", - depth, next_eb); + mlog(0, "traveling tree (depth = %d, next_eb = %llu)\n", + depth, (unsigned long long)next_eb); status = ocfs2_read_block(osb, next_eb, &eb_bh, OCFS2_BH_CACHED, inode); if (status < 0) { @@ -1674,12 +1675,12 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb, i = le16_to_cpu(el->l_next_free_rec) - 1; - mlog(0, "extent block %"MLFu64", before: record %d: " - "(%u, %u, %"MLFu64"), next = %u\n", - le64_to_cpu(eb->h_blkno), i, + mlog(0, "extent block %llu, before: record %d: " + "(%u, %u, %llu), next = %u\n", + (unsigned long long)le64_to_cpu(eb->h_blkno), i, le32_to_cpu(el->l_recs[i].e_cpos), le32_to_cpu(el->l_recs[i].e_clusters), - le64_to_cpu(el->l_recs[i].e_blkno), + (unsigned long long)le64_to_cpu(el->l_recs[i].e_blkno), le16_to_cpu(el->l_next_free_rec)); BUG_ON(le32_to_cpu(el->l_recs[i].e_clusters) < clusters_to_del); @@ -1697,12 +1698,12 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb, BUG_ON(!el->l_next_free_rec); le16_add_cpu(&el->l_next_free_rec, -1); } - mlog(0, "extent block %"MLFu64", after: record %d: " - "(%u, %u, %"MLFu64"), next = %u\n", - le64_to_cpu(eb->h_blkno), i, + mlog(0, "extent block %llu, after: record %d: " + "(%u, %u, %llu), next = %u\n", + (unsigned long long)le64_to_cpu(eb->h_blkno), i, le32_to_cpu(el->l_recs[i].e_cpos), le32_to_cpu(el->l_recs[i].e_clusters), - le64_to_cpu(el->l_recs[i].e_blkno), + (unsigned long long)le64_to_cpu(el->l_recs[i].e_blkno), le16_to_cpu(el->l_next_free_rec)); status = ocfs2_journal_dirty(handle, eb_bh); @@ -1792,10 +1793,10 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb, last_eb = le64_to_cpu(fe->i_last_eb_blk); start: mlog(0, "ocfs2_commit_truncate: fe->i_clusters = %u, " - "last_eb = %"MLFu64", fe->i_last_eb_blk = %"MLFu64", " + "last_eb = %llu, fe->i_last_eb_blk = %llu, " "fe->id2.i_list.l_tree_depth = %u last_eb_bh = %p\n", - le32_to_cpu(fe->i_clusters), last_eb, - le64_to_cpu(fe->i_last_eb_blk), + le32_to_cpu(fe->i_clusters), (unsigned long long)last_eb, + (unsigned long long)le64_to_cpu(fe->i_last_eb_blk), le16_to_cpu(fe->id2.i_list.l_tree_depth), last_eb_bh); if (last_eb != le64_to_cpu(fe->i_last_eb_blk)) { @@ -1934,16 +1935,17 @@ int ocfs2_prepare_truncate(struct ocfs2_super *osb, fe = (struct ocfs2_dinode *) fe_bh->b_data; mlog(0, "fe->i_clusters = %u, new_i_clusters = %u, fe->i_size =" - "%"MLFu64"\n", fe->i_clusters, new_i_clusters, fe->i_size); + "%llu\n", fe->i_clusters, new_i_clusters, + (unsigned long long)fe->i_size); if (le32_to_cpu(fe->i_clusters) <= new_i_clusters) { - ocfs2_error(inode->i_sb, "Dinode %"MLFu64" has cluster count " - "%u and size %"MLFu64" whereas struct inode has " + ocfs2_error(inode->i_sb, "Dinode %llu has cluster count " + "%u and size %llu whereas struct inode has " "cluster count %u and size %llu which caused an " "invalid truncate to %u clusters.", - le64_to_cpu(fe->i_blkno), + (unsigned long long)le64_to_cpu(fe->i_blkno), le32_to_cpu(fe->i_clusters), - le64_to_cpu(fe->i_size), + (unsigned long long)le64_to_cpu(fe->i_size), OCFS2_I(inode)->ip_clusters, i_size_read(inode), new_i_clusters); mlog_meta_lvb(ML_ERROR, &OCFS2_I(inode)->ip_meta_lockres); diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 8f4467a930a..0d858d0b25b 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -74,8 +74,8 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock, fe = (struct ocfs2_dinode *) bh->b_data; if (!OCFS2_IS_VALID_DINODE(fe)) { - mlog(ML_ERROR, "Invalid dinode #%"MLFu64": signature = %.*s\n", - fe->i_blkno, 7, fe->i_signature); + mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n", + (unsigned long long)fe->i_blkno, 7, fe->i_signature); goto bail; } @@ -162,8 +162,8 @@ static int ocfs2_get_block(struct inode *inode, sector_t iblock, NULL); if (err) { mlog(ML_ERROR, "Error %d from get_blocks(0x%p, %llu, 1, " - "%"MLFu64", NULL)\n", err, inode, - (unsigned long long)iblock, p_blkno); + "%llu, NULL)\n", err, inode, (unsigned long long)iblock, + (unsigned long long)p_blkno); goto bail; } @@ -171,13 +171,15 @@ static int ocfs2_get_block(struct inode *inode, sector_t iblock, if (bh_result->b_blocknr == 0) { err = -EIO; - mlog(ML_ERROR, "iblock = %llu p_blkno = %"MLFu64" " - "blkno=(%"MLFu64")\n", (unsigned long long)iblock, - p_blkno, OCFS2_I(inode)->ip_blkno); + mlog(ML_ERROR, "iblock = %llu p_blkno = %llu blkno=(%llu)\n", + (unsigned long long)iblock, + (unsigned long long)p_blkno, + (unsigned long long)OCFS2_I(inode)->ip_blkno); } past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode)); - mlog(0, "Inode %lu, past_eof = %"MLFu64"\n", inode->i_ino, past_eof); + mlog(0, "Inode %lu, past_eof = %llu\n", inode->i_ino, + (unsigned long long)past_eof); if (create && (iblock >= past_eof)) set_buffer_new(bh_result); @@ -538,7 +540,6 @@ bail: * fs_count, map_bh, dio->rw == WRITE); */ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, - unsigned long max_blocks, struct buffer_head *bh_result, int create) { int ret; @@ -546,6 +547,7 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, u64 p_blkno; int contig_blocks; unsigned char 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"); diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c index bae3d7548be..9a24adf9be6 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c @@ -97,8 +97,8 @@ int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr, int i, ignore_cache = 0; struct buffer_head *bh; - mlog_entry("(block=(%"MLFu64"), nr=(%d), flags=%d, inode=%p)\n", - block, nr, flags, inode); + mlog_entry("(block=(%llu), nr=(%d), flags=%d, inode=%p)\n", + (unsigned long long)block, nr, flags, inode); if (osb == NULL || osb->sb == NULL || bhs == NULL) { status = -EINVAL; @@ -143,9 +143,9 @@ int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr, if (flags & OCFS2_BH_CACHED && !ocfs2_buffer_uptodate(inode, bh)) { mlog(ML_UPTODATE, - "bh (%llu), inode %"MLFu64" not uptodate\n", + "bh (%llu), inode %llu not uptodate\n", (unsigned long long)bh->b_blocknr, - OCFS2_I(inode)->ip_blkno); + (unsigned long long)OCFS2_I(inode)->ip_blkno); ignore_cache = 1; } @@ -222,7 +222,8 @@ int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr, if (inode) mutex_unlock(&OCFS2_I(inode)->ip_io_mutex); - mlog(ML_BH_IO, "block=(%"MLFu64"), nr=(%d), cached=%s\n", block, nr, + mlog(ML_BH_IO, "block=(%llu), nr=(%d), cached=%s\n", + (unsigned long long)block, nr, (!(flags & OCFS2_BH_CACHED) || ignore_cache) ? "no" : "yes"); bail: diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index d08971d29b6..bff0f0d0686 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -449,11 +449,11 @@ static u32 o2hb_compute_block_crc_le(struct o2hb_region *reg, static void o2hb_dump_slot(struct o2hb_disk_heartbeat_block *hb_block) { - mlog(ML_ERROR, "Dump slot information: seq = 0x%"MLFx64", node = %u, " - "cksum = 0x%x, generation 0x%"MLFx64"\n", - le64_to_cpu(hb_block->hb_seq), hb_block->hb_node, - le32_to_cpu(hb_block->hb_cksum), - le64_to_cpu(hb_block->hb_generation)); + mlog(ML_ERROR, "Dump slot information: seq = 0x%llx, node = %u, " + "cksum = 0x%x, generation 0x%llx\n", + (long long)le64_to_cpu(hb_block->hb_seq), + hb_block->hb_node, le32_to_cpu(hb_block->hb_cksum), + (long long)le64_to_cpu(hb_block->hb_generation)); } static int o2hb_verify_crc(struct o2hb_region *reg, @@ -516,8 +516,9 @@ static inline void o2hb_prepare_block(struct o2hb_region *reg, hb_block->hb_cksum = cpu_to_le32(o2hb_compute_block_crc_le(reg, hb_block)); - mlog(ML_HB_BIO, "our node generation = 0x%"MLFx64", cksum = 0x%x\n", - cpu_to_le64(generation), le32_to_cpu(hb_block->hb_cksum)); + mlog(ML_HB_BIO, "our node generation = 0x%llx, cksum = 0x%x\n", + (long long)cpu_to_le64(generation), + le32_to_cpu(hb_block->hb_cksum)); } static void o2hb_fire_callbacks(struct o2hb_callback *hbcall, @@ -686,19 +687,20 @@ static int o2hb_check_slot(struct o2hb_region *reg, if (slot->ds_last_generation != le64_to_cpu(hb_block->hb_generation)) { gen_changed = 1; slot->ds_equal_samples = 0; - mlog(ML_HEARTBEAT, "Node %d changed generation (0x%"MLFx64" " - "to 0x%"MLFx64")\n", slot->ds_node_num, - slot->ds_last_generation, - le64_to_cpu(hb_block->hb_generation)); + mlog(ML_HEARTBEAT, "Node %d changed generation (0x%llx " + "to 0x%llx)\n", slot->ds_node_num, + (long long)slot->ds_last_generation, + (long long)le64_to_cpu(hb_block->hb_generation)); } slot->ds_last_generation = le64_to_cpu(hb_block->hb_generation); - mlog(ML_HEARTBEAT, "Slot %d gen 0x%"MLFx64" cksum 0x%x " - "seq %"MLFu64" last %"MLFu64" changed %u equal %u\n", - slot->ds_node_num, slot->ds_last_generation, - le32_to_cpu(hb_block->hb_cksum), le64_to_cpu(hb_block->hb_seq), - slot->ds_last_time, slot->ds_changed_samples, + mlog(ML_HEARTBEAT, "Slot %d gen 0x%llx cksum 0x%x " + "seq %llu last %llu changed %u equal %u\n", + slot->ds_node_num, (long long)slot->ds_last_generation, + le32_to_cpu(hb_block->hb_cksum), + (unsigned long long)le64_to_cpu(hb_block->hb_seq), + (unsigned long long)slot->ds_last_time, slot->ds_changed_samples, slot->ds_equal_samples); spin_lock(&o2hb_live_lock); @@ -708,8 +710,8 @@ fire_callbacks: * changes at any time during their dead time */ if (list_empty(&slot->ds_live_item) && slot->ds_changed_samples >= O2HB_LIVE_THRESHOLD) { - mlog(ML_HEARTBEAT, "Node %d (id 0x%"MLFx64") joined my " - "region\n", slot->ds_node_num, slot->ds_last_generation); + mlog(ML_HEARTBEAT, "Node %d (id 0x%llx) joined my region\n", + slot->ds_node_num, (long long)slot->ds_last_generation); /* first on the list generates a callback */ if (list_empty(&o2hb_live_slots[slot->ds_node_num])) { diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h index 2cadc3009c8..73edad78253 100644 --- a/fs/ocfs2/cluster/masklog.h +++ b/fs/ocfs2/cluster/masklog.h @@ -256,16 +256,6 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits; } \ } while (0) -#if (BITS_PER_LONG == 32) || defined(CONFIG_X86_64) || (defined(CONFIG_UML_X86) && defined(CONFIG_64BIT)) -#define MLFi64 "lld" -#define MLFu64 "llu" -#define MLFx64 "llx" -#else -#define MLFi64 "ld" -#define MLFu64 "lu" -#define MLFx64 "lx" -#endif - #include <linux/kobject.h> #include <linux/sysfs.h> int mlog_sys_init(struct subsystem *o2cb_subsys); diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index bd85182e97b..1a01380e387 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c @@ -64,15 +64,16 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry, /* did we or someone else delete this inode? */ if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) { spin_unlock(&OCFS2_I(inode)->ip_lock); - mlog(0, "inode (%"MLFu64") deleted, returning false\n", - OCFS2_I(inode)->ip_blkno); + mlog(0, "inode (%llu) deleted, returning false\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); goto bail; } spin_unlock(&OCFS2_I(inode)->ip_lock); if (!inode->i_nlink) { - mlog(0, "Inode %"MLFu64" orphaned, returning false " - "dir = %d\n", OCFS2_I(inode)->ip_blkno, + mlog(0, "Inode %llu orphaned, returning false " + "dir = %d\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, S_ISDIR(inode->i_mode)); goto bail; } diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 57158fa75d9..ae47f450792 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -83,7 +83,8 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) struct super_block * sb = inode->i_sb; int have_disk_lock = 0; - mlog_entry("dirino=%"MLFu64"\n", OCFS2_I(inode)->ip_blkno); + mlog_entry("dirino=%llu\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); stored = 0; bh = NULL; @@ -104,9 +105,9 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) blk = (filp->f_pos) >> sb->s_blocksize_bits; bh = ocfs2_bread(inode, blk, &err, 0); if (!bh) { - mlog(ML_ERROR, "directory #%"MLFu64" contains a hole " - "at offset %lld\n", - OCFS2_I(inode)->ip_blkno, + mlog(ML_ERROR, + "directory #%llu contains a hole at offset %lld\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, filp->f_pos); filp->f_pos += sb->s_blocksize - offset; continue; @@ -214,9 +215,9 @@ int ocfs2_find_files_on_disk(const char *name, int status = -ENOENT; struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); - mlog_entry("(osb=%p, parent=%"MLFu64", name='%.*s', blkno=%p, " - "inode=%p)\n", - osb, OCFS2_I(inode)->ip_blkno, namelen, name, blkno, inode); + 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); *dirent_bh = ocfs2_find_entry(name, namelen, inode, dirent); if (!*dirent_bh || !*dirent) { @@ -255,8 +256,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir, struct buffer_head *dirent_bh = NULL; struct ocfs2_dir_entry *dirent = NULL; - mlog_entry("dir %"MLFu64", name '%.*s'\n", OCFS2_I(dir)->ip_blkno, - namelen, name); + mlog_entry("dir %llu, name '%.*s'\n", + (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); ret = -EEXIST; dirent_bh = ocfs2_find_entry(name, namelen, dir, &dirent); @@ -287,9 +288,8 @@ int ocfs2_empty_dir(struct inode *inode) if ((i_size_read(inode) < (OCFS2_DIR_REC_LEN(1) + OCFS2_DIR_REC_LEN(2))) || !(bh = ocfs2_bread(inode, 0, &err, 0))) { - mlog(ML_ERROR, "bad directory (dir #%"MLFu64") - " - "no data block\n", - OCFS2_I(inode)->ip_blkno); + mlog(ML_ERROR, "bad directory (dir #%llu) - no data block\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); return 1; } @@ -300,9 +300,8 @@ int ocfs2_empty_dir(struct inode *inode) !le64_to_cpu(de1->inode) || strcmp(".", de->name) || strcmp("..", de1->name)) { - mlog(ML_ERROR, "bad directory (dir #%"MLFu64") - " - "no `.' or `..'\n", - OCFS2_I(inode)->ip_blkno); + mlog(ML_ERROR, "bad directory (dir #%llu) - no `.' or `..'\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); brelse(bh); return 1; } @@ -314,9 +313,8 @@ int ocfs2_empty_dir(struct inode *inode) bh = ocfs2_bread(inode, offset >> sb->s_blocksize_bits, &err, 0); if (!bh) { - mlog(ML_ERROR, "directory #%"MLFu64" contains " - "a hole at offset %lu\n", - OCFS2_I(inode)->ip_blkno, offset); + mlog(ML_ERROR, "dir %llu has a hole at %lu\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, offset); offset += sb->s_blocksize; continue; } @@ -406,8 +404,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb, mlog_entry_void(); dir_i_size = i_size_read(dir); - mlog(0, "extending dir %"MLFu64" (i_size = %lld)\n", - OCFS2_I(dir)->ip_blkno, dir_i_size); + mlog(0, "extending dir %llu (i_size = %lld)\n", + (unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size); handle = ocfs2_alloc_handle(osb); if (handle == NULL) { @@ -531,8 +529,8 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb, mlog_entry_void(); - mlog(0, "getting ready to insert namelen %d into dir %"MLFu64"\n", - namelen, OCFS2_I(dir)->ip_blkno); + mlog(0, "getting ready to insert namelen %d into dir %llu\n", + namelen, (unsigned long long)OCFS2_I(dir)->ip_blkno); BUG_ON(!S_ISDIR(dir->i_mode)); fe = (struct ocfs2_dinode *) parent_fe_bh->b_data; diff --git a/fs/ocfs2/dlm/dlmast.c b/fs/ocfs2/dlm/dlmast.c index 8d17d28ef91..355593dd8ef 100644 --- a/fs/ocfs2/dlm/dlmast.c +++ b/fs/ocfs2/dlm/dlmast.c @@ -307,8 +307,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data) if (past->type != DLM_AST && past->type != DLM_BAST) { - mlog(ML_ERROR, "Unknown ast type! %d, cookie=%"MLFu64", " - "name=%.*s\n", past->type, cookie, locklen, name); + mlog(ML_ERROR, "Unknown ast type! %d, cookie=%u:%llu" + "name=%.*s\n", past->type, + dlm_get_lock_cookie_node(cookie), + dlm_get_lock_cookie_seq(cookie), + locklen, name); ret = DLM_IVLOCKID; goto leave; } @@ -316,9 +319,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data) res = dlm_lookup_lockres(dlm, name, locklen); if (!res) { mlog(ML_ERROR, "got %sast for unknown lockres! " - "cookie=%"MLFu64", name=%.*s, namelen=%u\n", + "cookie=%u:%llu, name=%.*s, namelen=%u\n", past->type == DLM_AST ? "" : "b", - cookie, locklen, name, locklen); + dlm_get_lock_cookie_node(cookie), + dlm_get_lock_cookie_seq(cookie), + locklen, name, locklen); ret = DLM_IVLOCKID; goto leave; } @@ -360,9 +365,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data) goto do_ast; } - mlog(ML_ERROR, "got %sast for unknown lock! cookie=%"MLFu64", " - "name=%.*s, namelen=%u\n", - past->type == DLM_AST ? "" : "b", cookie, locklen, name, locklen); + mlog(ML_ERROR, "got %sast for unknown lock! cookie=%u:%llu, " + "name=%.*s, namelen=%u\n", + past->type == DLM_AST ? "" : "b", + dlm_get_lock_cookie_node(cookie), + dlm_get_lock_cookie_seq(cookie), + locklen, name, locklen); ret = DLM_NORMAL; unlock_out: diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h index 9c772583744..88cc43df18f 100644 --- a/fs/ocfs2/dlm/dlmcommon.h +++ b/fs/ocfs2/dlm/dlmcommon.h @@ -630,6 +630,21 @@ __dlm_lockres_state_to_status(struct dlm_lock_resource *res) return status; } +static inline u8 dlm_get_lock_cookie_node(u64 cookie) +{ + u8 ret; + cookie >>= 56; + ret = (u8)(cookie & 0xffULL); + return ret; +} + +static inline unsigned long long dlm_get_lock_cookie_seq(u64 cookie) +{ + unsigned long long ret; + ret = ((unsigned long long)cookie) & 0x00ffffffffffffffULL; + return ret; +} + struct dlm_lock * dlm_new_lock(int type, u8 node, u64 cookie, struct dlm_lockstatus *lksb); void dlm_lock_get(struct dlm_lock *lock); @@ -658,6 +673,7 @@ void dlm_complete_thread(struct dlm_ctxt *dlm); int dlm_launch_recovery_thread(struct dlm_ctxt *dlm); void dlm_complete_recovery_thread(struct dlm_ctxt *dlm); void dlm_wait_for_recovery(struct dlm_ctxt *dlm); +void dlm_kick_recovery_thread(struct dlm_ctxt *dlm); int dlm_is_node_dead(struct dlm_ctxt *dlm, u8 node); int dlm_wait_for_node_death(struct dlm_ctxt *dlm, u8 node, int timeout); @@ -762,6 +778,11 @@ int dlm_request_all_locks_handler(struct o2net_msg *msg, u32 len, void *data); int dlm_reco_data_done_handler(struct o2net_msg *msg, u32 len, void *data); 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, struct dlm_lock_resource *res, diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c index f66e2d818cc..8285228d9e3 100644 --- a/fs/ocfs2/dlm/dlmconvert.c +++ b/fs/ocfs2/dlm/dlmconvert.c @@ -284,8 +284,10 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, if (lock->ml.convert_type != LKM_IVMODE) { __dlm_print_one_lock_resource(res); mlog(ML_ERROR, "converting a remote lock that is already " - "converting! (cookie=%"MLFu64", conv=%d)\n", - lock->ml.cookie, lock->ml.convert_type); + "converting! (cookie=%u:%llu, conv=%d)\n", + dlm_get_lock_cookie_node(lock->ml.cookie), + dlm_get_lock_cookie_seq(lock->ml.cookie), + lock->ml.convert_type); status = DLM_DENIED; goto bail; } @@ -513,8 +515,9 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data) leave: if (!lock) mlog(ML_ERROR, "did not find lock to convert on grant queue! " - "cookie=%"MLFu64"\n", - cnv->cookie); + "cookie=%u:%llu\n", + dlm_get_lock_cookie_node(cnv->cookie), + dlm_get_lock_cookie_seq(cnv->cookie)); else dlm_lock_put(lock); diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c index 54f61b76ab5..c7eae5d3324 100644 --- a/fs/ocfs2/dlm/dlmdebug.c +++ b/fs/ocfs2/dlm/dlmdebug.c @@ -72,8 +72,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res) lock = list_entry(iter2, struct dlm_lock, list); spin_lock(&lock->spinlock); mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, " - "cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", - lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, + "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", + lock->ml.type, lock->ml.convert_type, lock->ml.node, + dlm_get_lock_cookie_node(lock->ml.cookie), + dlm_get_lock_cookie_seq(lock->ml.cookie), list_empty(&lock->ast_list) ? 'y' : 'n', lock->ast_pending ? 'y' : 'n', list_empty(&lock->bast_list) ? 'y' : 'n', @@ -85,8 +87,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res) lock = list_entry(iter2, struct dlm_lock, list); spin_lock(&lock->spinlock); mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, " - "cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", - lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, + "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", + lock->ml.type, lock->ml.convert_type, lock->ml.node, + dlm_get_lock_cookie_node(lock->ml.cookie), + dlm_get_lock_cookie_seq(lock->ml.cookie), list_empty(&lock->ast_list) ? 'y' : 'n', lock->ast_pending ? 'y' : 'n', list_empty(&lock->bast_list) ? 'y' : 'n', @@ -98,8 +102,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res) lock = list_entry(iter2, struct dlm_lock, list); spin_lock(&lock->spinlock); mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, " - "cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", - lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, + "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", + lock->ml.type, lock->ml.convert_type, lock->ml.node, + dlm_get_lock_cookie_node(lock->ml.cookie), + dlm_get_lock_cookie_seq(lock->ml.cookie), list_empty(&lock->ast_list) ? 'y' : 'n', lock->ast_pending ? 'y' : 'n', list_empty(&lock->bast_list) ? 'y' : 'n', diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c index dd2d24dc25e..7e88e24b347 100644 --- a/fs/ocfs2/dlm/dlmfs.c +++ b/fs/ocfs2/dlm/dlmfs.c @@ -596,7 +596,8 @@ static int __init init_dlmfs_fs(void) dlmfs_inode_cache = kmem_cache_create("dlmfs_inode_cache", sizeof(struct dlmfs_inode_private), - 0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, + 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| + SLAB_MEM_SPREAD), dlmfs_init_once, NULL); if (!dlmfs_inode_cache) return -ENOMEM; diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c index 671d4ff222c..6fea28318d6 100644 --- a/fs/ocfs2/dlm/dlmlock.c +++ b/fs/ocfs2/dlm/dlmlock.c @@ -141,13 +141,23 @@ static enum dlm_status dlmlock_master(struct dlm_ctxt *dlm, res->lockname.len)) { kick_thread = 1; call_ast = 1; + } else { + mlog(0, "%s: returning DLM_NORMAL to " + "node %u for reco lock\n", dlm->name, + lock->ml.node); } } else { /* for NOQUEUE request, unless we get the * lock right away, return DLM_NOTQUEUED */ - if (flags & LKM_NOQUEUE) + if (flags & LKM_NOQUEUE) { status = DLM_NOTQUEUED; - else { + if (dlm_is_recovery_lock(res->lockname.name, + res->lockname.len)) { + mlog(0, "%s: returning NOTQUEUED to " + "node %u for reco lock\n", dlm->name, + lock->ml.node); + } + } else { dlm_lock_get(lock); list_add_tail(&lock->list, &res->blocked); kick_thread = 1; diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 847dd3cc4cf..940be4c13b1 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c @@ -239,6 +239,8 @@ static void dlm_remove_nonlocal_locks(struct dlm_ctxt *dlm, static int dlm_mark_lockres_migrating(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 target); +static int dlm_pre_master_reco_lockres(struct dlm_ctxt *dlm, + struct dlm_lock_resource *res); int dlm_is_host_down(int errno) @@ -677,6 +679,7 @@ struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm, struct dlm_node_iter iter; unsigned int namelen; int tries = 0; + int bit, wait_on_recovery = 0; BUG_ON(!lockid); @@ -762,6 +765,18 @@ lookup: dlm_init_mle(mle, DLM_MLE_MASTER, dlm, res, NULL, 0); set_bit(dlm->node_num, mle->maybe_map); list_add(&mle->list, &dlm->master_list); + + /* still holding the dlm spinlock, check the recovery map + * to see if there are any nodes that still need to be + * considered. these will not appear in the mle nodemap + * but they might own this lockres. wait on them. */ + bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0); + if (bit < O2NM_MAX_NODES) { + mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to" + "recover before lock mastery can begin\n", + dlm->name, namelen, (char *)lockid, bit); + wait_on_recovery = 1; + } } /* at this point there is either a DLM_MLE_BLOCK or a @@ -779,6 +794,39 @@ lookup: spin_unlock(&dlm->master_lock); spin_unlock(&dlm->spinlock); + while (wait_on_recovery) { + /* any cluster changes that occurred after dropping the + * dlm spinlock would be detectable be a change on the mle, + * so we only need to clear out the recovery map once. */ + if (dlm_is_recovery_lock(lockid, namelen)) { + mlog(ML_NOTICE, "%s: recovery map is not empty, but " + "must master $RECOVERY lock now\n", dlm->name); + if (!dlm_pre_master_reco_lockres(dlm, res)) + wait_on_recovery = 0; + else { + mlog(0, "%s: waiting 500ms for heartbeat state " + "change\n", dlm->name); + msleep(500); + } + continue; + } + + dlm_kick_recovery_thread(dlm); + msleep(100); + dlm_wait_for_recovery(dlm); + + spin_lock(&dlm->spinlock); + bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0); + if (bit < O2NM_MAX_NODES) { + mlog(ML_NOTICE, "%s:%.*s: at least one node (%d) to" + "recover before lock mastery can begin\n", + dlm->name, namelen, (char *)lockid, bit); + wait_on_recovery = 1; + } else + wait_on_recovery = 0; + spin_unlock(&dlm->spinlock); + } + /* must wait for lock to be mastered elsewhere */ if (blocked) goto wait; @@ -792,7 +840,15 @@ redo_request: mlog_errno(ret); if (mle->master != O2NM_MAX_NODES) { /* found a master ! */ - break; + if (mle->master <= nodenum) + break; + /* if our master request has not reached the master + * yet, keep going until it does. this is how the + * master will know that asserts are needed back to + * the lower nodes. */ + mlog(0, "%s:%.*s: requests only up to %u but master " + "is %u, keep going\n", dlm->name, namelen, + lockid, nodenum, mle->master); } } @@ -860,7 +916,19 @@ recheck: /* check if another node has already become the owner */ spin_lock(&res->spinlock); if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) { + mlog(0, "%s:%.*s: owner is suddenly %u\n", dlm->name, + res->lockname.len, res->lockname.name, res->owner); spin_unlock(&res->spinlock); + /* this will cause the master to re-assert across + * the whole cluster, freeing up mles */ + ret = dlm_do_master_request(mle, res->owner); + if (ret < 0) { + /* give recovery a chance to run */ + mlog(ML_ERROR, "link to %u went down?: %d\n", res->owner, ret); + msleep(500); + goto recheck; + } + ret = 0; goto leave; } spin_unlock(&res->spinlock); @@ -1244,13 +1312,14 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data) { u8 response = DLM_MASTER_RESP_MAYBE; struct dlm_ctxt *dlm = data; - struct dlm_lock_resource *res; + struct dlm_lock_resource *res = NULL; struct dlm_master_request *request = (struct dlm_master_request *) msg->buf; struct dlm_master_list_entry *mle = NULL, *tmpmle = NULL; char *name; unsigned int namelen; int found, ret; int set_maybe; + int dispatch_assert = 0; if (!dlm_grab(dlm)) return DLM_MASTER_RESP_NO; @@ -1287,7 +1356,6 @@ way_up_top: } if (res->owner == dlm->node_num) { - u32 flags = DLM_ASSERT_MASTER_MLE_CLEANUP; spin_unlock(&res->spinlock); // mlog(0, "this node is the master\n"); response = DLM_MASTER_RESP_YES; @@ -1300,16 +1368,7 @@ way_up_top: * caused all nodes up to this one to * create mles. this node now needs to * go back and clean those up. */ - mlog(0, "%u is the owner of %.*s, cleaning everyone else\n", - dlm->node_num, res->lockname.len, res->lockname.name); - ret = dlm_dispatch_assert_master(dlm, res, 1, - request->node_idx, - flags); - if (ret < 0) { - mlog(ML_ERROR, "failed to dispatch assert " - "master work\n"); - response = DLM_MASTER_RESP_ERROR; - } + dispatch_assert = 1; goto send_response; } else if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) { spin_unlock(&res->spinlock); @@ -1357,9 +1416,13 @@ way_up_top: } } else if (tmpmle->master != DLM_LOCK_RES_OWNER_UNKNOWN) { set_maybe = 0; - if (tmpmle->master == dlm->node_num) + if (tmpmle->master == dlm->node_num) { response = DLM_MASTER_RESP_YES; - else + /* this node will be the owner. + * go back and clean the mles on any + * other nodes */ + dispatch_assert = 1; + } else response = DLM_MASTER_RESP_NO; } else { // mlog(0, "this node is attempting to " @@ -1398,8 +1461,8 @@ way_up_top: mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache, GFP_KERNEL); if (!mle) { - // bad bad bad... this sucks. response = DLM_MASTER_RESP_ERROR; + mlog_errno(-ENOMEM); goto send_response; } spin_lock(&dlm->spinlock); @@ -1418,25 +1481,19 @@ way_up_top: // mlog(0, "mle was found\n"); set_maybe = 1; spin_lock(&tmpmle->spinlock); + if (tmpmle->master == dlm->node_num) { + mlog(ML_ERROR, "no lockres, but an mle with this node as master!\n"); + BUG(); + } if (tmpmle->type == DLM_MLE_BLOCK) response = DLM_MASTER_RESP_NO; else if (tmpmle->type == DLM_MLE_MIGRATION) { mlog(0, "migration mle was found (%u->%u)\n", tmpmle->master, tmpmle->new_master); - if (tmpmle->master == dlm->node_num) { - mlog(ML_ERROR, "no lockres, but migration mle " - "says that this node is master!\n"); - BUG(); - } /* real master can respond on its own */ response = DLM_MASTER_RESP_NO; - } else { - if (tmpmle->master == dlm->node_num) { - response = DLM_MASTER_RESP_YES; - set_maybe = 0; - } else - response = DLM_MASTER_RESP_MAYBE; - } + } else + response = DLM_MASTER_RESP_MAYBE; if (set_maybe) set_bit(request->node_idx, tmpmle->maybe_map); spin_unlock(&tmpmle->spinlock); @@ -1449,6 +1506,24 @@ way_up_top: dlm_put_mle(tmpmle); } send_response: + + if (dispatch_assert) { + if (response != DLM_MASTER_RESP_YES) + mlog(ML_ERROR, "invalid response %d\n", response); + if (!res) { + mlog(ML_ERROR, "bad lockres while trying to assert!\n"); + BUG(); + } + mlog(0, "%u is the owner of %.*s, cleaning everyone else\n", + dlm->node_num, res->lockname.len, res->lockname.name); + ret = dlm_dispatch_assert_master(dlm, res, 0, request->node_idx, + DLM_ASSERT_MASTER_MLE_CLEANUP); + if (ret < 0) { + mlog(ML_ERROR, "failed to dispatch assert master work\n"); + response = DLM_MASTER_RESP_ERROR; + } + } + dlm_put(dlm); return response; } @@ -1471,8 +1546,11 @@ static int dlm_do_assert_master(struct dlm_ctxt *dlm, const char *lockname, int to, tmpret; struct dlm_node_iter iter; int ret = 0; + int reassert; BUG_ON(namelen > O2NM_MAX_NAME_LEN); +again: + reassert = 0; /* note that if this nodemap is empty, it returns 0 */ dlm_node_iter_init(nodemap, &iter); @@ -1504,9 +1582,17 @@ static int dlm_do_assert_master(struct dlm_ctxt *dlm, const char *lockname, "got %d.\n", namelen, lockname, to, r); dlm_dump_lock_resources(dlm); BUG(); + } else if (r == EAGAIN) { + mlog(0, "%.*s: node %u create mles on other " + "nodes and requests a re-assert\n", + namelen, lockname, to); + reassert = 1; } } + if (reassert) + goto again; + return ret; } @@ -1528,6 +1614,8 @@ int dlm_assert_master_handler(struct o2net_msg *msg, u32 len, void *data) char *name; unsigned int namelen; u32 flags; + int master_request = 0; + int ret = 0; if (!dlm_grab(dlm)) return 0; @@ -1642,11 +1730,22 @@ ok: // mlog(0, "woo! got an assert_master from node %u!\n", // assert->node_idx); if (mle) { - int extra_ref; + int extra_ref = 0; + int nn = -1; spin_lock(&mle->spinlock); - extra_ref = !!(mle->type == DLM_MLE_BLOCK - || mle->type == DLM_MLE_MIGRATION); + if (mle->type == DLM_MLE_BLOCK || mle->type == DLM_MLE_MIGRATION) + extra_ref = 1; + else { + /* MASTER mle: if any bits set in the response map + * then the calling node needs to re-assert to clear + * up nodes that this node contacted */ + while ((nn = find_next_bit (mle->response_map, O2NM_MAX_NODES, + nn+1)) < O2NM_MAX_NODES) { + if (nn != dlm->node_num && nn != assert->node_idx) + master_request = 1; + } + } mle->master = assert->node_idx; atomic_set(&mle->woken, 1); wake_up(&mle->wq); @@ -1677,10 +1776,15 @@ ok: } done: + ret = 0; if (res) dlm_lockres_put(res); dlm_put(dlm); - return 0; + if (master_request) { + mlog(0, "need to tell master to reassert\n"); + ret = EAGAIN; // positive. negative would shoot down the node. + } + return ret; kill: /* kill the caller! */ @@ -1713,6 +1817,10 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm, item->u.am.request_from = request_from; item->u.am.flags = flags; + if (ignore_higher) + mlog(0, "IGNORE HIGHER: %.*s\n", res->lockname.len, + res->lockname.name); + spin_lock(&dlm->work_lock); list_add_tail(&item->list, &dlm->work_list); spin_unlock(&dlm->work_lock); @@ -1775,6 +1883,61 @@ static void dlm_assert_master_worker(struct dlm_work_item *item, void *data) mlog(0, "finished with dlm_assert_master_worker\n"); } +/* SPECIAL CASE for the $RECOVERY lock used by the recovery thread. + * We cannot wait for node recovery to complete to begin mastering this + * lockres because this lockres is used to kick off recovery! ;-) + * So, do a pre-check on all living nodes to see if any of those nodes + * think that $RECOVERY is currently mastered by a dead node. If so, + * we wait a short time to allow that node to get notified by its own + * heartbeat stack, then check again. All $RECOVERY lock resources + * mastered by dead nodes are purged when the hearbeat callback is + * fired, so we can know for sure that it is safe to continue once + * the node returns a live node or no node. */ +static int dlm_pre_master_reco_lockres(struct dlm_ctxt *dlm, + struct dlm_lock_resource *res) +{ + struct dlm_node_iter iter; + int nodenum; + int ret = 0; + u8 master = DLM_LOCK_RES_OWNER_UNKNOWN; + + spin_lock(&dlm->spinlock); + dlm_node_iter_init(dlm->domain_map, &iter); + spin_unlock(&dlm->spinlock); + + while ((nodenum = dlm_node_iter_next(&iter)) >= 0) { + /* do not send to self */ + if (nodenum == dlm->node_num) + continue; + ret = dlm_do_master_requery(dlm, res, nodenum, &master); + if (ret < 0) { + mlog_errno(ret); + if (!dlm_is_host_down(ret)) + BUG(); + /* host is down, so answer for that node would be + * DLM_LOCK_RES_OWNER_UNKNOWN. continue. */ + } + + if (master != DLM_LOCK_RES_OWNER_UNKNOWN) { + /* check to see if this master is in the recovery map */ + spin_lock(&dlm->spinlock); + if (test_bit(master, dlm->recovery_map)) { + mlog(ML_NOTICE, "%s: node %u has not seen " + "node %u go down yet, and thinks the " + "dead node is mastering the recovery " + "lock. must wait.\n", dlm->name, + nodenum, master); + ret = -EAGAIN; + } + spin_unlock(&dlm->spinlock); + mlog(0, "%s: reco lock master is %u\n", dlm->name, + master); + break; + } + } + return ret; +} + /* * DLM_MIGRATE_LOCKRES diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index 1e232000f3f..805cbabac05 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -58,7 +58,7 @@ static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node); static int dlm_recovery_thread(void *data); void dlm_complete_recovery_thread(struct dlm_ctxt *dlm); int dlm_launch_recovery_thread(struct dlm_ctxt *dlm); -static void dlm_kick_recovery_thread(struct dlm_ctxt *dlm); +void dlm_kick_recovery_thread(struct dlm_ctxt *dlm); static int dlm_do_recovery(struct dlm_ctxt *dlm); static int dlm_pick_recovery_master(struct dlm_ctxt *dlm); @@ -78,15 +78,9 @@ static int dlm_send_mig_lockres_msg(struct dlm_ctxt *dlm, u8 send_to, struct dlm_lock_resource *res, int total_locks); -static int dlm_lockres_master_requery(struct dlm_ctxt *dlm, - struct dlm_lock_resource *res, - u8 *real_master); static int dlm_process_recovery_data(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_migratable_lockres *mres); -static int dlm_do_master_requery(struct dlm_ctxt *dlm, - struct dlm_lock_resource *res, - u8 nodenum, u8 *real_master); static int dlm_send_finalize_reco_message(struct dlm_ctxt *dlm); static int dlm_send_all_done_msg(struct dlm_ctxt *dlm, u8 dead_node, u8 send_to); @@ -165,7 +159,7 @@ void dlm_dispatch_work(void *data) * RECOVERY THREAD */ -static void dlm_kick_recovery_thread(struct dlm_ctxt *dlm) +void dlm_kick_recovery_thread(struct dlm_ctxt *dlm) { /* wake the recovery thread * this will wake the reco thread in one of three places @@ -750,10 +744,12 @@ static void dlm_request_all_locks_worker(struct dlm_work_item *item, void *data) dlm->name, dlm->reco.dead_node, dlm->reco.new_master, dead_node, reco_master); mlog(ML_ERROR, "%s: name=%.*s master=%u locks=%u/%u flags=%u " - "entry[0]={c=%"MLFu64",l=%u,f=%u,t=%d,ct=%d,hb=%d,n=%u}\n", + "entry[0]={c=%u:%llu,l=%u,f=%u,t=%d,ct=%d,hb=%d,n=%u}\n", dlm->name, mres->lockname_len, mres->lockname, mres->master, mres->num_locks, mres->total_locks, mres->flags, - mres->ml[0].cookie, mres->ml[0].list, mres->ml[0].flags, + dlm_get_lock_cookie_node(mres->ml[0].cookie), + dlm_get_lock_cookie_seq(mres->ml[0].cookie), + mres->ml[0].list, mres->ml[0].flags, mres->ml[0].type, mres->ml[0].convert_type, mres->ml[0].highest_blocked, mres->ml[0].node); BUG(); @@ -1316,9 +1312,8 @@ leave: -static int dlm_lockres_master_requery(struct dlm_ctxt *dlm, - struct dlm_lock_resource *res, - u8 *real_master) +int dlm_lockres_master_requery(struct dlm_ctxt *dlm, + struct dlm_lock_resource *res, u8 *real_master) { struct dlm_node_iter iter; int nodenum; @@ -1360,8 +1355,10 @@ static int dlm_lockres_master_requery(struct dlm_ctxt *dlm, ret = dlm_do_master_requery(dlm, res, nodenum, real_master); if (ret < 0) { mlog_errno(ret); - BUG(); - /* TODO: need to figure a way to restart this */ + if (!dlm_is_host_down(ret)) + BUG(); + /* host is down, so answer for that node would be + * DLM_LOCK_RES_OWNER_UNKNOWN. continue. */ } if (*real_master != DLM_LOCK_RES_OWNER_UNKNOWN) { mlog(0, "lock master is %u\n", *real_master); @@ -1372,9 +1369,8 @@ static int dlm_lockres_master_requery(struct dlm_ctxt *dlm, } -static int dlm_do_master_requery(struct dlm_ctxt *dlm, - struct dlm_lock_resource *res, - u8 nodenum, u8 *real_master) +int dlm_do_master_requery(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, + u8 nodenum, u8 *real_master) { int ret = -EINVAL; struct dlm_master_requery req; @@ -1519,9 +1515,11 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, /* lock is always created locally first, and * destroyed locally last. it must be on the list */ if (!lock) { + u64 c = ml->cookie; mlog(ML_ERROR, "could not find local lock " - "with cookie %"MLFu64"!\n", - ml->cookie); + "with cookie %u:%llu!\n", + dlm_get_lock_cookie_node(c), + dlm_get_lock_cookie_seq(c)); BUG(); } BUG_ON(lock->ml.node != ml->node); @@ -1739,6 +1737,13 @@ static void dlm_finish_local_lockres_recovery(struct dlm_ctxt *dlm, } else continue; + if (!list_empty(&res->recovering)) { + mlog(0, "%s:%.*s: lockres was " + "marked RECOVERING, owner=%u\n", + dlm->name, res->lockname.len, + res->lockname.name, res->owner); + list_del_init(&res->recovering); + } spin_lock(&res->spinlock); dlm_change_lockres_owner(dlm, res, new_master); res->state &= ~DLM_LOCK_RES_RECOVERING; @@ -2258,7 +2263,10 @@ int dlm_begin_reco_handler(struct o2net_msg *msg, u32 len, void *data) mlog(0, "%u not in domain/live_nodes map " "so setting it in reco map manually\n", br->dead_node); - set_bit(br->dead_node, dlm->recovery_map); + /* force the recovery cleanup in __dlm_hb_node_down + * both of these will be cleared in a moment */ + set_bit(br->dead_node, dlm->domain_map); + set_bit(br->dead_node, dlm->live_nodes_map); __dlm_hb_node_down(dlm, br->dead_node); } spin_unlock(&dlm->spinlock); diff --git a/fs/ocfs2/dlm/dlmunlock.c b/fs/ocfs2/dlm/dlmunlock.c index c95f08d2e92..7b1a2754267 100644 --- a/fs/ocfs2/dlm/dlmunlock.c +++ b/fs/ocfs2/dlm/dlmunlock.c @@ -244,8 +244,10 @@ leave: if (actions & DLM_UNLOCK_FREE_LOCK) { /* this should always be coupled with list removal */ BUG_ON(!(actions & DLM_UNLOCK_REMOVE_LOCK)); - mlog(0, "lock %"MLFu64" should be gone now! refs=%d\n", - lock->ml.cookie, atomic_read(&lock->lock_refs.refcount)-1); + mlog(0, "lock %u:%llu should be gone now! refs=%d\n", + dlm_get_lock_cookie_node(lock->ml.cookie), + dlm_get_lock_cookie_seq(lock->ml.cookie), + atomic_read(&lock->lock_refs.refcount)-1); dlm_lock_put(lock); } if (actions & DLM_UNLOCK_CALL_AST) @@ -493,8 +495,9 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data) not_found: if (!found) mlog(ML_ERROR, "failed to find lock to unlock! " - "cookie=%"MLFu64"\n", - unlock->cookie); + "cookie=%u:%llu\n", + dlm_get_lock_cookie_node(unlock->cookie), + dlm_get_lock_cookie_seq(unlock->cookie)); else { /* send the lksb->status back to the other node */ status = lksb->status; diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index e971ec2f840..64cd52860c8 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -231,9 +231,9 @@ static void ocfs2_build_lock_name(enum ocfs2_lock_type type, BUG_ON(type >= OCFS2_NUM_LOCK_TYPES); - len = snprintf(name, OCFS2_LOCK_ID_MAX_LEN, "%c%s%016"MLFx64"%08x", - ocfs2_lock_type_char(type), OCFS2_LOCK_ID_PAD, blkno, - generation); + len = snprintf(name, OCFS2_LOCK_ID_MAX_LEN, "%c%s%016llx%08x", + ocfs2_lock_type_char(type), OCFS2_LOCK_ID_PAD, + (long long)blkno, generation); BUG_ON(len != (OCFS2_LOCK_ID_MAX_LEN - 1)); @@ -533,8 +533,8 @@ static void ocfs2_inode_ast_func(void *opaque) inode = ocfs2_lock_res_inode(lockres); - mlog(0, "AST fired for inode %"MLFu64", l_action = %u, type = %s\n", - OCFS2_I(inode)->ip_blkno, lockres->l_action, + mlog(0, "AST fired for inode %llu, l_action = %u, type = %s\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, lockres->l_action, ocfs2_lock_type_string(lockres->l_type)); BUG_ON(!ocfs2_is_inode_lock(lockres)); @@ -544,8 +544,8 @@ static void ocfs2_inode_ast_func(void *opaque) lksb = &(lockres->l_lksb); if (lksb->status != DLM_NORMAL) { mlog(ML_ERROR, "ocfs2_inode_ast_func: lksb status value of %u " - "on inode %"MLFu64"\n", lksb->status, - OCFS2_I(inode)->ip_blkno); + "on inode %llu\n", lksb->status, + (unsigned long long)OCFS2_I(inode)->ip_blkno); spin_unlock_irqrestore(&lockres->l_lock, flags); mlog_exit_void(); return; @@ -646,10 +646,9 @@ static void ocfs2_inode_bast_func(void *opaque, int level) inode = ocfs2_lock_res_inode(lockres); osb = OCFS2_SB(inode->i_sb); - mlog(0, "BAST fired for inode %"MLFu64", blocking = %d, level = %d " - "type = %s\n", OCFS2_I(inode)->ip_blkno, level, - lockres->l_level, - ocfs2_lock_type_string(lockres->l_type)); + mlog(0, "BAST fired for inode %llu, blocking %d, level %d type %s\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, level, + lockres->l_level, ocfs2_lock_type_string(lockres->l_type)); ocfs2_generic_bast_func(osb, lockres, level); @@ -1104,7 +1103,7 @@ int ocfs2_create_new_inode_locks(struct inode *inode) mlog_entry_void(); - mlog(0, "Inode %"MLFu64"\n", OCFS2_I(inode)->ip_blkno); + mlog(0, "Inode %llu\n", (unsigned long long)OCFS2_I(inode)->ip_blkno); /* NOTE: That we don't increment any of the holder counts, nor * do we add anything to a journal handle. Since this is @@ -1149,8 +1148,8 @@ int ocfs2_rw_lock(struct inode *inode, int write) mlog_entry_void(); - mlog(0, "inode %"MLFu64" take %s RW lock\n", - OCFS2_I(inode)->ip_blkno, + mlog(0, "inode %llu take %s RW lock\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, write ? "EXMODE" : "PRMODE"); lockres = &OCFS2_I(inode)->ip_rw_lockres; @@ -1173,8 +1172,8 @@ void ocfs2_rw_unlock(struct inode *inode, int write) mlog_entry_void(); - mlog(0, "inode %"MLFu64" drop %s RW lock\n", - OCFS2_I(inode)->ip_blkno, + mlog(0, "inode %llu drop %s RW lock\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, write ? "EXMODE" : "PRMODE"); ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level); @@ -1193,8 +1192,8 @@ int ocfs2_data_lock_full(struct inode *inode, mlog_entry_void(); - mlog(0, "inode %"MLFu64" take %s DATA lock\n", - OCFS2_I(inode)->ip_blkno, + mlog(0, "inode %llu take %s DATA lock\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, write ? "EXMODE" : "PRMODE"); /* We'll allow faking a readonly data lock for @@ -1278,8 +1277,8 @@ void ocfs2_data_unlock(struct inode *inode, mlog_entry_void(); - mlog(0, "inode %"MLFu64" drop %s DATA lock\n", - OCFS2_I(inode)->ip_blkno, + mlog(0, "inode %llu drop %s DATA lock\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, write ? "EXMODE" : "PRMODE"); if (!ocfs2_is_hard_readonly(OCFS2_SB(inode->i_sb))) @@ -1462,9 +1461,9 @@ static int ocfs2_meta_lock_update(struct inode *inode, spin_lock(&oi->ip_lock); if (oi->ip_flags & OCFS2_INODE_DELETED) { - mlog(0, "Orphaned inode %"MLFu64" was deleted while we " + mlog(0, "Orphaned inode %llu was deleted while we " "were waiting on a lock. ip_flags = 0x%x\n", - oi->ip_blkno, oi->ip_flags); + (unsigned long long)oi->ip_blkno, oi->ip_flags); spin_unlock(&oi->ip_lock); status = -ENOENT; goto bail; @@ -1485,8 +1484,8 @@ static int ocfs2_meta_lock_update(struct inode *inode, ocfs2_extent_map_trunc(inode, 0); if (ocfs2_meta_lvb_is_trustable(lockres)) { - mlog(0, "Trusting LVB on inode %"MLFu64"\n", - oi->ip_blkno); + mlog(0, "Trusting LVB on inode %llu\n", + (unsigned long long)oi->ip_blkno); ocfs2_refresh_inode_from_lvb(inode); } else { /* Boo, we have to go to disk. */ @@ -1514,15 +1513,16 @@ static int ocfs2_meta_lock_update(struct inode *inode, } mlog_bug_on_msg(inode->i_generation != le32_to_cpu(fe->i_generation), - "Invalid dinode %"MLFu64" disk generation: %u " + "Invalid dinode %llu disk generation: %u " "inode->i_generation: %u\n", - oi->ip_blkno, le32_to_cpu(fe->i_generation), + (unsigned long long)oi->ip_blkno, + le32_to_cpu(fe->i_generation), inode->i_generation); mlog_bug_on_msg(le64_to_cpu(fe->i_dtime) || !(fe->i_flags & cpu_to_le32(OCFS2_VALID_FL)), - "Stale dinode %"MLFu64" dtime: %"MLFu64" " - "flags: 0x%x\n", oi->ip_blkno, - le64_to_cpu(fe->i_dtime), + "Stale dinode %llu dtime: %llu flags: 0x%x\n", + (unsigned long long)oi->ip_blkno, + (unsigned long long)le64_to_cpu(fe->i_dtime), le32_to_cpu(fe->i_flags)); ocfs2_refresh_inode(inode, fe); @@ -1581,8 +1581,8 @@ int ocfs2_meta_lock_full(struct inode *inode, mlog_entry_void(); - mlog(0, "inode %"MLFu64", take %s META lock\n", - OCFS2_I(inode)->ip_blkno, + mlog(0, "inode %llu, take %s META lock\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, ex ? "EXMODE" : "PRMODE"); status = 0; @@ -1716,8 +1716,8 @@ void ocfs2_meta_unlock(struct inode *inode, mlog_entry_void(); - mlog(0, "inode %"MLFu64" drop %s META lock\n", - OCFS2_I(inode)->ip_blkno, + mlog(0, "inode %llu drop %s META lock\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, ex ? "EXMODE" : "PRMODE"); if (!ocfs2_is_hard_readonly(OCFS2_SB(inode->i_sb))) @@ -2017,7 +2017,7 @@ out: return ret; } -static struct file_operations ocfs2_dlm_debug_fops = { +static const struct file_operations ocfs2_dlm_debug_fops = { .open = ocfs2_dlm_debug_open, .release = ocfs2_dlm_debug_release, .read = seq_read, @@ -2686,8 +2686,8 @@ static void ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres, mapping = inode->i_mapping; if (filemap_fdatawrite(mapping)) { - mlog(ML_ERROR, "Could not sync inode %"MLFu64" for downconvert!", - OCFS2_I(inode)->ip_blkno); + mlog(ML_ERROR, "Could not sync inode %llu for downconvert!", + (unsigned long long)OCFS2_I(inode)->ip_blkno); } sync_mapping_buffers(mapping); if (blocking == LKM_EXMODE) { @@ -2717,7 +2717,8 @@ int ocfs2_unblock_data(struct ocfs2_lock_res *lockres, inode = ocfs2_lock_res_inode(lockres); osb = OCFS2_SB(inode->i_sb); - mlog(0, "unblock inode %"MLFu64"\n", OCFS2_I(inode)->ip_blkno); + mlog(0, "unblock inode %llu\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); status = ocfs2_generic_unblock_lock(osb, lockres, @@ -2726,8 +2727,8 @@ int ocfs2_unblock_data(struct ocfs2_lock_res *lockres, if (status < 0) mlog_errno(status); - mlog(0, "inode %"MLFu64", requeue = %d\n", - OCFS2_I(inode)->ip_blkno, *requeue); + mlog(0, "inode %llu, requeue = %d\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, *requeue); mlog_exit(status); return status; @@ -2767,14 +2768,15 @@ int ocfs2_unblock_meta(struct ocfs2_lock_res *lockres, inode = ocfs2_lock_res_inode(lockres); - mlog(0, "unblock inode %"MLFu64"\n", OCFS2_I(inode)->ip_blkno); + mlog(0, "unblock inode %llu\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); status = ocfs2_do_unblock_meta(inode, requeue); if (status < 0) mlog_errno(status); - mlog(0, "inode %"MLFu64", requeue = %d\n", - OCFS2_I(inode)->ip_blkno, *requeue); + mlog(0, "inode %llu, requeue = %d\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, *requeue); mlog_exit(status); return status; @@ -2893,12 +2895,13 @@ void ocfs2_dump_meta_lvb_info(u64 level, lockres->l_name, function, line); mlog(level, "version: %u, clusters: %u\n", be32_to_cpu(lvb->lvb_version), be32_to_cpu(lvb->lvb_iclusters)); - mlog(level, "size: %"MLFu64", uid %u, gid %u, mode 0x%x\n", - be64_to_cpu(lvb->lvb_isize), be32_to_cpu(lvb->lvb_iuid), - be32_to_cpu(lvb->lvb_igid), be16_to_cpu(lvb->lvb_imode)); - mlog(level, "nlink %u, atime_packed 0x%"MLFx64", " - "ctime_packed 0x%"MLFx64", mtime_packed 0x%"MLFx64"\n", - be16_to_cpu(lvb->lvb_inlink), be64_to_cpu(lvb->lvb_iatime_packed), - be64_to_cpu(lvb->lvb_ictime_packed), - be64_to_cpu(lvb->lvb_imtime_packed)); + mlog(level, "size: %llu, uid %u, gid %u, mode 0x%x\n", + (unsigned long long)be64_to_cpu(lvb->lvb_isize), + be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid), + be16_to_cpu(lvb->lvb_imode)); + mlog(level, "nlink %u, atime_packed 0x%llx, ctime_packed 0x%llx, " + "mtime_packed 0x%llx\n", be16_to_cpu(lvb->lvb_inlink), + (long long)be64_to_cpu(lvb->lvb_iatime_packed), + (long long)be64_to_cpu(lvb->lvb_ictime_packed), + (long long)be64_to_cpu(lvb->lvb_imtime_packed)); } diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c index 5810160d92a..ec55ab3c121 100644 --- a/fs/ocfs2/export.c +++ b/fs/ocfs2/export.c @@ -95,8 +95,8 @@ static struct dentry *ocfs2_get_parent(struct dentry *child) mlog_entry("(0x%p, '%.*s')\n", child, child->d_name.len, child->d_name.name); - mlog(0, "find parent of directory %"MLFu64"\n", - OCFS2_I(dir)->ip_blkno); + mlog(0, "find parent of directory %llu\n", + (unsigned long long)OCFS2_I(dir)->ip_blkno); status = ocfs2_meta_lock(dir, NULL, NULL, 0); if (status < 0) { @@ -115,7 +115,8 @@ static struct dentry *ocfs2_get_parent(struct dentry *child) inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno); if (IS_ERR(inode)) { - mlog(ML_ERROR, "Unable to create inode %"MLFu64"\n", blkno); + mlog(ML_ERROR, "Unable to create inode %llu\n", + (unsigned long long)blkno); parent = ERR_PTR(-EACCES); goto bail_unlock; } @@ -160,8 +161,8 @@ static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len, blkno = OCFS2_I(inode)->ip_blkno; generation = inode->i_generation; - mlog(0, "Encoding fh: blkno: %"MLFu64", generation: %u\n", - blkno, generation); + mlog(0, "Encoding fh: blkno: %llu, generation: %u\n", + (unsigned long long)blkno, generation); len = 3; fh[0] = cpu_to_le32((u32)(blkno >> 32)); @@ -186,8 +187,8 @@ static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len, len = 6; type = 2; - mlog(0, "Encoding parent: blkno: %"MLFu64", generation: %u\n", - blkno, generation); + mlog(0, "Encoding parent: blkno: %llu, generation: %u\n", + (unsigned long long)blkno, generation); } *max_len = len; @@ -220,16 +221,17 @@ static struct dentry *ocfs2_decode_fh(struct super_block *sb, __be32 *fh, parent.ih_blkno |= (u64)le32_to_cpu(fh[4]); parent.ih_generation = le32_to_cpu(fh[5]); - mlog(0, "Decoding parent: blkno: %"MLFu64", generation: %u\n", - parent.ih_blkno, parent.ih_generation); + mlog(0, "Decoding parent: blkno: %llu, generation: %u\n", + (unsigned long long)parent.ih_blkno, + parent.ih_generation); } handle.ih_blkno = (u64)le32_to_cpu(fh[0]) << 32; handle.ih_blkno |= (u64)le32_to_cpu(fh[1]); handle.ih_generation = le32_to_cpu(fh[2]); - mlog(0, "Encoding fh: blkno: %"MLFu64", generation: %u\n", - handle.ih_blkno, handle.ih_generation); + mlog(0, "Encoding fh: blkno: %llu, generation: %u\n", + (unsigned long long)handle.ih_blkno, handle.ih_generation); ret = ocfs2_export_ops.find_exported_dentry(sb, &handle, &parent, acceptable, context); diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c index e6f207eebab..4601fc256f1 100644 --- a/fs/ocfs2/extent_map.c +++ b/fs/ocfs2/extent_map.c @@ -182,10 +182,10 @@ static int ocfs2_extent_map_find_leaf(struct inode *inode, if (rec_end > OCFS2_I(inode)->ip_clusters) { mlog_errno(ret); ocfs2_error(inode->i_sb, - "Extent %d at e_blkno %"MLFu64" of inode %"MLFu64" goes past ip_clusters of %u\n", + "Extent %d at e_blkno %llu of inode %llu goes past ip_clusters of %u\n", i, - le64_to_cpu(rec->e_blkno), - OCFS2_I(inode)->ip_blkno, + (unsigned long long)le64_to_cpu(rec->e_blkno), + (unsigned long long)OCFS2_I(inode)->ip_blkno, OCFS2_I(inode)->ip_clusters); goto out_free; } @@ -233,11 +233,11 @@ static int ocfs2_extent_map_find_leaf(struct inode *inode, if (blkno) { mlog_errno(ret); ocfs2_error(inode->i_sb, - "Multiple extents for (cpos = %u, clusters = %u) on inode %"MLFu64"; e_blkno %"MLFu64" and rec %d at e_blkno %"MLFu64"\n", + "Multiple extents for (cpos = %u, clusters = %u) on inode %llu; e_blkno %llu and rec %d at e_blkno %llu\n", cpos, clusters, - OCFS2_I(inode)->ip_blkno, - blkno, i, - le64_to_cpu(rec->e_blkno)); + (unsigned long long)OCFS2_I(inode)->ip_blkno, + (unsigned long long)blkno, i, + (unsigned long long)le64_to_cpu(rec->e_blkno)); goto out_free; } @@ -251,9 +251,9 @@ static int ocfs2_extent_map_find_leaf(struct inode *inode, ret = -EBADR; if (!blkno) { ocfs2_error(inode->i_sb, - "No record found for (cpos = %u, clusters = %u) on inode %"MLFu64"\n", + "No record found for (cpos = %u, clusters = %u) on inode %llu\n", cpos, clusters, - OCFS2_I(inode)->ip_blkno); + (unsigned long long)OCFS2_I(inode)->ip_blkno); mlog_errno(ret); goto out_free; } @@ -288,10 +288,10 @@ static int ocfs2_extent_map_find_leaf(struct inode *inode, ret = -EBADR; mlog_errno(ret); ocfs2_error(inode->i_sb, - "Extent %d at e_blkno %"MLFu64" of inode %"MLFu64" goes past ip_clusters of %u\n", + "Extent %d at e_blkno %llu of inode %llu goes past ip_clusters of %u\n", i, - le64_to_cpu(rec->e_blkno), - OCFS2_I(inode)->ip_blkno, + (unsigned long long)le64_to_cpu(rec->e_blkno), + (unsigned long long)OCFS2_I(inode)->ip_blkno, OCFS2_I(inode)->ip_clusters); return ret; } @@ -557,9 +557,9 @@ static int ocfs2_extent_map_insert(struct inode *inode, ret = -EBADR; mlog_errno(ret); ocfs2_error(inode->i_sb, - "Zero e_clusters on non-tail extent record at e_blkno %"MLFu64" on inode %"MLFu64"\n", - le64_to_cpu(rec->e_blkno), - OCFS2_I(inode)->ip_blkno); + "Zero e_clusters on non-tail extent record at e_blkno %llu on inode %llu\n", + (unsigned long long)le64_to_cpu(rec->e_blkno), + (unsigned long long)OCFS2_I(inode)->ip_blkno); return ret; } @@ -660,10 +660,10 @@ int ocfs2_extent_map_append(struct inode *inode, mlog_bug_on_msg((le32_to_cpu(rec->e_cpos) + le32_to_cpu(rec->e_clusters)) != (em->em_clusters + new_clusters), - "Inode %"MLFu64":\n" + "Inode %llu:\n" "rec->e_cpos = %u + rec->e_clusters = %u = %u\n" "em->em_clusters = %u + new_clusters = %u = %u\n", - OCFS2_I(inode)->ip_blkno, + (unsigned long long)OCFS2_I(inode)->ip_blkno, le32_to_cpu(rec->e_cpos), le32_to_cpu(rec->e_clusters), le32_to_cpu(rec->e_cpos) + le32_to_cpu(rec->e_clusters), em->em_clusters, new_clusters, diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 8a4048b55fd..34e903a6a46 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -220,8 +220,9 @@ static int ocfs2_truncate_file(struct inode *inode, struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_truncate_context *tc = NULL; - mlog_entry("(inode = %"MLFu64", new_i_size = %"MLFu64"\n", - OCFS2_I(inode)->ip_blkno, new_i_size); + mlog_entry("(inode = %llu, new_i_size = %llu\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, + (unsigned long long)new_i_size); truncate_inode_pages(inode->i_mapping, new_i_size); @@ -233,23 +234,26 @@ static int ocfs2_truncate_file(struct inode *inode, } mlog_bug_on_msg(le64_to_cpu(fe->i_size) != i_size_read(inode), - "Inode %"MLFu64", inode i_size = %lld != di " - "i_size = %"MLFu64", i_flags = 0x%x\n", - OCFS2_I(inode)->ip_blkno, + "Inode %llu, inode i_size = %lld != di " + "i_size = %llu, i_flags = 0x%x\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, i_size_read(inode), - le64_to_cpu(fe->i_size), le32_to_cpu(fe->i_flags)); + (unsigned long long)le64_to_cpu(fe->i_size), + le32_to_cpu(fe->i_flags)); if (new_i_size > le64_to_cpu(fe->i_size)) { - mlog(0, "asked to truncate file with size (%"MLFu64") " - "to size (%"MLFu64")!\n", - le64_to_cpu(fe->i_size), new_i_size); + mlog(0, "asked to truncate file with size (%llu) to size (%llu)!\n", + (unsigned long long)le64_to_cpu(fe->i_size), + (unsigned long long)new_i_size); status = -EINVAL; mlog_errno(status); goto bail; } - mlog(0, "inode %"MLFu64", i_size = %"MLFu64", new_i_size = %"MLFu64"\n", - le64_to_cpu(fe->i_blkno), le64_to_cpu(fe->i_size), new_i_size); + mlog(0, "inode %llu, i_size = %llu, new_i_size = %llu\n", + (unsigned long long)le64_to_cpu(fe->i_blkno), + (unsigned long long)le64_to_cpu(fe->i_size), + (unsigned long long)new_i_size); /* lets handle the simple truncate cases before doing any more * cluster locking. */ @@ -378,8 +382,8 @@ int ocfs2_do_extend_allocation(struct ocfs2_super *osb, } block = ocfs2_clusters_to_blocks(osb->sb, bit_off); - mlog(0, "Allocating %u clusters at block %u for inode %"MLFu64"\n", - num_bits, bit_off, OCFS2_I(inode)->ip_blkno); + mlog(0, "Allocating %u clusters at block %u for inode %llu\n", + num_bits, bit_off, (unsigned long long)OCFS2_I(inode)->ip_blkno); status = ocfs2_insert_extent(osb, handle, inode, fe_bh, block, num_bits, meta_ac); if (status < 0) { @@ -449,9 +453,9 @@ static int ocfs2_extend_allocation(struct inode *inode, restart_all: BUG_ON(le32_to_cpu(fe->i_clusters) != OCFS2_I(inode)->ip_clusters); - mlog(0, "extend inode %"MLFu64", i_size = %lld, fe->i_clusters = %u, " + mlog(0, "extend inode %llu, i_size = %lld, fe->i_clusters = %u, " "clusters_to_add = %u\n", - OCFS2_I(inode)->ip_blkno, i_size_read(inode), + (unsigned long long)OCFS2_I(inode)->ip_blkno, i_size_read(inode), fe->i_clusters, clusters_to_add); handle = ocfs2_alloc_handle(osb); @@ -569,8 +573,8 @@ restarted_transaction: } } - mlog(0, "fe: i_clusters = %u, i_size=%"MLFu64"\n", - fe->i_clusters, fe->i_size); + mlog(0, "fe: i_clusters = %u, i_size=%llu\n", + fe->i_clusters, (unsigned long long)fe->i_size); mlog(0, "inode: ip_clusters=%u, i_size=%lld\n", OCFS2_I(inode)->ip_clusters, i_size_read(inode)); @@ -865,8 +869,8 @@ static int ocfs2_write_remove_suid(struct inode *inode) struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_dinode *di; - mlog_entry("(Inode %"MLFu64", mode 0%o)\n", oi->ip_blkno, - inode->i_mode); + mlog_entry("(Inode %llu, mode 0%o)\n", + (unsigned long long)oi->ip_blkno, inode->i_mode); handle = ocfs2_start_trans(osb, NULL, OCFS2_INODE_UPDATE_CREDITS); if (handle == NULL) { @@ -1172,7 +1176,7 @@ struct inode_operations ocfs2_special_file_iops = { .getattr = ocfs2_getattr, }; -struct file_operations ocfs2_fops = { +const struct file_operations ocfs2_fops = { .read = do_sync_read, .write = do_sync_write, .sendfile = generic_file_sendfile, @@ -1184,7 +1188,7 @@ struct file_operations ocfs2_fops = { .aio_write = ocfs2_file_aio_write, }; -struct file_operations ocfs2_dops = { +const struct file_operations ocfs2_dops = { .read = generic_read_dir, .readdir = ocfs2_readdir, .fsync = ocfs2_sync_file, diff --git a/fs/ocfs2/file.h b/fs/ocfs2/file.h index a5ea33b2406..740c9e7ca59 100644 --- a/fs/ocfs2/file.h +++ b/fs/ocfs2/file.h @@ -26,8 +26,8 @@ #ifndef OCFS2_FILE_H #define OCFS2_FILE_H -extern struct file_operations ocfs2_fops; -extern struct file_operations ocfs2_dops; +extern const struct file_operations ocfs2_fops; +extern const struct file_operations ocfs2_dops; extern struct inode_operations ocfs2_file_iops; extern struct inode_operations ocfs2_special_file_iops; struct ocfs2_alloc_context; diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 315472a5c19..327a5b7b86e 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -95,7 +95,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno) struct super_block *sb = osb->sb; struct ocfs2_find_inode_args args; - mlog_entry("(blkno = %"MLFu64")\n", blkno); + mlog_entry("(blkno = %llu)\n", (unsigned long long)blkno); /* Ok. By now we've either got the offsets passed to us by the * caller, or we just pulled them off the bh. Lets do some @@ -134,8 +134,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno) bail: if (!IS_ERR(inode)) { - mlog(0, "returning inode with number %"MLFu64"\n", - OCFS2_I(inode)->ip_blkno); + mlog(0, "returning inode with number %llu\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); mlog_exit_ptr(inode); } else mlog_errno(PTR_ERR(inode)); @@ -219,7 +219,8 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, struct ocfs2_super *osb; int status = -EINVAL; - mlog_entry("(0x%p, size:%"MLFu64")\n", inode, fe->i_size); + mlog_entry("(0x%p, size:%llu)\n", inode, + (unsigned long long)fe->i_size); sb = inode->i_sb; osb = OCFS2_SB(sb); @@ -228,9 +229,10 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, * today. change if needed. */ if (!OCFS2_IS_VALID_DINODE(fe) || !(fe->i_flags & cpu_to_le32(OCFS2_VALID_FL))) { - mlog(ML_ERROR, "Invalid dinode: i_ino=%lu, i_blkno=%"MLFu64", " + mlog(ML_ERROR, "Invalid dinode: i_ino=%lu, i_blkno=%llu, " "signature = %.*s, flags = 0x%x\n", - inode->i_ino, le64_to_cpu(fe->i_blkno), 7, + inode->i_ino, + (unsigned long long)le64_to_cpu(fe->i_blkno), 7, fe->i_signature, le32_to_cpu(fe->i_flags)); goto bail; } @@ -268,8 +270,9 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, if (OCFS2_I(inode)->ip_blkno != le64_to_cpu(fe->i_blkno)) mlog(ML_ERROR, - "ip_blkno %"MLFu64" != i_blkno %"MLFu64"!\n", - OCFS2_I(inode)->ip_blkno, fe->i_blkno); + "ip_blkno %llu != i_blkno %llu!\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, + (unsigned long long)fe->i_blkno); OCFS2_I(inode)->ip_clusters = le32_to_cpu(fe->i_clusters); OCFS2_I(inode)->ip_orphaned_slot = OCFS2_INVALID_SLOT; @@ -278,8 +281,8 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, inode->i_ino = ino_from_blkno(inode->i_sb, le64_to_cpu(fe->i_blkno)); - mlog(0, "blkno = %"MLFu64", ino = %lu, create_ino = %s\n", - fe->i_blkno, inode->i_ino, create_ino ? "true" : "false"); + mlog(0, "blkno = %llu, ino = %lu, create_ino = %s\n", + (unsigned long long)fe->i_blkno, inode->i_ino, create_ino ? "true" : "false"); inode->i_nlink = le16_to_cpu(fe->i_links_count); @@ -371,8 +374,8 @@ static int ocfs2_read_locked_inode(struct inode *inode, fe = (struct ocfs2_dinode *) bh->b_data; if (!OCFS2_IS_VALID_DINODE(fe)) { - mlog(ML_ERROR, "Invalid dinode #%"MLFu64": signature = %.*s\n", - fe->i_blkno, 7, fe->i_signature); + mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n", + (unsigned long long)fe->i_blkno, 7, fe->i_signature); make_bad_inode(inode); goto bail; } @@ -386,8 +389,8 @@ static int ocfs2_read_locked_inode(struct inode *inode, status = -EINVAL; if (ocfs2_populate_inode(inode, fe, 0) < 0) { - mlog(ML_ERROR, "populate inode failed! i_blkno=%"MLFu64", " - "i_ino=%lu\n", fe->i_blkno, inode->i_ino); + mlog(ML_ERROR, "populate failed! i_blkno=%llu, i_ino=%lu\n", + (unsigned long long)fe->i_blkno, inode->i_ino); make_bad_inode(inode); goto bail; } @@ -675,8 +678,8 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode) * never get here as system file inodes should always have a * positive link count. */ if (oi->ip_flags & OCFS2_INODE_SYSTEM_FILE) { - mlog(ML_ERROR, "Skipping delete of system file %"MLFu64".\n", - oi->ip_blkno); + mlog(ML_ERROR, "Skipping delete of system file %llu\n", + (unsigned long long)oi->ip_blkno); goto bail_unlock; } @@ -715,16 +718,16 @@ static int ocfs2_query_inode_wipe(struct inode *inode, * ocfs2_delete_inode, another node might have asked to delete * the inode. Recheck our flags to catch this. */ if (!ocfs2_inode_is_valid_to_delete(inode)) { - mlog(0, "Skipping delete of %"MLFu64" because flags changed\n", - oi->ip_blkno); + mlog(0, "Skipping delete of %llu because flags changed\n", + (unsigned long long)oi->ip_blkno); goto bail; } /* Now that we have an up to date inode, we can double check * the link count. */ if (inode->i_nlink) { - mlog(0, "Skipping delete of %"MLFu64" because nlink = %u\n", - oi->ip_blkno, inode->i_nlink); + mlog(0, "Skipping delete of %llu because nlink = %u\n", + (unsigned long long)oi->ip_blkno, inode->i_nlink); goto bail; } @@ -734,9 +737,11 @@ static int ocfs2_query_inode_wipe(struct inode *inode, /* for lack of a better error? */ status = -EEXIST; mlog(ML_ERROR, - "Inode %"MLFu64" (on-disk %"MLFu64") not orphaned! " + "Inode %llu (on-disk %llu) not orphaned! " "Disk flags 0x%x, inode flags 0x%x\n", - oi->ip_blkno, di->i_blkno, di->i_flags, oi->ip_flags); + (unsigned long long)oi->ip_blkno, + (unsigned long long)di->i_blkno, di->i_flags, + oi->ip_flags); goto bail; } @@ -753,8 +758,8 @@ static int ocfs2_query_inode_wipe(struct inode *inode, * disk and let them worry about deleting it. */ if (status == -EBUSY) { status = 0; - mlog(0, "Skipping delete of %"MLFu64" because it is in use on" - "other nodes\n", oi->ip_blkno); + mlog(0, "Skipping delete of %llu because it is in use on" + "other nodes\n", (unsigned long long)oi->ip_blkno); goto bail; } if (status < 0) { @@ -768,13 +773,13 @@ static int ocfs2_query_inode_wipe(struct inode *inode, * into. This may happen during node death and * recovery knows how to clean it up so we can safely * ignore this inode for now on. */ - mlog(0, "Nobody knew where inode %"MLFu64" was orphaned!\n", - oi->ip_blkno); + mlog(0, "Nobody knew where inode %llu was orphaned!\n", + (unsigned long long)oi->ip_blkno); } else { *wipe = 1; - mlog(0, "Inode %"MLFu64" is ok to wipe from orphan dir %d\n", - oi->ip_blkno, oi->ip_orphaned_slot); + mlog(0, "Inode %llu is ok to wipe from orphan dir %d\n", + (unsigned long long)oi->ip_blkno, oi->ip_orphaned_slot); } spin_unlock(&oi->ip_lock); @@ -788,8 +793,8 @@ bail: static void ocfs2_cleanup_delete_inode(struct inode *inode, int sync_data) { - mlog(0, "Cleanup inode %"MLFu64", sync = %d\n", - OCFS2_I(inode)->ip_blkno, sync_data); + mlog(0, "Cleanup inode %llu, sync = %d\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, sync_data); if (sync_data) write_inode_now(inode, 1); truncate_inode_pages(&inode->i_data, 0); @@ -897,8 +902,8 @@ void ocfs2_clear_inode(struct inode *inode) if (!inode) goto bail; - mlog(0, "Clearing inode: %"MLFu64", nlink = %u\n", - OCFS2_I(inode)->ip_blkno, inode->i_nlink); + mlog(0, "Clearing inode: %llu, nlink = %u\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_nlink); mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, "Inode=%lu\n", inode->i_ino); @@ -919,8 +924,8 @@ void ocfs2_clear_inode(struct inode *inode) ocfs2_checkpoint_inode(inode); mlog_bug_on_msg(!list_empty(&oi->ip_io_markers), - "Clear inode of %"MLFu64", inode has io markers\n", - oi->ip_blkno); + "Clear inode of %llu, inode has io markers\n", + (unsigned long long)oi->ip_blkno); ocfs2_extent_map_drop(inode, 0); ocfs2_extent_map_init(inode); @@ -936,20 +941,20 @@ void ocfs2_clear_inode(struct inode *inode) ocfs2_metadata_cache_purge(inode); mlog_bug_on_msg(oi->ip_metadata_cache.ci_num_cached, - "Clear inode of %"MLFu64", inode has %u cache items\n", - oi->ip_blkno, oi->ip_metadata_cache.ci_num_cached); + "Clear inode of %llu, inode has %u cache items\n", + (unsigned long long)oi->ip_blkno, oi->ip_metadata_cache.ci_num_cached); mlog_bug_on_msg(!(oi->ip_flags & OCFS2_INODE_CACHE_INLINE), - "Clear inode of %"MLFu64", inode has a bad flag\n", - oi->ip_blkno); + "Clear inode of %llu, inode has a bad flag\n", + (unsigned long long)oi->ip_blkno); mlog_bug_on_msg(spin_is_locked(&oi->ip_lock), - "Clear inode of %"MLFu64", inode is locked\n", - oi->ip_blkno); + "Clear inode of %llu, inode is locked\n", + (unsigned long long)oi->ip_blkno); mlog_bug_on_msg(!mutex_trylock(&oi->ip_io_mutex), - "Clear inode of %"MLFu64", io_mutex is locked\n", - oi->ip_blkno); + "Clear inode of %llu, io_mutex is locked\n", + (unsigned long long)oi->ip_blkno); mutex_unlock(&oi->ip_io_mutex); /* @@ -957,19 +962,19 @@ void ocfs2_clear_inode(struct inode *inode) * kernel 1, world 0 */ mlog_bug_on_msg(!down_write_trylock(&oi->ip_alloc_sem), - "Clear inode of %"MLFu64", alloc_sem is locked\n", - oi->ip_blkno); + "Clear inode of %llu, alloc_sem is locked\n", + (unsigned long long)oi->ip_blkno); up_write(&oi->ip_alloc_sem); mlog_bug_on_msg(oi->ip_open_count, - "Clear inode of %"MLFu64" has open count %d\n", - oi->ip_blkno, oi->ip_open_count); + "Clear inode of %llu has open count %d\n", + (unsigned long long)oi->ip_blkno, oi->ip_open_count); mlog_bug_on_msg(!list_empty(&oi->ip_handle_list), - "Clear inode of %"MLFu64" has non empty handle list\n", - oi->ip_blkno); + "Clear inode of %llu has non empty handle list\n", + (unsigned long long)oi->ip_blkno); mlog_bug_on_msg(oi->ip_handle, - "Clear inode of %"MLFu64" has non empty handle pointer\n", - oi->ip_blkno); + "Clear inode of %llu has non empty handle pointer\n", + (unsigned long long)oi->ip_blkno); /* Clear all other flags. */ oi->ip_flags = OCFS2_INODE_CACHE_INLINE; @@ -991,8 +996,8 @@ void ocfs2_drop_inode(struct inode *inode) mlog_entry_void(); - mlog(0, "Drop inode %"MLFu64", nlink = %u, ip_flags = 0x%x\n", - oi->ip_blkno, inode->i_nlink, oi->ip_flags); + mlog(0, "Drop inode %llu, nlink = %u, ip_flags = 0x%x\n", + (unsigned long long)oi->ip_blkno, inode->i_nlink, oi->ip_flags); /* Testing ip_orphaned_slot here wouldn't work because we may * not have gotten a delete_inode vote from any other nodes @@ -1069,8 +1074,8 @@ int ocfs2_inode_revalidate(struct dentry *dentry) struct inode *inode = dentry->d_inode; int status = 0; - mlog_entry("(inode = 0x%p, ino = %"MLFu64")\n", inode, - inode ? OCFS2_I(inode)->ip_blkno : 0ULL); + mlog_entry("(inode = 0x%p, ino = %llu)\n", inode, + inode ? (unsigned long long)OCFS2_I(inode)->ip_blkno : 0ULL); if (!inode) { mlog(0, "eep, no inode!\n"); @@ -1114,7 +1119,8 @@ int ocfs2_mark_inode_dirty(struct ocfs2_journal_handle *handle, int status; struct ocfs2_dinode *fe = (struct ocfs2_dinode *) bh->b_data; - mlog_entry("(inode %"MLFu64")\n", OCFS2_I(inode)->ip_blkno); + mlog_entry("(inode %llu)\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); status = ocfs2_journal_access(handle, inode, bh, OCFS2_JOURNAL_ACCESS_WRITE); diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 4be801f4559..6a610ae5358 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -377,7 +377,7 @@ int ocfs2_journal_access(struct ocfs2_journal_handle *handle, BUG_ON(!bh); BUG_ON(!(handle->flags & OCFS2_HANDLE_STARTED)); - mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %hu\n", + mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %zu\n", (unsigned long long)bh->b_blocknr, type, (type == OCFS2_JOURNAL_ACCESS_CREATE) ? "OCFS2_JOURNAL_ACCESS_CREATE" : @@ -503,8 +503,8 @@ static void ocfs2_handle_cleanup_locks(struct ocfs2_journal *journal, ocfs2_meta_unlock(inode, 1); if (atomic_read(&inode->i_count) == 1) mlog(ML_ERROR, - "Inode %"MLFu64", I'm doing a last iput for!", - OCFS2_I(inode)->ip_blkno); + "Inode %llu, I'm doing a last iput for!", + (unsigned long long)OCFS2_I(inode)->ip_blkno); iput(inode); kmem_cache_free(ocfs2_lock_cache, lock); } @@ -582,7 +582,8 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) } mlog(0, "inode->i_size = %lld\n", inode->i_size); - mlog(0, "inode->i_blocks = %lu\n", inode->i_blocks); + mlog(0, "inode->i_blocks = %llu\n", + (unsigned long long)inode->i_blocks); mlog(0, "inode->ip_clusters = %u\n", OCFS2_I(inode)->ip_clusters); /* call the kernels journal init function now */ @@ -640,8 +641,9 @@ static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb, /* This is called from startup/shutdown which will * handle the errors in a specific manner, so no need * to call ocfs2_error() here. */ - mlog(ML_ERROR, "Journal dinode %"MLFu64" has invalid " - "signature: %.*s", fe->i_blkno, 7, fe->i_signature); + mlog(ML_ERROR, "Journal dinode %llu has invalid " + "signature: %.*s", (unsigned long long)fe->i_blkno, 7, + fe->i_signature); status = -EIO; goto out; } @@ -849,8 +851,9 @@ static int ocfs2_force_read_journal(struct inode *inode) memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL); - mlog(0, "Force reading %lu blocks\n", - (inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9))); + mlog(0, "Force reading %llu blocks\n", + (unsigned long long)(inode->i_blocks >> + (inode->i_sb->s_blocksize_bits - 9))); v_blkno = 0; while (v_blkno < @@ -934,8 +937,8 @@ void ocfs2_complete_recovery(void *data) la_dinode = item->lri_la_dinode; if (la_dinode) { - mlog(0, "Clean up local alloc %"MLFu64"\n", - la_dinode->i_blkno); + mlog(0, "Clean up local alloc %llu\n", + (unsigned long long)la_dinode->i_blkno); ret = ocfs2_complete_local_alloc_recovery(osb, la_dinode); @@ -947,8 +950,8 @@ void ocfs2_complete_recovery(void *data) tl_dinode = item->lri_tl_dinode; if (tl_dinode) { - mlog(0, "Clean up truncate log %"MLFu64"\n", - tl_dinode->i_blkno); + mlog(0, "Clean up truncate log %llu\n", + (unsigned long long)tl_dinode->i_blkno); ret = ocfs2_complete_truncate_log_recovery(osb, tl_dinode); @@ -1473,11 +1476,11 @@ static int ocfs2_queue_orphans(struct ocfs2_super *osb, if (de->file_type > OCFS2_FT_MAX) { mlog(ML_ERROR, "block %llu contains invalid de: " - "inode = %"MLFu64", rec_len = %u, " + "inode = %llu, rec_len = %u, " "name_len = %u, file_type = %u, " "name='%.*s'\n", (unsigned long long)bh->b_blocknr, - le64_to_cpu(de->inode), + (unsigned long long)le64_to_cpu(de->inode), le16_to_cpu(de->rec_len), de->name_len, de->file_type, @@ -1494,8 +1497,8 @@ static int ocfs2_queue_orphans(struct ocfs2_super *osb, if (IS_ERR(iter)) continue; - mlog(0, "queue orphan %"MLFu64"\n", - OCFS2_I(iter)->ip_blkno); + mlog(0, "queue orphan %llu\n", + (unsigned long long)OCFS2_I(iter)->ip_blkno); /* No locking is required for the next_orphan * queue as there is only ever a single * process doing orphan recovery. */ @@ -1588,7 +1591,7 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb, while (inode) { oi = OCFS2_I(inode); - mlog(0, "iput orphan %"MLFu64"\n", oi->ip_blkno); + mlog(0, "iput orphan %llu\n", (unsigned long long)oi->ip_blkno); iter = oi->ip_next_orphan; diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 149b3518166..0d1973ea32b 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -143,8 +143,8 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb) if (!(le32_to_cpu(alloc->i_flags) & (OCFS2_LOCAL_ALLOC_FL|OCFS2_BITMAP_FL))) { - mlog(ML_ERROR, "Invalid local alloc inode, %"MLFu64"\n", - OCFS2_I(inode)->ip_blkno); + mlog(ML_ERROR, "Invalid local alloc inode, %llu\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); status = -EINVAL; goto bail; } @@ -493,9 +493,9 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, if (le32_to_cpu(alloc->id1.bitmap1.i_used) != ocfs2_local_alloc_count_bits(alloc)) { - ocfs2_error(osb->sb, "local alloc inode %"MLFu64" says it has " + ocfs2_error(osb->sb, "local alloc inode %llu says it has " "%u free bits, but a count shows %u", - le64_to_cpu(alloc->i_blkno), + (unsigned long long)le64_to_cpu(alloc->i_blkno), le32_to_cpu(alloc->id1.bitmap1.i_used), ocfs2_local_alloc_count_bits(alloc)); status = -EIO; @@ -753,10 +753,11 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb, ocfs2_clusters_to_blocks(osb->sb, start - count); - mlog(0, "freeing %u bits starting at local " - "alloc bit %u (la_start_blk = %"MLFu64", " - "blkno = %"MLFu64")\n", count, start - count, - la_start_blk, blkno); + mlog(0, "freeing %u bits starting at local alloc bit " + "%u (la_start_blk = %llu, blkno = %llu)\n", + count, start - count, + (unsigned long long)la_start_blk, + (unsigned long long)blkno); status = ocfs2_free_clusters(handle, main_bm_inode, main_bm_bh, blkno, count); diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index f6b77ff1d2b..0673862c8bd 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -161,8 +161,8 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, goto bail; } - mlog(0, "find name %.*s in directory %"MLFu64"\n", dentry->d_name.len, - dentry->d_name.name, OCFS2_I(dir)->ip_blkno); + mlog(0, "find name %.*s in directory %llu\n", dentry->d_name.len, + dentry->d_name.name, (unsigned long long)OCFS2_I(dir)->ip_blkno); status = ocfs2_meta_lock(dir, NULL, NULL, 0); if (status < 0) { @@ -180,7 +180,8 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno); if (IS_ERR(inode)) { - mlog(ML_ERROR, "Unable to create inode %"MLFu64"\n", blkno); + mlog(ML_ERROR, "Unable to create inode %llu\n", + (unsigned long long)blkno); ret = ERR_PTR(-EACCES); goto bail_unlock; } @@ -310,8 +311,8 @@ static int ocfs2_mknod(struct inode *dir, osb = OCFS2_SB(dir->i_sb); if (S_ISDIR(mode) && (dir->i_nlink >= OCFS2_LINK_MAX)) { - mlog(ML_ERROR, "inode %"MLFu64" has i_nlink of %u\n", - OCFS2_I(dir)->ip_blkno, dir->i_nlink); + mlog(ML_ERROR, "inode %llu has i_nlink of %u\n", + (unsigned long long)OCFS2_I(dir)->ip_blkno, dir->i_nlink); status = -EMLINK; goto leave; } @@ -562,9 +563,9 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb, if (ocfs2_populate_inode(inode, fe, 1) < 0) { mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, " - "i_blkno=%"MLFu64", i_ino=%lu\n", + "i_blkno=%llu, i_ino=%lu\n", (unsigned long long) (*new_fe_bh)->b_blocknr, - fe->i_blkno, inode->i_ino); + (unsigned long long)fe->i_blkno, inode->i_ino); BUG(); } @@ -765,7 +766,7 @@ static int ocfs2_unlink(struct inode *dir, BUG_ON(dentry->d_parent->d_inode != dir); - mlog(0, "ino = %"MLFu64"\n", OCFS2_I(inode)->ip_blkno); + mlog(0, "ino = %llu\n", (unsigned long long)OCFS2_I(inode)->ip_blkno); if (inode == osb->root_inode) { mlog(0, "Cannot delete the root directory\n"); @@ -799,9 +800,9 @@ static int ocfs2_unlink(struct inode *dir, if (OCFS2_I(inode)->ip_blkno != blkno) { status = -ENOENT; - mlog(0, "ip_blkno (%"MLFu64") != dirent blkno (%"MLFu64") " - "ip_flags = %x\n", OCFS2_I(inode)->ip_blkno, blkno, - OCFS2_I(inode)->ip_flags); + mlog(0, "ip_blkno %llu != dirent blkno %llu ip_flags = %x\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, + (unsigned long long)blkno, OCFS2_I(inode)->ip_flags); goto leave; } @@ -946,8 +947,9 @@ static int ocfs2_double_lock(struct ocfs2_super *osb, struct buffer_head **tmpbh; struct inode *tmpinode; - mlog_entry("(inode1 = %"MLFu64", inode2 = %"MLFu64")\n", - oi1->ip_blkno, oi2->ip_blkno); + mlog_entry("(inode1 = %llu, inode2 = %llu)\n", + (unsigned long long)oi1->ip_blkno, + (unsigned long long)oi2->ip_blkno); BUG_ON(!handle); @@ -1187,9 +1189,9 @@ static int ocfs2_rename(struct inode *old_dir, if (OCFS2_I(new_inode)->ip_blkno != newfe_blkno) { status = -EACCES; - mlog(0, "Inode blkno (%"MLFu64") and dir (%"MLFu64") " - "disagree. ip_flags = %x\n", - OCFS2_I(new_inode)->ip_blkno, newfe_blkno, + mlog(0, "Inode %llu and dir %llu disagree. flags = %x\n", + (unsigned long long)OCFS2_I(new_inode)->ip_blkno, + (unsigned long long)newfe_blkno, OCFS2_I(new_inode)->ip_flags); goto bail; } @@ -1215,9 +1217,9 @@ static int ocfs2_rename(struct inode *old_dir, newfe = (struct ocfs2_dinode *) newfe_bh->b_data; - mlog(0, "aha rename over existing... new_de=%p " - "new_blkno=%"MLFu64" newfebh=%p bhblocknr=%llu\n", - new_de, newfe_blkno, newfe_bh, newfe_bh ? + mlog(0, "aha rename over existing... new_de=%p new_blkno=%llu " + "newfebh=%p bhblocknr=%llu\n", new_de, + (unsigned long long)newfe_blkno, newfe_bh, newfe_bh ? (unsigned long long)newfe_bh->b_blocknr : 0ULL); if (S_ISDIR(new_inode->i_mode) || (new_inode->i_nlink == 1)) { @@ -1354,8 +1356,8 @@ static int ocfs2_rename(struct inode *old_dir, if (new_dir_nlink != new_dir->i_nlink) { if (!new_dir_bh) { mlog(ML_ERROR, "need to change nlink for new " - "dir %"MLFu64" from %d to %d but bh is " - "NULL\n", OCFS2_I(new_dir)->ip_blkno, + "dir %llu from %d to %d but bh is NULL\n", + (unsigned long long)OCFS2_I(new_dir)->ip_blkno, (int)new_dir_nlink, new_dir->i_nlink); } else { struct ocfs2_dinode *fe; @@ -1372,10 +1374,9 @@ static int ocfs2_rename(struct inode *old_dir, if (old_dir_nlink != old_dir->i_nlink) { if (!old_dir_bh) { mlog(ML_ERROR, "need to change nlink for old dir " - "%"MLFu64" from %d to %d but bh is NULL!\n", - OCFS2_I(old_dir)->ip_blkno, - (int)old_dir_nlink, - old_dir->i_nlink); + "%llu from %d to %d but bh is NULL!\n", + (unsigned long long)OCFS2_I(old_dir)->ip_blkno, + (int)old_dir_nlink, old_dir->i_nlink); } else { struct ocfs2_dinode *fe; status = ocfs2_journal_access(handle, old_dir, @@ -1443,8 +1444,9 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, * write i_size + 1 bytes. */ blocks = (bytes_left + sb->s_blocksize - 1) >> sb->s_blocksize_bits; - mlog_entry("i_blocks = %lu, i_size = %llu, blocks = %d\n", - inode->i_blocks, i_size_read(inode), blocks); + mlog_entry("i_blocks = %llu, i_size = %llu, blocks = %d\n", + (unsigned long long)inode->i_blocks, + i_size_read(inode), blocks); /* Sanity check -- make sure we're going to fit. */ if (bytes_left > @@ -1634,9 +1636,9 @@ static int ocfs2_symlink(struct inode *dir, NULL); if (status < 0) { if (status != -ENOSPC && status != -EINTR) { - mlog(ML_ERROR, "Failed to extend file to " - "%"MLFu64"\n", - newsize); + mlog(ML_ERROR, + "Failed to extend file to %llu\n", + (unsigned long long)newsize); mlog_errno(status); status = -ENOSPC; } @@ -1716,10 +1718,11 @@ int ocfs2_check_dir_entry(struct inode * dir, error_msg = "directory entry across blocks"; if (error_msg != NULL) - mlog(ML_ERROR, "bad entry in directory #%"MLFu64": %s - " - "offset=%lu, inode=%"MLFu64", rec_len=%d, name_len=%d\n", - OCFS2_I(dir)->ip_blkno, error_msg, offset, - le64_to_cpu(de->inode), rlen, de->name_len); + mlog(ML_ERROR, "bad entry in directory #%llu: %s - " + "offset=%lu, inode=%llu, rec_len=%d, name_len=%d\n", + (unsigned long long)OCFS2_I(dir)->ip_blkno, error_msg, + offset, (unsigned long long)le64_to_cpu(de->inode), rlen, + de->name_len); return error_msg == NULL ? 1 : 0; } @@ -2021,8 +2024,8 @@ static int ocfs2_blkno_stringify(u64 blkno, char *name) mlog_entry_void(); - namelen = snprintf(name, OCFS2_ORPHAN_NAMELEN + 1, "%016"MLFx64, - blkno); + namelen = snprintf(name, OCFS2_ORPHAN_NAMELEN + 1, "%016llx", + (long long)blkno); if (namelen <= 0) { if (namelen) status = namelen; @@ -2167,8 +2170,8 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, OCFS2_I(inode)->ip_orphaned_slot = osb->slot_num; spin_unlock(&OCFS2_I(inode)->ip_lock); - mlog(0, "Inode %"MLFu64" orphaned in slot %d\n", - OCFS2_I(inode)->ip_blkno, osb->slot_num); + mlog(0, "Inode %llu orphaned in slot %d\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, osb->slot_num); leave: if (orphan_dir_inode) @@ -2202,8 +2205,9 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, goto leave; } - mlog(0, "removing '%s' from orphan dir %"MLFu64" (namelen=%d)\n", - name, OCFS2_I(orphan_dir_inode)->ip_blkno, OCFS2_ORPHAN_NAMELEN); + mlog(0, "removing '%s' from orphan dir %llu (namelen=%d)\n", + name, (unsigned long long)OCFS2_I(orphan_dir_inode)->ip_blkno, + OCFS2_ORPHAN_NAMELEN); /* find it's spot in the orphan directory */ target_de_bh = ocfs2_find_entry(name, OCFS2_ORPHAN_NAMELEN, diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index e89de9b6e49..da1093039c0 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -357,8 +357,8 @@ static inline int ocfs2_is_soft_readonly(struct ocfs2_super *osb) #define OCFS2_RO_ON_INVALID_DINODE(__sb, __di) do { \ typeof(__di) ____di = (__di); \ ocfs2_error((__sb), \ - "Dinode # %"MLFu64" has bad signature %.*s", \ - (____di)->i_blkno, 7, \ + "Dinode # %llu has bad signature %.*s", \ + (unsigned long long)(____di)->i_blkno, 7, \ (____di)->i_signature); \ } while (0); @@ -368,8 +368,8 @@ static inline int ocfs2_is_soft_readonly(struct ocfs2_super *osb) #define OCFS2_RO_ON_INVALID_EXTENT_BLOCK(__sb, __eb) do { \ typeof(__eb) ____eb = (__eb); \ ocfs2_error((__sb), \ - "Extent Block # %"MLFu64" has bad signature %.*s", \ - (____eb)->h_blkno, 7, \ + "Extent Block # %llu has bad signature %.*s", \ + (unsigned long long)(____eb)->h_blkno, 7, \ (____eb)->h_signature); \ } while (0); @@ -379,8 +379,8 @@ static inline int ocfs2_is_soft_readonly(struct ocfs2_super *osb) #define OCFS2_RO_ON_INVALID_GROUP_DESC(__sb, __gd) do { \ typeof(__gd) ____gd = (__gd); \ ocfs2_error((__sb), \ - "Group Descriptor # %"MLFu64" has bad signature %.*s", \ - (____gd)->bg_blkno, 7, \ + "Group Descriptor # %llu has bad signature %.*s", \ + (unsigned long long)(____gd)->bg_blkno, 7, \ (____gd)->bg_signature); \ } while (0); diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index c46c164aefb..195523090c8 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -157,8 +157,9 @@ static int ocfs2_block_group_fill(struct ocfs2_journal_handle *handle, mlog_entry_void(); if (((unsigned long long) bg_bh->b_blocknr) != group_blkno) { - ocfs2_error(alloc_inode->i_sb, "group block (%"MLFu64") " - "!= b_blocknr (%llu)", group_blkno, + ocfs2_error(alloc_inode->i_sb, "group block (%llu) != " + "b_blocknr (%llu)", + (unsigned long long)group_blkno, (unsigned long long) bg_bh->b_blocknr); status = -EIO; goto bail; @@ -280,8 +281,8 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb, /* setup the group */ bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off); - mlog(0, "new descriptor, record %u, at block %"MLFu64"\n", - alloc_rec, bg_blkno); + mlog(0, "new descriptor, record %u, at block %llu\n", + alloc_rec, (unsigned long long)bg_blkno); bg_bh = sb_getblk(osb->sb, bg_blkno); if (!bg_bh) { @@ -382,8 +383,8 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb, goto bail; } if (!(fe->i_flags & cpu_to_le32(OCFS2_CHAIN_FL))) { - ocfs2_error(alloc_inode->i_sb, "Invalid chain allocator " - "# %"MLFu64, le64_to_cpu(fe->i_blkno)); + ocfs2_error(alloc_inode->i_sb, "Invalid chain allocator %llu", + (unsigned long long)le64_to_cpu(fe->i_blkno)); status = -EIO; goto bail; } @@ -829,9 +830,10 @@ static int ocfs2_relink_block_group(struct ocfs2_journal_handle *handle, goto out; } - mlog(0, "In suballoc %"MLFu64", chain %u, move group %"MLFu64" to " - "top, prev = %"MLFu64"\n", - fe->i_blkno, chain, bg->bg_blkno, prev_bg->bg_blkno); + mlog(0, "Suballoc %llu, chain %u, move group %llu to top, prev = %llu\n", + (unsigned long long)fe->i_blkno, chain, + (unsigned long long)bg->bg_blkno, + (unsigned long long)prev_bg->bg_blkno); fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].c_blkno); bg_ptr = le64_to_cpu(bg->bg_next_group); @@ -974,8 +976,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, struct ocfs2_group_desc *bg; chain = ac->ac_chain; - mlog(0, "trying to alloc %u bits from chain %u, inode %"MLFu64"\n", - bits_wanted, chain, OCFS2_I(alloc_inode)->ip_blkno); + mlog(0, "trying to alloc %u bits from chain %u, inode %llu\n", + bits_wanted, chain, + (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno); status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb), le64_to_cpu(cl->cl_recs[chain].c_blkno), @@ -1027,8 +1030,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, goto bail; } - mlog(0, "alloc succeeds: we give %u bits from block group %"MLFu64"\n", - tmp_bits, bg->bg_blkno); + mlog(0, "alloc succeeds: we give %u bits from block group %llu\n", + tmp_bits, (unsigned long long)bg->bg_blkno); *num_bits = tmp_bits; @@ -1092,8 +1095,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, goto bail; } - mlog(0, "Allocated %u bits from suballocator %"MLFu64"\n", - *num_bits, fe->i_blkno); + mlog(0, "Allocated %u bits from suballocator %llu\n", *num_bits, + (unsigned long long)fe->i_blkno); *bg_blkno = le64_to_cpu(bg->bg_blkno); bail: @@ -1134,9 +1137,9 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb, } if (le32_to_cpu(fe->id1.bitmap1.i_used) >= le32_to_cpu(fe->id1.bitmap1.i_total)) { - ocfs2_error(osb->sb, "Chain allocator dinode %"MLFu64" has %u" - "used bits but only %u total.", - le64_to_cpu(fe->i_blkno), + ocfs2_error(osb->sb, "Chain allocator dinode %llu has %u used " + "bits but only %u total.", + (unsigned long long)le64_to_cpu(fe->i_blkno), le32_to_cpu(fe->id1.bitmap1.i_used), le32_to_cpu(fe->id1.bitmap1.i_total)); status = -EIO; @@ -1479,10 +1482,9 @@ static int ocfs2_free_suballoc_bits(struct ocfs2_journal_handle *handle, } BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); - mlog(0, "suballocator %"MLFu64": freeing %u bits from group %"MLFu64 - ", starting at %u\n", - OCFS2_I(alloc_inode)->ip_blkno, count, bg_blkno, - start_bit); + mlog(0, "%llu: freeing %u bits from group %llu, starting at %u\n", + (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count, + (unsigned long long)bg_blkno, start_bit); status = ocfs2_read_block(osb, bg_blkno, &group_bh, OCFS2_BH_CACHED, alloc_inode); @@ -1592,10 +1594,10 @@ int ocfs2_free_clusters(struct ocfs2_journal_handle *handle, ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno, &bg_start_bit); - mlog(0, "want to free %u clusters starting at block %"MLFu64"\n", - num_clusters, start_blk); - mlog(0, "bg_blkno = %"MLFu64", bg_start_bit = %u\n", - bg_blkno, bg_start_bit); + mlog(0, "want to free %u clusters starting at block %llu\n", + num_clusters, (unsigned long long)start_blk); + mlog(0, "bg_blkno = %llu, bg_start_bit = %u\n", + (unsigned long long)bg_blkno, bg_start_bit); status = ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh, bg_start_bit, bg_blkno, @@ -1616,18 +1618,22 @@ static inline void ocfs2_debug_bg(struct ocfs2_group_desc *bg) printk("bg_free_bits_count: %u\n", bg->bg_free_bits_count); printk("bg_chain: %u\n", bg->bg_chain); printk("bg_generation: %u\n", le32_to_cpu(bg->bg_generation)); - printk("bg_next_group: %"MLFu64"\n", bg->bg_next_group); - printk("bg_parent_dinode: %"MLFu64"\n", bg->bg_parent_dinode); - printk("bg_blkno: %"MLFu64"\n", bg->bg_blkno); + printk("bg_next_group: %llu\n", + (unsigned long long)bg->bg_next_group); + printk("bg_parent_dinode: %llu\n", + (unsigned long long)bg->bg_parent_dinode); + printk("bg_blkno: %llu\n", + (unsigned long long)bg->bg_blkno); } static inline void ocfs2_debug_suballoc_inode(struct ocfs2_dinode *fe) { int i; - printk("Suballoc Inode %"MLFu64":\n", fe->i_blkno); + printk("Suballoc Inode %llu:\n", (unsigned long long)fe->i_blkno); printk("i_signature: %s\n", fe->i_signature); - printk("i_size: %"MLFu64"\n", fe->i_size); + printk("i_size: %llu\n", + (unsigned long long)fe->i_size); printk("i_clusters: %u\n", fe->i_clusters); printk("i_generation: %u\n", le32_to_cpu(fe->i_generation)); @@ -1645,7 +1651,7 @@ static inline void ocfs2_debug_suballoc_inode(struct ocfs2_dinode *fe) fe->id2.i_chain.cl_recs[i].c_free); printk("fe->id2.i_chain.cl_recs[%d].c_total: %u\n", i, fe->id2.i_chain.cl_recs[i].c_total); - printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %"MLFu64"\n", i, - fe->id2.i_chain.cl_recs[i].c_blkno); + printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %llu\n", i, + (unsigned long long)fe->id2.i_chain.cl_recs[i].c_blkno); } } diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 8dd3aafec49..949b3dac30f 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -950,16 +950,18 @@ static void ocfs2_inode_init_once(void *data, static int ocfs2_initialize_mem_caches(void) { ocfs2_inode_cachep = kmem_cache_create("ocfs2_inode_cache", - sizeof(struct ocfs2_inode_info), - 0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, - ocfs2_inode_init_once, NULL); + sizeof(struct ocfs2_inode_info), + 0, + (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| + SLAB_MEM_SPREAD), + ocfs2_inode_init_once, NULL); if (!ocfs2_inode_cachep) return -ENOMEM; ocfs2_lock_cache = kmem_cache_create("ocfs2_lock", sizeof(struct ocfs2_journal_lock), 0, - SLAB_NO_REAP|SLAB_HWCACHE_ALIGN, + SLAB_HWCACHE_ALIGN, NULL, NULL); if (!ocfs2_lock_cache) return -ENOMEM; @@ -1426,8 +1428,9 @@ static int ocfs2_initialize_super(struct super_block *sb, osb->fs_generation = le32_to_cpu(di->i_fs_generation); mlog(0, "vol_label: %s\n", osb->vol_label); mlog(0, "uuid: %s\n", osb->uuid_str); - mlog(0, "root_blkno=%"MLFu64", system_dir_blkno=%"MLFu64"\n", - osb->root_blkno, osb->system_dir_blkno); + mlog(0, "root_blkno=%llu, system_dir_blkno=%llu\n", + (unsigned long long)osb->root_blkno, + (unsigned long long)osb->system_dir_blkno); osb->osb_dlm_debug = ocfs2_new_dlm_debug(); if (!osb->osb_dlm_debug) { @@ -1470,8 +1473,8 @@ static int ocfs2_initialize_super(struct super_block *sb, osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.cl_cpg); osb->num_clusters = le32_to_cpu(di->id1.bitmap1.i_total); brelse(bitmap_bh); - mlog(0, "cluster bitmap inode: %"MLFu64", clusters per group: %u\n", - osb->bitmap_blkno, osb->bitmap_cpg); + mlog(0, "cluster bitmap inode: %llu, clusters per group: %u\n", + (unsigned long long)osb->bitmap_blkno, osb->bitmap_cpg); status = ocfs2_init_slot_info(osb); if (status < 0) { @@ -1529,8 +1532,9 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di, OCFS2_MINOR_REV_LEVEL); } else if (bh->b_blocknr != le64_to_cpu(di->i_blkno)) { mlog(ML_ERROR, "bad block number on superblock: " - "found %"MLFu64", should be %llu\n", - di->i_blkno, (unsigned long long)bh->b_blocknr); + "found %llu, should be %llu\n", + (unsigned long long)di->i_blkno, + (unsigned long long)bh->b_blocknr); } else if (le32_to_cpu(di->id2.i_super.s_clustersize_bits) < 12 || le32_to_cpu(di->id2.i_super.s_clustersize_bits) > 20) { mlog(ML_ERROR, "bad cluster size found: %u\n", diff --git a/fs/ocfs2/super.h b/fs/ocfs2/super.h index c564177dfbd..783f5270f2a 100644 --- a/fs/ocfs2/super.h +++ b/fs/ocfs2/super.h @@ -33,12 +33,16 @@ int ocfs2_publish_get_mount_state(struct ocfs2_super *osb, void __ocfs2_error(struct super_block *sb, const char *function, - const char *fmt, ...); + const char *fmt, ...) + __attribute__ ((format (printf, 3, 4))); + #define ocfs2_error(sb, fmt, args...) __ocfs2_error(sb, __PRETTY_FUNCTION__, fmt, ##args) void __ocfs2_abort(struct super_block *sb, const char *function, - const char *fmt, ...); + const char *fmt, ...) + __attribute__ ((format (printf, 3, 4))); + #define ocfs2_abort(sb, fmt, args...) __ocfs2_abort(sb, __PRETTY_FUNCTION__, fmt, ##args) #endif /* OCFS2_SUPER_H */ diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c index 300b5bedfb2..04a684dfdd9 100644 --- a/fs/ocfs2/uptodate.c +++ b/fs/ocfs2/uptodate.c @@ -119,8 +119,8 @@ void ocfs2_metadata_cache_purge(struct inode *inode) tree = !(oi->ip_flags & OCFS2_INODE_CACHE_INLINE); to_purge = ci->ci_num_cached; - mlog(0, "Purge %u %s items from Inode %"MLFu64"\n", to_purge, - tree ? "array" : "tree", oi->ip_blkno); + mlog(0, "Purge %u %s items from Inode %llu\n", to_purge, + tree ? "array" : "tree", (unsigned long long)oi->ip_blkno); /* If we're a tree, save off the root so that we can safely * initialize the cache. We do the work to free tree members @@ -136,8 +136,8 @@ void ocfs2_metadata_cache_purge(struct inode *inode) * easily detect counting errors. Unfortunately, this is only * meaningful for trees. */ if (tree && purged != to_purge) - mlog(ML_ERROR, "Inode %"MLFu64", count = %u, purged = %u\n", - oi->ip_blkno, to_purge, purged); + mlog(ML_ERROR, "Inode %llu, count = %u, purged = %u\n", + (unsigned long long)oi->ip_blkno, to_purge, purged); } /* Returns the index in the cache array, -1 if not found. @@ -186,8 +186,9 @@ static int ocfs2_buffer_cached(struct ocfs2_inode_info *oi, spin_lock(&oi->ip_lock); - mlog(0, "Inode %"MLFu64", query block %llu (inline = %u)\n", - oi->ip_blkno, (unsigned long long) bh->b_blocknr, + mlog(0, "Inode %llu, query block %llu (inline = %u)\n", + (unsigned long long)oi->ip_blkno, + (unsigned long long) bh->b_blocknr, !!(oi->ip_flags & OCFS2_INODE_CACHE_INLINE)); if (oi->ip_flags & OCFS2_INODE_CACHE_INLINE) @@ -293,12 +294,12 @@ static void ocfs2_expand_cache(struct ocfs2_inode_info *oi, struct ocfs2_caching_info *ci = &oi->ip_metadata_cache; mlog_bug_on_msg(ci->ci_num_cached != OCFS2_INODE_MAX_CACHE_ARRAY, - "Inode %"MLFu64", num cached = %u, should be %u\n", - oi->ip_blkno, ci->ci_num_cached, + "Inode %llu, num cached = %u, should be %u\n", + (unsigned long long)oi->ip_blkno, ci->ci_num_cached, OCFS2_INODE_MAX_CACHE_ARRAY); mlog_bug_on_msg(!(oi->ip_flags & OCFS2_INODE_CACHE_INLINE), - "Inode %"MLFu64" not marked as inline anymore!\n", - oi->ip_blkno); + "Inode %llu not marked as inline anymore!\n", + (unsigned long long)oi->ip_blkno); assert_spin_locked(&oi->ip_lock); /* Be careful to initialize the tree members *first* because @@ -316,8 +317,8 @@ static void ocfs2_expand_cache(struct ocfs2_inode_info *oi, tree[i] = NULL; } - mlog(0, "Expanded %"MLFu64" to a tree cache: flags 0x%x, num = %u\n", - oi->ip_blkno, oi->ip_flags, ci->ci_num_cached); + mlog(0, "Expanded %llu to a tree cache: flags 0x%x, num = %u\n", + (unsigned long long)oi->ip_blkno, oi->ip_flags, ci->ci_num_cached); } /* Slow path function - memory allocation is necessary. See the @@ -332,8 +333,9 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_inode_info *oi, struct ocfs2_meta_cache_item *tree[OCFS2_INODE_MAX_CACHE_ARRAY] = { NULL, }; - mlog(0, "Inode %"MLFu64", block %llu, expand = %d\n", - oi->ip_blkno, (unsigned long long) block, expand_tree); + mlog(0, "Inode %llu, block %llu, expand = %d\n", + (unsigned long long)oi->ip_blkno, + (unsigned long long)block, expand_tree); new = kmem_cache_alloc(ocfs2_uptodate_cachep, GFP_KERNEL); if (!new) { @@ -414,8 +416,9 @@ void ocfs2_set_buffer_uptodate(struct inode *inode, if (ocfs2_buffer_cached(oi, bh)) return; - mlog(0, "Inode %"MLFu64", inserting block %llu\n", oi->ip_blkno, - (unsigned long long) bh->b_blocknr); + mlog(0, "Inode %llu, inserting block %llu\n", + (unsigned long long)oi->ip_blkno, + (unsigned long long)bh->b_blocknr); /* No need to recheck under spinlock - insertion is guarded by * ip_io_mutex */ @@ -504,8 +507,9 @@ void ocfs2_remove_from_cache(struct inode *inode, struct ocfs2_caching_info *ci = &oi->ip_metadata_cache; spin_lock(&oi->ip_lock); - mlog(0, "Inode %"MLFu64", remove %llu, items = %u, array = %u\n", - oi->ip_blkno, (unsigned long long) block, ci->ci_num_cached, + mlog(0, "Inode %llu, remove %llu, items = %u, array = %u\n", + (unsigned long long)oi->ip_blkno, + (unsigned long long) block, ci->ci_num_cached, oi->ip_flags & OCFS2_INODE_CACHE_INLINE); if (oi->ip_flags & OCFS2_INODE_CACHE_INLINE) { diff --git a/fs/ocfs2/vote.c b/fs/ocfs2/vote.c index 021978e0576..53049a20419 100644 --- a/fs/ocfs2/vote.c +++ b/fs/ocfs2/vote.c @@ -190,20 +190,21 @@ static int ocfs2_process_delete_request(struct inode *inode, OCFS2_INVALID_SLOT && OCFS2_I(inode)->ip_orphaned_slot != (*orphaned_slot), - "Inode %"MLFu64": This node thinks it's " + "Inode %llu: This node thinks it's " "orphaned in slot %d, messaged it's in %d\n", - OCFS2_I(inode)->ip_blkno, + (unsigned long long)OCFS2_I(inode)->ip_blkno, OCFS2_I(inode)->ip_orphaned_slot, *orphaned_slot); - mlog(0, "Setting orphaned slot for inode %"MLFu64" to %d\n", - OCFS2_I(inode)->ip_blkno, *orphaned_slot); + mlog(0, "Setting orphaned slot for inode %llu to %d\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, + *orphaned_slot); OCFS2_I(inode)->ip_orphaned_slot = *orphaned_slot; } else { - mlog(0, "Sending back orphaned slot %d for inode %"MLFu64"\n", + mlog(0, "Sending back orphaned slot %d for inode %llu\n", OCFS2_I(inode)->ip_orphaned_slot, - OCFS2_I(inode)->ip_blkno); + (unsigned long long)OCFS2_I(inode)->ip_blkno); *orphaned_slot = OCFS2_I(inode)->ip_orphaned_slot; } @@ -226,8 +227,8 @@ static int ocfs2_process_delete_request(struct inode *inode, } if (filemap_fdatawrite(inode->i_mapping)) { - mlog(ML_ERROR, "Could not sync inode %"MLFu64" for delete!\n", - OCFS2_I(inode)->ip_blkno); + mlog(ML_ERROR, "Could not sync inode %llu for delete!\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno); goto done; } sync_mapping_buffers(inode->i_mapping); @@ -302,8 +303,8 @@ static void ocfs2_process_dentry_request(struct inode *inode, struct list_head *p; struct ocfs2_inode_info *oi = OCFS2_I(inode); - mlog(0, "parent %"MLFu64", namelen = %u, name = %.*s\n", parent_blkno, - namelen, namelen, name); + mlog(0, "parent %llu, namelen = %u, name = %.*s\n", + (unsigned long long)parent_blkno, namelen, namelen, name); spin_lock(&dcache_lock); @@ -370,9 +371,10 @@ static void ocfs2_process_vote(struct ocfs2_super *osb, if (request == OCFS2_VOTE_REQ_DELETE) orphaned_slot = be32_to_cpu(msg->md1.v_orphaned_slot); - mlog(0, "processing vote: request = %u, blkno = %"MLFu64", " + mlog(0, "processing vote: request = %u, blkno = %llu, " "generation = %u, node_num = %u, priv1 = %u\n", request, - blkno, generation, node_num, be32_to_cpu(msg->md1.v_generic1)); + (unsigned long long)blkno, generation, node_num, + be32_to_cpu(msg->md1.v_generic1)); if (!ocfs2_is_valid_vote_request(request)) { mlog(ML_ERROR, "Invalid vote request %d from node %u\n", @@ -419,11 +421,12 @@ static void ocfs2_process_vote(struct ocfs2_super *osb, * we had not found an inode in the first place. */ if (inode->i_generation != generation) { mlog(0, "generation passed %u != inode generation = %u, " - "ip_flags = %x, ip_blkno = %"MLFu64", msg %"MLFu64", " - "i_count = %u, message type = %u\n", - generation, inode->i_generation, OCFS2_I(inode)->ip_flags, - OCFS2_I(inode)->ip_blkno, blkno, - atomic_read(&inode->i_count), request); + "ip_flags = %x, ip_blkno = %llu, msg %llu, i_count = %u, " + "message type = %u\n", generation, inode->i_generation, + OCFS2_I(inode)->ip_flags, + (unsigned long long)OCFS2_I(inode)->ip_blkno, + (unsigned long long)blkno, atomic_read(&inode->i_count), + request); iput(inode); inode = NULL; goto respond; @@ -830,8 +833,9 @@ static void ocfs2_delete_response_cb(void *priv, orphaned_slot = be32_to_cpu(resp->r_orphaned_slot); node = be32_to_cpu(resp->r_hdr.h_node_num); - mlog(0, "node %d tells us that inode %"MLFu64" is orphaned in slot " - "%d\n", node, OCFS2_I(inode)->ip_blkno, orphaned_slot); + mlog(0, "node %d tells us that inode %llu is orphaned in slot %d\n", + node, (unsigned long long)OCFS2_I(inode)->ip_blkno, + orphaned_slot); /* The other node may not actually know which slot the inode * is orphaned in. */ @@ -845,9 +849,9 @@ static void ocfs2_delete_response_cb(void *priv, spin_lock(&OCFS2_I(inode)->ip_lock); mlog_bug_on_msg(OCFS2_I(inode)->ip_orphaned_slot != orphaned_slot && OCFS2_I(inode)->ip_orphaned_slot - != OCFS2_INVALID_SLOT, "Inode %"MLFu64": Node %d " - "says it's orphaned in slot %d, we think it's in %d\n", - OCFS2_I(inode)->ip_blkno, + != OCFS2_INVALID_SLOT, "Inode %llu: Node %d says it's " + "orphaned in slot %d, we think it's in %d\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, be32_to_cpu(resp->r_hdr.h_node_num), orphaned_slot, OCFS2_I(inode)->ip_orphaned_slot); @@ -869,8 +873,8 @@ int ocfs2_request_delete_vote(struct inode *inode) delete_cb.rc_cb = ocfs2_delete_response_cb; delete_cb.rc_priv = inode; - mlog(0, "Inode %"MLFu64", we start thinking orphaned slot is %d\n", - OCFS2_I(inode)->ip_blkno, orphaned_slot); + mlog(0, "Inode %llu, we start thinking orphaned slot is %d\n", + (unsigned long long)OCFS2_I(inode)->ip_blkno, orphaned_slot); status = -ENOMEM; request = ocfs2_new_vote_request(osb, OCFS2_I(inode)->ip_blkno, @@ -895,8 +899,8 @@ static void ocfs2_setup_unlink_vote(struct ocfs2_vote_msg *request, * d_delete against it. Parent directory block and full name * should suffice. */ - mlog(0, "unlink/rename request: parent: %"MLFu64" name: %.*s\n", - OCFS2_I(parent)->ip_blkno, dentry->d_name.len, + mlog(0, "unlink/rename request: parent: %llu name: %.*s\n", + (unsigned long long)OCFS2_I(parent)->ip_blkno, dentry->d_name.len, dentry->d_name.name); request->v_unlink_parent = cpu_to_be64(OCFS2_I(parent)->ip_blkno); @@ -1082,7 +1086,8 @@ static int ocfs2_handle_response_message(struct o2net_msg *msg, mlog(0, "received response message:\n"); mlog(0, "h_response_id = %u\n", response_id); mlog(0, "h_request = %u\n", be32_to_cpu(resp->r_hdr.h_request)); - mlog(0, "h_blkno = %"MLFu64"\n", be64_to_cpu(resp->r_hdr.h_blkno)); + mlog(0, "h_blkno = %llu\n", + (unsigned long long)be64_to_cpu(resp->r_hdr.h_blkno)); mlog(0, "h_generation = %u\n", be32_to_cpu(resp->r_hdr.h_generation)); mlog(0, "h_node_num = %u\n", node_num); mlog(0, "r_response = %d\n", response_status); @@ -1138,8 +1143,8 @@ static int ocfs2_handle_vote_message(struct o2net_msg *msg, mlog(0, "h_response_id = %u\n", be32_to_cpu(work->w_msg.v_hdr.h_response_id)); mlog(0, "h_request = %u\n", be32_to_cpu(work->w_msg.v_hdr.h_request)); - mlog(0, "h_blkno = %"MLFu64"\n", - be64_to_cpu(work->w_msg.v_hdr.h_blkno)); + mlog(0, "h_blkno = %llu\n", + (unsigned long long)be64_to_cpu(work->w_msg.v_hdr.h_blkno)); mlog(0, "h_generation = %u\n", be32_to_cpu(work->w_msg.v_hdr.h_generation)); mlog(0, "h_node_num = %u\n", |