|
From: alebre <al...@us...> - 2010-12-21 14:02:37
|
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 54d395e59a5fca78a4cfa9754497d3f156575924 (commit)
from 8d8c25a410ddabb5c0165caa6dc42e878e4644fa (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 54d395e59a5fca78a4cfa9754497d3f156575924
Author: ad <leb...@fr...>
Date: Tue Dec 21 12:27:37 2010 +0000
Fix stupid debugging error (PRINT_FUNCTION_NAME should still be called at the beginning of the function, please make a particular attention to variable initialization) - Make a workaround to fix stupid kddm_set creation during destroy_kddm_set call (this fix allows to delete a file clusterwide)
diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c
index a604aa5..0b10c46 100644
--- a/fs/kdfs/address_space.c
+++ b/fs/kdfs/address_space.c
@@ -288,9 +288,9 @@ int kdfs_releasepage(struct page *page, gfp_t mask)
{
struct kdfs_page *k_page;
- ASSERT (page->mapping != NULL);
PRINT_FUNCTION_NAME;
+ ASSERT (page->mapping != NULL);
k_page = (struct kdfs_page *) page->private;
DEBUG(DBG_INFO, "Gonna release page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id);
@@ -943,12 +943,16 @@ int kdfs_iol_content_instantiate(kddm_set_t *kddm_set, void *private_data, int m
int result = 0;
struct file *filp;
+ struct kdfs_super_block *k_sb;
+
+ PRINT_FUNCTION_NAME;
+
/* TODO NOW: Adrien */
/* Ugly, we decided to forbid calling kddm grab/get functions
* at such level in order to avoid deadlock
*/
- struct kdfs_super_block *k_sb = kdfs_getsb(kerrighed_node_id);
- PRINT_FUNCTION_NAME;
+
+ k_sb= kdfs_twice_getsb(kerrighed_node_id);
ASSERT(k_sb != NULL);
ASSERT(kddm_set != NULL);
@@ -1015,7 +1019,7 @@ int kdfs_iol_content_instantiate(kddm_set_t *kddm_set, void *private_data, int m
if (!content_data->k_mapping)
DEBUG(DBG_PANIC, "k_mapping was not cleanly initialized\n");
- __kdfs_putsb(k_sb);
+ __kdfs_twice_putsb(k_sb);
PRINT_FUNCTION_EXIT;
return result;
}
diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c
index 072b18f..5ebc699 100644
--- a/fs/kdfs/inode.c
+++ b/fs/kdfs/inode.c
@@ -370,7 +370,7 @@ int kdfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
} else {
/* Get the first file page to write the symb link into */
create_file_kddm_set(k_nnod);
- k_page = kdfs_distgrab_page(k_nnod->content_setid, 0);
+ k_page = kdfs_grab_distpage(k_nnod, 0);
if (IS_ERR(k_page))
DEBUG (DBG_PANIC,
"Can't grab page for newnode %ld (contentset_id %ld)\n",
@@ -910,16 +910,12 @@ struct inode_operations kdfs_symlink_inode_operations = {
/* Get a read only copy */
struct kdfs_inode *kdfs_iget(unsigned long ino)
{
- PRINT_FUNCTION_NAME;
- PRINT_FUNCTION_EXIT;
return kddm_get_object(kddm_def_ns, KDFS_INODE_KDDM_ID, ino);
}
/* Get the write master copy */
struct kdfs_inode *kdfs_igrab(unsigned long ino)
{
- PRINT_FUNCTION_NAME;
- PRINT_FUNCTION_EXIT;
return kddm_grab_object(kddm_def_ns, KDFS_INODE_KDDM_ID, ino);
}
@@ -1019,8 +1015,9 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry,
* Ugly, we decided to forbid calling kddm grab/get functions
* at such level in order to avoid deadlock
*/
- struct kdfs_super_block *k_sb = kdfs_twice_grabsb(kerrighed_node_id);
+ struct kdfs_super_block *k_sb ;
PRINT_FUNCTION_NAME;
+ k_sb = kdfs_twice_grabsb(kerrighed_node_id);
ASSERT(k_sb != NULL);
/*
diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c
index f450ef9..f8c979b 100644
--- a/fs/kdfs/physical_fs.c
+++ b/fs/kdfs/physical_fs.c
@@ -109,6 +109,7 @@ long create_phys_dir(const char *pathname,
out:
if (error != 0)
DEBUG(DBG_ALERT, "function EXIT: Physical operation does not succeed (error %d)\n",error);
+
__revert_old_creds(overridden_creds, old_creds);
return error;
diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c
index 7506a1d..66ba12d 100644
--- a/fs/kdfs/super.c
+++ b/fs/kdfs/super.c
@@ -148,9 +148,10 @@ int __kdfs_fill_sb(struct kdfs_super_block *k_sb)
int res = -1;
char *phys_filename = NULL;
+ PRINT_FUNCTION_NAME;
+
ASSERT(k_sb != NULL);
ASSERT(k_sb->k_opt != NULL);
- PRINT_FUNCTION_NAME;
/* Is there a kDFS partition? */
if (strcmp(k_sb->k_opt->part_name, "none") == 0) {
@@ -337,7 +338,6 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino)
kdfs_getphysicalpath(k_sb, ino, phys_dirname);
sprintf(phys_dirname, "%s/" KDFS_CONTENT_FILENAME, phys_dirname);
DEBUG(DBG_INFO, "Try to remove phys_file %s\n", phys_dirname);
-// UNE LIGNE IMPORTANTE QUI POSE UN PROBLEME PUISQU'IL EN DECOULE une inode a null et donc un fichier qui ne pourra etre fermé proprement dans kdfs_iol_content_uninstantiate
remove_phys_file(phys_dirname, 0, 0);
if (res){
DEBUG(DBG_ALERT, "Cannot remove phys file %s (res=%d)\n", phys_dirname, res);
@@ -853,7 +853,6 @@ int cw_bitmap_is_legit(void *data)
{
struct kdfs_cw_sb *ptr = (struct kdfs_cw_sb *)data;
- PRINT_FUNCTION_NAME;
if (ptr == NULL)
return 0;
@@ -1193,11 +1192,14 @@ void kdfs_delete_inode(struct inode *inode)
if (k_inode->content_setid != KDDM_SET_UNUSED) {
DEBUG(DBG_INFO, "kdfs gonna uninstantiate the set");
- destroy_kddm_set(kddm_def_ns, k_inode->content_setid);
+ // WARNING, the set should exist somewhere in the cluster
+ // Otherwise, we do not know what can happen from the kddm layer viewpoint
+ // cf. kddm_set.h - Adrien December 2010
+ __destroy_kddm_set(kddm_def_ns, k_inode->content_setid);
k_inode->content_setid = KDDM_SET_UNUSED;
}
-//DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete (pid: %d, %s, %d)\n", current->pid, current->comm,task_pid_knr(current) );
+DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete\n");
/* Cleanly remove inode from kddm inode set */
kdfs_idelete(inode->i_ino); // equivalent to kdfs_iput() and remove
diff --git a/include/kddm/kddm_set.h b/include/kddm/kddm_set.h
index 65a1372..de739ef 100644
--- a/include/kddm/kddm_set.h
+++ b/include/kddm/kddm_set.h
@@ -213,6 +213,10 @@ static inline struct kddm_set *create_new_kddm_set(struct kddm_ns *ns,
obj_size, NULL, 0, flags);
}
+// Added by Adrien to avoid kddm_set instantiation when destroy is called from one node that does not use the set.
+// December 2010 - cf. Kerrighed dev mailing list
+int __destroy_kddm_set(struct kddm_ns *ns, kddm_set_id_t set_id);
+
int _destroy_kddm_set(struct kddm_set * kddm_set);
int destroy_kddm_set(struct kddm_ns *ns, kddm_set_id_t set_id);
diff --git a/kddm/kddm_set.c b/kddm/kddm_set.c
index 38a7574..a85d5cd 100644
--- a/kddm/kddm_set.c
+++ b/kddm/kddm_set.c
@@ -376,9 +376,9 @@ struct kddm_set *__find_get_kddm_set(struct kddm_ns *ns,
*/
spin_lock(&kddm_set->lock);
- if (kddm_set->state == KDDM_SET_INVALID)
+ if (kddm_set->state == KDDM_SET_INVALID){
kddm_set->state = KDDM_SET_NEED_LOOKUP;
-
+}
goto check_no_lock;
recheck_state:
@@ -717,6 +717,25 @@ int handle_req_kddm_set_destroy(struct rpc_desc* desc,
/* High level function to destroy a kddm set. */
+// Added by Adrien to avoid kddm_set instantiation when destroy is called from one node that does not use the set.
+// December 2010 - cf. Kerrighed dev mailing list
+int __destroy_kddm_set(struct kddm_ns *ns, kddm_set_id_t set_id)
+{
+ kddm_id_msg_t kddm_id;
+
+ kddm_id.set_id = set_id;
+ kddm_id.ns_id = ns->id;
+
+ if (kddm_nb_nodes == 1)
+ return do_kddm_set_destroy(&kddm_id);
+
+ rpc_async_m(REQ_KDDM_SET_DESTROY, ns->rpc_comm, &krgnode_kddm_map,
+ &kddm_id, sizeof(kddm_id_msg_t));
+ return 0;
+}
+EXPORT_SYMBOL(__destroy_kddm_set);
+
+
int _destroy_kddm_set(struct kddm_set * kddm_set)
{
kddm_id_msg_t kddm_id;
@@ -726,10 +745,8 @@ int _destroy_kddm_set(struct kddm_set * kddm_set)
if (kddm_nb_nodes == 1)
return do_kddm_set_destroy(&kddm_id);
+
rpc_async_m(REQ_KDDM_SET_DESTROY, kddm_set->ns->rpc_comm, &krgnode_kddm_map,
-// Changed by Adrien, destroy should be synchrone (temporarily went back to
-// asynchronous call in order to resolve the file count issue during file deletion.
-// rpc_sync_m(REQ_KDDM_SET_DESTROY, kddm_set->ns->rpc_comm, &krgnode_kddm_map,
&kddm_id, sizeof(kddm_id_msg_t));
return 0;
}
-----------------------------------------------------------------------
Summary of changes:
fs/kdfs/address_space.c | 12 ++++++++----
fs/kdfs/inode.c | 9 +++------
fs/kdfs/physical_fs.c | 1 +
fs/kdfs/super.c | 12 +++++++-----
include/kddm/kddm_set.h | 4 ++++
kddm/kddm_set.c | 27 ++++++++++++++++++++++-----
6 files changed, 45 insertions(+), 20 deletions(-)
hooks/post-receive
--
kdfs
|