|
From: alebre <al...@us...> - 2011-01-12 11:57:27
|
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 beed749ef6eadf71f1f48a7aa9f48f42fcc5d333 (commit)
from 0791354f11b2d8bb6090c786e3aca225cd795f22 (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 beed749ef6eadf71f1f48a7aa9f48f42fcc5d333
Author: ad <leb...@fr...>
Date: Wed Jan 12 11:43:09 2011 +0000
Fix lookup of directory entries (since the last change, we should check the value of ino and not only compare filenames) - Adrien
diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c
index eb82fa8..7468d21 100644
--- a/fs/kdfs/dir.c
+++ b/fs/kdfs/dir.c
@@ -102,8 +102,9 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file
/* Did we find the right entry */
DEBUG (DBG_INFO, "filelen %d dirfilelen %d, filename %s dirname %s, dirlen %d (dirino %lu)\n",
filename_len, dir_entry->name_len, filename, dir_entry->name,dir_entry->rec_len, dir_entry->ino);
- if (dir_entry->name_len == filename_len &&
- strncmp (dir_entry->name, filename, filename_len) == 0)
+ if (dir_entry->ino != KDFS_BAD_INODEID &&
+ dir_entry->name_len == filename_len &&
+ strncmp (dir_entry->name, filename, filename_len) == 0)
goto found;
/* Check if another dentry could be contained in the current page */
@@ -206,8 +207,9 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir,
DEBUG(DBG_INFO,
"file:%s (filename_len %d), dir:%s (dirfilename_len %d), dirlen %d (dirino %lu)\n",
filename, filename_len, dir_entry->name, dir_entry->name_len, dir_entry->rec_len, dir_entry->ino);
- if (dir_entry->name_len == filename_len &&
- strncmp (dir_entry->name, filename, filename_len) == 0)
+ if (dir_entry->ino != KDFS_BAD_INODEID &&
+ dir_entry->name_len == filename_len &&
+ strncmp (dir_entry->name, filename, filename_len) == 0)
goto found;
/* Check if another dentry could be contained in the current page */
@@ -724,7 +726,7 @@ int kdfs_dir_empty(struct kdfs_inode *k_dir)
dir_entry = (struct kdfs_dir_entry *) direntry_addr;
/* Did we find the right entry */
- if (dir_entry->ino != 0 ){
+ if (dir_entry->ino != KDFS_BAD_INODEID ){
res = 0;
break;
}
-----------------------------------------------------------------------
Summary of changes:
fs/kdfs/dir.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
hooks/post-receive
--
kdfs
|