Lines 191-196
int inode_init_always(struct super_block *sb, struct inode *inode)
Link Here
|
191 |
inode->i_mapping = mapping; |
191 |
inode->i_mapping = mapping; |
192 |
#ifdef CONFIG_FS_POSIX_ACL |
192 |
#ifdef CONFIG_FS_POSIX_ACL |
193 |
inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; |
193 |
inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; |
|
|
194 |
// inode->i_dbg1 = inode->i_dbg2 = ACL_NOT_CACHED; |
194 |
#endif |
195 |
#endif |
195 |
|
196 |
|
196 |
#ifdef CONFIG_FSNOTIFY |
197 |
#ifdef CONFIG_FSNOTIFY |
Lines 229-245
static struct inode *alloc_inode(struct super_block *sb)
Link Here
|
229 |
return inode; |
230 |
return inode; |
230 |
} |
231 |
} |
231 |
|
232 |
|
|
|
233 |
static void inode_print_path(struct inode *inode) |
234 |
{ |
235 |
struct dentry *dp; |
236 |
|
237 |
dp = d_find_alias(inode); |
238 |
if (dp) { |
239 |
char buf[80]; |
240 |
char *path; |
241 |
|
242 |
path = dentry_path(dp, buf, sizeof(buf)); |
243 |
|
244 |
printk(KERN_ERR "ipath %s\n", IS_ERR(path)?"toolong":path); |
245 |
} |
246 |
} |
247 |
|
248 |
static int inode_check_acl(struct inode *inode) |
249 |
{ |
250 |
int rc = 0; |
251 |
|
252 |
#ifdef CONFIG_FS_POSIX_ACL |
253 |
if (bad_acl_pointer(inode->i_acl)) { |
254 |
printk(KERN_ERR "bad i_acl pointer = %p\n", inode->i_acl); |
255 |
inode_print_path(inode); |
256 |
rc |= 1; |
257 |
} |
258 |
if (bad_acl_pointer(inode->i_default_acl)) { |
259 |
printk(KERN_ERR "bad i_default_acl pointer = %p\n", |
260 |
inode->i_default_acl); |
261 |
inode_print_path(inode); |
262 |
rc |=2; |
263 |
} |
264 |
// if (inode->i_dbg1 != ACL_NOT_CACHED) { |
265 |
// printk(KERN_ERR "bad ptr before = %p\n", inode->i_dbg1); |
266 |
// rc |= 4; |
267 |
// } |
268 |
// if (inode->i_dbg2 != ACL_NOT_CACHED) { |
269 |
// printk(KERN_ERR "bad ptr after = %p\n", inode->i_dbg2); |
270 |
// rc |= 8; |
271 |
// } |
272 |
if (rc) { |
273 |
printk(KERN_ERR "inode(%p) ino(%lu) dev(%x)\n", |
274 |
inode, inode->i_ino, inode->i_rdev); |
275 |
} |
276 |
#endif |
277 |
return(rc); |
278 |
} |
279 |
|
232 |
void __destroy_inode(struct inode *inode) |
280 |
void __destroy_inode(struct inode *inode) |
233 |
{ |
281 |
{ |
|
|
282 |
int r = 0; |
283 |
|
234 |
BUG_ON(inode_has_buffers(inode)); |
284 |
BUG_ON(inode_has_buffers(inode)); |
235 |
ima_inode_free(inode); |
285 |
ima_inode_free(inode); |
236 |
security_inode_free(inode); |
286 |
security_inode_free(inode); |
237 |
fsnotify_inode_delete(inode); |
287 |
fsnotify_inode_delete(inode); |
238 |
#ifdef CONFIG_FS_POSIX_ACL |
288 |
#ifdef CONFIG_FS_POSIX_ACL |
239 |
if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED) |
289 |
r = inode_check_acl(inode); |
|
|
290 |
if (!(r & 1) && inode->i_acl && inode->i_acl != ACL_NOT_CACHED) |
240 |
posix_acl_release(inode->i_acl); |
291 |
posix_acl_release(inode->i_acl); |
241 |
if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED) |
292 |
if (!(r & 2) && inode->i_default_acl) { |
242 |
posix_acl_release(inode->i_default_acl); |
293 |
if (inode->i_default_acl != ACL_NOT_CACHED) |
|
|
294 |
posix_acl_release(inode->i_default_acl); |
295 |
} |
243 |
#endif |
296 |
#endif |
244 |
} |
297 |
} |
245 |
EXPORT_SYMBOL(__destroy_inode); |
298 |
EXPORT_SYMBOL(__destroy_inode); |
Lines 294-299
static void init_once(void *foo)
Link Here
|
294 |
*/ |
347 |
*/ |
295 |
void __iget(struct inode *inode) |
348 |
void __iget(struct inode *inode) |
296 |
{ |
349 |
{ |
|
|
350 |
inode_check_acl(inode); |
297 |
if (atomic_read(&inode->i_count)) { |
351 |
if (atomic_read(&inode->i_count)) { |
298 |
atomic_inc(&inode->i_count); |
352 |
atomic_inc(&inode->i_count); |
299 |
return; |
353 |
return; |