1 # This is a BitKeeper generated patch for the following project:
2 # Project Name: Linux kernel tree
4 # fs/ext3/dir.c | 7 +++++--
5 # fs/ext3/namei.c | 11 +++++++----
6 # include/linux/ext3_fs.h | 2 +-
7 # 3 files changed, 13 insertions(+), 7 deletions(-)
9 # The following is the BitKeeper ChangeSet Log
10 # --------------------------------------------
11 # 02/11/07 tytso@snap.thunk.org 1.778
12 # Check for failed kmalloc() in ext3_htree_store_dirent()
14 # This patch checks for a failed kmalloc() in ext3_htree_store_dirent(),
15 # and passes the error up to its caller, ext3_htree_fill_tree().
16 # --------------------------------------------
18 diff -Nru a/fs/ext3/dir.c b/fs/ext3/dir.c
19 --- a/fs/ext3/dir.c Thu Nov 7 10:57:34 2002
20 +++ b/fs/ext3/dir.c Thu Nov 7 10:57:34 2002
23 * Given a directory entry, enter it into the fname rb tree.
25 -void ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
26 +int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
28 struct ext3_dir_entry_2 *dirent)
31 /* Create and allocate the fname structure */
32 len = sizeof(struct fname) + dirent->name_len + 1;
33 new_fn = kmalloc(len, GFP_KERNEL);
36 memset(new_fn, 0, len);
38 new_fn->minor_hash = minor_hash;
40 (new_fn->minor_hash == fname->minor_hash)) {
41 new_fn->next = fname->next;
47 if (new_fn->hash < fname->hash)
50 rb_link_node(&new_fn->rb_hash, parent, p);
51 rb_insert_color(&new_fn->rb_hash, &info->root);
56 diff -Nru a/fs/ext3/namei.c b/fs/ext3/namei.c
57 --- a/fs/ext3/namei.c Thu Nov 7 10:57:34 2002
58 +++ b/fs/ext3/namei.c Thu Nov 7 10:57:34 2002
60 /* Add '.' and '..' from the htree header */
61 if (!start_hash && !start_minor_hash) {
62 de = (struct ext3_dir_entry_2 *) frames[0].bh->b_data;
63 - ext3_htree_store_dirent(dir_file, 0, 0, de);
64 + if ((err = ext3_htree_store_dirent(dir_file, 0, 0, de)) != 0)
66 de = ext3_next_entry(de);
67 - ext3_htree_store_dirent(dir_file, 0, 0, de);
68 + if ((err = ext3_htree_store_dirent(dir_file, 0, 0, de)) != 0)
74 ((hinfo.hash == start_hash) &&
75 (hinfo.minor_hash < start_minor_hash)))
77 - ext3_htree_store_dirent(dir_file, hinfo.hash,
78 - hinfo.minor_hash, de);
79 + if ((err = ext3_htree_store_dirent(dir_file,
80 + hinfo.hash, hinfo.minor_hash, de)) != 0)
85 diff -Nru a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
86 --- a/include/linux/ext3_fs.h Thu Nov 7 10:57:34 2002
87 +++ b/include/linux/ext3_fs.h Thu Nov 7 10:57:34 2002
89 extern int ext3_check_dir_entry(const char *, struct inode *,
90 struct ext3_dir_entry_2 *,
91 struct buffer_head *, unsigned long);
92 -extern void ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
93 +extern int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
95 struct ext3_dir_entry_2 *dirent);
96 extern void ext3_htree_free_dir_info(struct dir_private_info *p);