3 @@ -86,8 +86,10 @@ int get_neg_sto_dentry(dentry_t *dentry)
4 len = dentry->d_name.len;
5 name = dentry->d_name.name;
7 + mutex_lock(&dtohd2(dentry->d_parent)->d_inode->i_mutex);
9 lookup_one_len(name, dtohd2(dentry->d_parent), len);
10 + mutex_unlock(&dtohd2(dentry->d_parent)->d_inode->i_mutex);
14 @@ -426,7 +428,9 @@ int build_sto_structure(dentry_t *dir, d
15 const unsigned char *name;
16 len = dtohd(dentry)->d_name.len;
17 name = dtohd(dentry)->d_name.name;
18 + mutex_lock(&dtohd2(dir)->d_inode->i_mutex);
19 hidden_sto_dentry = lookup_one_len(name, dtohd2(dir), len);
20 + mutex_unlock(&dtohd2(dir)->d_inode->i_mutex);
21 dtohd2(dentry) = hidden_sto_dentry;
24 --- a/fs/mini_fo/inode.c
25 +++ b/fs/mini_fo/inode.c
26 @@ -113,17 +113,23 @@ mini_fo_lookup(inode_t *dir, dentry_t *d
27 hidden_dir_dentry = hidden_dentry->d_parent;
30 - else if(hidden_dir_dentry && hidden_dir_dentry->d_inode)
31 + else if(hidden_dir_dentry && hidden_dir_dentry->d_inode) {
32 + mutex_lock(&hidden_dir_dentry->d_inode->i_mutex);
34 lookup_one_len(name, hidden_dir_dentry, namelen);
36 + mutex_unlock(&hidden_dir_dentry->d_inode->i_mutex);
41 - if(hidden_sto_dir_dentry && hidden_sto_dir_dentry->d_inode)
42 + if(hidden_sto_dir_dentry && hidden_sto_dir_dentry->d_inode) {
43 + mutex_lock(&hidden_sto_dir_dentry->d_inode->i_mutex);
45 lookup_one_len(name, hidden_sto_dir_dentry, namelen);
47 + mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
49 hidden_sto_dentry = NULL;
52 /* catch error in lookup */
53 if (IS_ERR(hidden_dentry) || IS_ERR(hidden_sto_dentry)) {
54 --- a/fs/mini_fo/meta.c
55 +++ b/fs/mini_fo/meta.c
56 @@ -43,9 +43,11 @@ int meta_build_lists(dentry_t *dentry)
58 /* might there be a META-file? */
59 if(dtohd2(dentry) && dtohd2(dentry)->d_inode) {
60 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
61 meta_dentry = lookup_one_len(META_FILENAME,
63 strlen(META_FILENAME));
64 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
65 if(!meta_dentry->d_inode) {
68 @@ -426,8 +428,11 @@ int meta_write_d_entry(dentry_t *dentry,
73 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
74 meta_dentry = lookup_one_len(META_FILENAME,
75 dtohd2(dentry), strlen (META_FILENAME));
76 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
78 /* We need to create a META-file */
79 if(!meta_dentry->d_inode) {
80 @@ -527,9 +532,13 @@ int meta_write_r_entry(dentry_t *dentry,
85 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
86 meta_dentry = lookup_one_len(META_FILENAME,
88 strlen (META_FILENAME));
89 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
91 if(!meta_dentry->d_inode) {
92 /* We need to create a META-file */
93 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
94 @@ -641,9 +650,14 @@ int meta_sync_d_list(dentry_t *dentry, i
99 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
100 meta_dentry = lookup_one_len(META_FILENAME,
102 strlen(META_FILENAME));
103 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
106 if(!meta_dentry->d_inode) {
107 /* We need to create a META-file */
108 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
109 @@ -784,9 +798,13 @@ int meta_sync_r_list(dentry_t *dentry, i
114 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
115 meta_dentry = lookup_one_len(META_FILENAME,
117 strlen(META_FILENAME));
118 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
120 if(!meta_dentry->d_inode) {
121 /* We need to create a META-file */
122 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)