Skip to content
Snippets Groups Projects
Commit 1bf2b2c3 authored by Eric Mei's avatar Eric Mei
Browse files

liblustre:

 - don't blindly drop inode
 - fix iget
 - root inode checking
parent 60b061bd
No related branches found
No related tags found
No related merge requests found
...@@ -305,7 +305,8 @@ int llu_file_release(struct inode *inode) ...@@ -305,7 +305,8 @@ int llu_file_release(struct inode *inode)
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%lu\n", lli->lli_st_ino, CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%lu\n", lli->lli_st_ino,
lli->lli_st_generation); lli->lli_st_generation);
/* XXX don't do anything for '/'. but how to find the root pnode? */ if (llu_is_root_inode(inode))
RETURN(0);
/* still opened by others? */ /* still opened by others? */
if (--lli->lli_open_count) if (--lli->lli_open_count)
...@@ -327,8 +328,8 @@ int llu_iop_close(struct inode *inode) ...@@ -327,8 +328,8 @@ int llu_iop_close(struct inode *inode)
int rc; int rc;
rc = llu_file_release(inode); rc = llu_file_release(inode);
if (!llu_i2info(inode)->lli_open_count) /* if open count == 0 && stale_flag is set, should we
llu_i2info(inode)->lli_stale_flag = 1; * remove the inode immediately? */
return rc; return rc;
} }
......
...@@ -1236,12 +1236,15 @@ struct inode *llu_iget(struct filesys *fs, struct lustre_md *md) ...@@ -1236,12 +1236,15 @@ struct inode *llu_iget(struct filesys *fs, struct lustre_md *md)
inode = _sysio_i_find(fs, &fileid); inode = _sysio_i_find(fs, &fileid);
if (inode) { if (inode) {
if (llu_i2info(inode)->lli_st_generation == struct llu_inode_info *lli = llu_i2info(inode);
md->body->generation) {
if (lli->lli_stale_flag ||
lli->lli_st_generation == md->body->generation)
I_RELE(inode);
else {
llu_update_inode(inode, md->body, md->lsm); llu_update_inode(inode, md->body, md->lsm);
return inode; return inode;
} else }
I_RELE(inode);
} }
inode = llu_new_inode(fs, &fid); inode = llu_new_inode(fs, &fid);
...@@ -1494,3 +1497,4 @@ static struct inode_ops llu_inode_ops = { ...@@ -1494,3 +1497,4 @@ static struct inode_ops llu_inode_ops = {
inop_gone: llu_iop_gone, inop_gone: llu_iop_gone,
}; };
#warning "time_after() defined in liblustre.h need to be rewrite in userspace"
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