* [Ocfs2-devel] [PATCH 1/1] OCFS2: add nlink check in ocfs2_inode_revalidate()
@ 2008-09-22 9:27 wangang wang
2008-09-22 21:36 ` Sunil Mushran
0 siblings, 1 reply; 3+ messages in thread
From: wangang wang @ 2008-09-22 9:27 UTC (permalink / raw)
To: ocfs2-devel
nlink should be also checked in ocfs2_inode_revalidate().
before setting flag OCFS2_INODE_DELETED ip_flags (between
unlink and delete vote), the nlink may be 0.
the patch is against 1.4 git.
1.2 svn should has the same patch with different line number.
Signed-off-by: Wengang wang <wen.gang.wang@oracle.com>
--
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 591e693..6b5a83e 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -1186,6 +1186,13 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
status = -ENOENT;
goto bail;
}
+
+ if (!inode->i_nlink) {
+ spin_unlock(&OCFS2_I(inode)->ip_lock);
+ mlog(0, "inode deleted!\n");
+ status = -ENOENT;
+ goto bail;
+ }
spin_unlock(&OCFS2_I(inode)->ip_lock);
/* Let ocfs2_inode_lock do the work of updating our struct
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Ocfs2-devel] [PATCH 1/1] OCFS2: add nlink check in ocfs2_inode_revalidate()
2008-09-22 9:27 [Ocfs2-devel] [PATCH 1/1] OCFS2: add nlink check in ocfs2_inode_revalidate() wangang wang
@ 2008-09-22 21:36 ` Sunil Mushran
2008-09-23 2:26 ` wengang wang
0 siblings, 1 reply; 3+ messages in thread
From: Sunil Mushran @ 2008-09-22 21:36 UTC (permalink / raw)
To: ocfs2-devel
NAK
There is no voting in ocfs2 1.4.
Secondly, i_nlink=0 does not mean inode is deleted. It simply
means it has no more links. So returning enoent for a valid
inode would be incorrect.
wangang wang wrote:
> nlink should be also checked in ocfs2_inode_revalidate().
> before setting flag OCFS2_INODE_DELETED ip_flags (between
> unlink and delete vote), the nlink may be 0.
>
> the patch is against 1.4 git.
> 1.2 svn should has the same patch with different line number.
>
> Signed-off-by: Wengang wang <wen.gang.wang@oracle.com>
> --
> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
> index 591e693..6b5a83e 100644
> --- a/fs/ocfs2/inode.c
> +++ b/fs/ocfs2/inode.c
> @@ -1186,6 +1186,13 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
> status = -ENOENT;
> goto bail;
> }
> +
> + if (!inode->i_nlink) {
> + spin_unlock(&OCFS2_I(inode)->ip_lock);
> + mlog(0, "inode deleted!\n");
> + status = -ENOENT;
> + goto bail;
> + }
> spin_unlock(&OCFS2_I(inode)->ip_lock);
>
> /* Let ocfs2_inode_lock do the work of updating our struct
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
>
^ permalink raw reply [flat|nested] 3+ messages in thread* [Ocfs2-devel] [PATCH 1/1] OCFS2: add nlink check in ocfs2_inode_revalidate()
2008-09-22 21:36 ` Sunil Mushran
@ 2008-09-23 2:26 ` wengang wang
0 siblings, 0 replies; 3+ messages in thread
From: wengang wang @ 2008-09-23 2:26 UTC (permalink / raw)
To: ocfs2-devel
Sunil,
Sunil Mushran wrote:
> NAK
>
> There is no voting in ocfs2 1.4.
>
Agree.
This patch has nothing to do with voting. and it helps nothing on bug
7029797.
I found these problems when testing with OCFS2/NFS.
> Secondly, i_nlink=0 does not mean inode is deleted. It simply
> means it has no more links. So returning enoent for a valid
> inode would be incorrect.
ha, as my opinion, i_nlink changing from non-zero to zero, the
inode/file is deleted. maybe it's wrong :)
thanks,
wengang.
>
> wangang wang wrote:
>> nlink should be also checked in ocfs2_inode_revalidate().
>> before setting flag OCFS2_INODE_DELETED ip_flags (between unlink and
>> delete vote), the nlink may be 0.
>>
>> the patch is against 1.4 git. 1.2 svn should has the same patch with
>> different line number.
>>
>> Signed-off-by: Wengang wang <wen.gang.wang@oracle.com>
>> --
>> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
>> index 591e693..6b5a83e 100644
>> --- a/fs/ocfs2/inode.c
>> +++ b/fs/ocfs2/inode.c
>> @@ -1186,6 +1186,13 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
>> status = -ENOENT;
>> goto bail;
>> }
>> +
>> + if (!inode->i_nlink) {
>> + spin_unlock(&OCFS2_I(inode)->ip_lock);
>> + mlog(0, "inode deleted!\n");
>> + status = -ENOENT;
>> + goto bail;
>> + }
>> spin_unlock(&OCFS2_I(inode)->ip_lock);
>>
>> /* Let ocfs2_inode_lock do the work of updating our struct
>>
>> _______________________________________________
>> Ocfs2-devel mailing list
>> Ocfs2-devel at oss.oracle.com
>> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-09-23 2:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-22 9:27 [Ocfs2-devel] [PATCH 1/1] OCFS2: add nlink check in ocfs2_inode_revalidate() wangang wang
2008-09-22 21:36 ` Sunil Mushran
2008-09-23 2:26 ` wengang wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.