Skip to content
Snippets Groups Projects
Commit 29a9b5d7 authored by Wang Di's avatar Wang Di
Browse files

Update smfs: 1.fix bugs in smfs_link 2) decrease i_count in smfs_clear_inode

parent 54a131fd
No related merge requests found
......@@ -215,6 +215,8 @@ static int smfs_link(struct dentry * old_dentry,
rc = cache_dir->i_op->link(&cache_old_dentry, cache_dir, &cache_dentry);
if (rc == 0) {
atomic_inc(&inode->i_count);
duplicate_inode(cache_old_dentry.d_inode, inode);
d_instantiate(dentry, inode);
}
......
......@@ -73,6 +73,18 @@ static void smfs_clear_inode(struct inode *inode)
cache_sb = S2CSB(inode->i_sb);
cache_inode = I2CI(inode);
/*FIXME: because i_count of cache_inode may not
* be 0 or 1 in before smfs_delete inode, So we
* need to dec it to 1 before we call delete_inode
* of the bellow cache filesystem Check again latter*/
if (atomic_read(&cache_inode->i_count) < 1)
BUG();
while (atomic_read(&cache_inode->i_count) != 1) {
atomic_dec(&cache_inode->i_count);
}
iput(cache_inode);
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment