From: alebre <al...@us...> - 2011-01-16 16:53:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "kdfs". The branch, make_kdfs_compile has been updated via cc6fabae0376d5eeec74875ff1ea180a76b77433 (commit) from beed749ef6eadf71f1f48a7aa9f48f42fcc5d333 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cc6fabae0376d5eeec74875ff1ea180a76b77433 Author: ad <leb...@fr...> Date: Sun Jan 16 17:52:33 2011 +0000 kmalloc/kfree check - Adrien diff --git a/fs/kdfs/TODO b/fs/kdfs/TODO index 579c18f..9a19788 100644 --- a/fs/kdfs/TODO +++ b/fs/kdfs/TODO @@ -40,6 +40,10 @@ Prio. added added Type What 2 adrien 100819 ls -al upon a directory returns a wrong size (should be 4096, however the realsize of the directory is returned) 2 adrien 100819 ls -al upon a directory returns a wrong size (should be 4096, however the realsize of the directory is returned) 2 adrien 110106 Study directories/files deletions (why it is so long, some sets seem to be created why ? At the first sight, it should be avoided) +3 adrien 11014 Why rmdir generates a drop of all files that belong to the directories (drop of the cache and directory not empty, so rmdir failed but cache is flushed) +3 adrien 11014 Improve the management of directory entries (currently .content of a directory is not packed. It means that if you create thousand of files in one directory + and then delete them, the size of .content is not shrink). This is due to the readdir issue (fp-> pos can refer a wrong entry if some files have been deleted between two calls). + As a consequence, the management of directory entries in kDFS follows the ext2/ext3 approach (which is really non efficient in terms of both performance and space). DONE ~~~~ diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 4a90d2d..8166d37 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -909,6 +909,7 @@ int kdfs_iol_page_remove(void *object, struct kddm_set *set, objid_t objid) DEBUG(DBG_ALERT, "Page after count=%d\n", page_count(k_page->page)); } + kfree(k_page); PRINT_FUNCTION_EXIT; return 0; } diff --git a/fs/kdfs/debug_kdfs.h b/fs/kdfs/debug_kdfs.h index 7e23001..5b23c39 100644 --- a/fs/kdfs/debug_kdfs.h +++ b/fs/kdfs/debug_kdfs.h @@ -45,8 +45,11 @@ #else # define DEBUG(level, format, ...) \ do { \ - if (KDFS_DEBUG_LEVEL >= level) { \ - pr_debug("pid %d, %s, %d | %s @ %d | " format "", current->pid, current->comm, task_pid_knr(current), __func__, __LINE__, ##__VA_ARGS__); \ + if (KDFS_DEBUG_LEVEL >= level) { \ + if (level != DBG_PANIC && level != DBG_ALERT) \ + pr_debug("pid %d, %s, %d | %s @ %d | " format "", current->pid, current->comm, task_pid_knr(current), __func__, __LINE__, ##__VA_ARGS__); \ + else \ + printk("pid %d, %s, %d | %s @ %d | " format "", current->pid, current->comm, task_pid_knr(current), __func__, __LINE__, ##__VA_ARGS__); \ } \ if(level == DBG_PANIC)\ BUG();\ diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index 7468d21..a34d56f 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -854,7 +854,7 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) filp->f_pos, dir_entry->ino, kdfs_dt_type(dir_entry->mode)); if (res < 0) { /* filldir is over (cf. ext2_readdir), so a new dirent should be allocated by the kernel */ - DEBUG(DBG_ALERT, "Can't fill dirent or dirent is full (res=%d)\n",res); + DEBUG(DBG_TRACE, "Can't fill dirent or dirent is full (res=%d)\n",res); /* Get the directory entry */ kunmap(tmp_page); _kdfs_put_page(k_page); diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index 6440c2f..f277e51 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -283,6 +283,14 @@ size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) list_add_tail(&new_extent->list_item, &k_inode->extents_list); } close_phys_file(file); + + DEBUG(DBG_INFO, "\n\n\nLIST CONTENTS AFTER READ\n"); + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + } + } + } else { DEBUG(DBG_ALERT, "Can't access to the KDFS inode %lu\n" @@ -291,16 +299,7 @@ size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) } kfree(phys_filename); - - DEBUG(DBG_INFO, "\n\n\nLIST CONTENTS AFTER READ\n"); - if (!list_empty(&k_inode->extents_list)) { - list_for_each_entry(curr, &k_inode->extents_list, list_item) { - DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); - } - } - return 0; - } void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_fullnetinode *net_inode) diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index aa90b7d..95e05ce 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1191,12 +1191,6 @@ int kdfs_iol_inode_insert_object(kddm_obj_t *objEntry, insert_inode_hash(k_inode->inode); PRINT_FUNCTION_EXIT; return 0; - - /* TODO PRIORITY 1, Adrien: - * A bug can occur for the case where a remote node access to one object for the first time (get) - * This object is then inserted in the local set without setting its right reference according to its mode.... - * Is it possible ? - */ } diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index bcafba6..892d3a2 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1058,7 +1058,6 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod * @author Adrien Lebre * * @param inode The VFS inode - * @param sync ?? - but currently not used * */ int __kdfs_write_inode(struct kdfs_inode *k_inode) @@ -1108,13 +1107,15 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) kdfs_file_extent_dump_to_file(k_inode, file); close_phys_file(file); } else { - DEBUG (DBG_PANIC, - "Can't access/create the KDFS inode %lu metafile \nPlease "\ - "verify type of the partition %s, it should be a KDFS one "\ - " (error %ld)\n", inode->i_ino, - ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name, - PTR_ERR(file)); + DEBUG (DBG_ALERT, "Can't access/create the KDFS inode %lu metafile \n", inode->i_ino); res = PTR_ERR(file); + if(res == - ENOSPC) + DEBUG (DBG_ALERT, "No space left on device %s (please check inode and block free: df -i and df -k)\n",\ + ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name); + else + DEBUG (DBG_ALERT, "Please verify the error according to the kdfs partition %s "\ + " (error %ld)\n", ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name, + PTR_ERR(file)); } kfree(phys_filename); @@ -2001,21 +2002,14 @@ int kdfs_iol_sb_import (struct rpc_desc *desc, k_sb = kgsb->real_sb; __kdfs_import_kdfs_sb(k_sb, net_src); - /* Set to NULL all irrelevant pointer references */ - /* - * TODO PRIORITY 1, Adrien: - * One way to avoid non clusterwide field allocation - * consists in providing two different code for first_touch and - * alloc I/O linker function */ + /* Free and set to NULL all irrelevant pointer references + * (the ones that have not been imported cf. __kdfs_import_kdfs_sb) + */ if (kerrighed_node_id != k_sb->sb_nodeid) { k_sb->sb = NULL; -#if 0 - if(k_sb->inode_bitmap){ - kfree(k_sb->inode_bitmap); - k_sb->inode_bitmap=NULL; - } -#endif - if (k_sb->k_opt) { + + if (k_sb->k_opt) { + /* K_opt has been allocated during kdfs_iol_sb_alloc, so free it */ kfree(k_sb->k_opt); k_sb->k_opt = NULL; } @@ -2057,12 +2051,8 @@ int kdfs_iol_sb_remove(void *object, struct kddm_set *set, objid_t objid) } else { k_cw_sb = (struct kdfs_cw_sb *) object; if (k_cw_sb->cw_bitmap) { - if (k_cw_sb->cw_bitmap == NULL) - return 0; - - if (k_cw_sb->cw_bitmap->map != NULL) + if (k_cw_sb->cw_bitmap->map != NULL) kfree(k_cw_sb->cw_bitmap->map); - kfree(k_cw_sb->cw_bitmap); } kfree(k_cw_sb); ----------------------------------------------------------------------- Summary of changes: fs/kdfs/TODO | 4 ++++ fs/kdfs/address_space.c | 1 + fs/kdfs/debug_kdfs.h | 7 +++++-- fs/kdfs/dir.c | 2 +- fs/kdfs/file_extent.c | 17 ++++++++--------- fs/kdfs/inode.c | 6 ------ fs/kdfs/super.c | 40 +++++++++++++++------------------------- 7 files changed, 34 insertions(+), 43 deletions(-) hooks/post-receive -- kdfs |