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 @@ -553,9 +559,11 @@ mini_fo_rmdir(inode_t *dir, dentry_t *de
57 /* Delete an old WOL file contained in the storage dir */
58 + mutex_lock(&hidden_sto_dentry->d_inode->i_mutex);
59 meta_dentry = lookup_one_len(META_FILENAME,
61 strlen(META_FILENAME));
62 + mutex_unlock(&hidden_sto_dentry->d_inode->i_mutex);
63 if(meta_dentry->d_inode) {
64 err = vfs_unlink(hidden_sto_dentry->d_inode, meta_dentry);
66 @@ -643,9 +651,11 @@ mini_fo_rmdir(inode_t *dir, dentry_t *de
69 /* Delete an old WOL file contained in the storage dir */
70 + mutex_lock(&hidden_sto_dentry->d_inode->i_mutex);
71 meta_dentry = lookup_one_len(META_FILENAME,
73 strlen(META_FILENAME));
74 + mutex_unlock(&hidden_sto_dentry->d_inode->i_mutex);
75 if(meta_dentry->d_inode) {
76 /* is this necessary? dget(meta_dentry); */
77 err = vfs_unlink(hidden_sto_dentry->d_inode,
78 @@ -688,9 +698,11 @@ mini_fo_rmdir(inode_t *dir, dentry_t *de
81 /* Delete an old WOL file contained in the storage dir */
82 + mutex_lock(&hidden_sto_dentry->d_inode->i_mutex);
83 meta_dentry = lookup_one_len(META_FILENAME,
85 strlen(META_FILENAME));
86 + mutex_unlock(&hidden_sto_dentry->d_inode->i_mutex);
87 if(meta_dentry->d_inode) {
88 /* is this necessary? dget(meta_dentry); */
89 err = vfs_unlink(hidden_sto_dentry->d_inode,
90 --- a/fs/mini_fo/meta.c
91 +++ b/fs/mini_fo/meta.c
92 @@ -43,9 +43,11 @@ int meta_build_lists(dentry_t *dentry)
94 /* might there be a META-file? */
95 if(dtohd2(dentry) && dtohd2(dentry)->d_inode) {
96 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
97 meta_dentry = lookup_one_len(META_FILENAME,
99 strlen(META_FILENAME));
100 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
101 if(!meta_dentry->d_inode) {
104 @@ -426,8 +428,11 @@ int meta_write_d_entry(dentry_t *dentry,
109 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
110 meta_dentry = lookup_one_len(META_FILENAME,
111 dtohd2(dentry), strlen (META_FILENAME));
112 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
114 /* We need to create a META-file */
115 if(!meta_dentry->d_inode) {
116 @@ -527,9 +532,13 @@ int meta_write_r_entry(dentry_t *dentry,
121 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
122 meta_dentry = lookup_one_len(META_FILENAME,
124 strlen (META_FILENAME));
125 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
127 if(!meta_dentry->d_inode) {
128 /* We need to create a META-file */
129 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
130 @@ -641,9 +650,13 @@ int meta_sync_d_list(dentry_t *dentry, i
135 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
136 meta_dentry = lookup_one_len(META_FILENAME,
138 strlen(META_FILENAME));
139 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
141 if(!meta_dentry->d_inode) {
142 /* We need to create a META-file */
143 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
144 @@ -784,9 +797,13 @@ int meta_sync_r_list(dentry_t *dentry, i
149 + mutex_lock(&dtohd2(dentry)->d_inode->i_mutex);
150 meta_dentry = lookup_one_len(META_FILENAME,
152 strlen(META_FILENAME));
153 + mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
155 if(!meta_dentry->d_inode) {
156 /* We need to create a META-file */
157 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)