Correct a comment error
PATCH 1/1 Correct a comment error
The function ocfs2_double_lock tries to lock the inode with lower blockid first, not lockid.
--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +1 -1
@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,if (*bh2) *bh2 =NULL ; -/* we always want to lock the one with the lower lockid first. +/* we always want to lock the one with the lower blockid first. * and if they are nested, we lock ancestor first */ if (oi1->ip_blkno != oi2->ip_blkno) { inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,
Signature · 1 line
2.13.6
Hi Larry,
Quoted 2 lines · Larry Chen
The function
ocfs2_double_locktries to lock the inode with lower blockid first, not lockid.
As ocfs2's lock name includes block number, so I think the comment you want to rework is all right.
So nack.
Thanks,
Changwei
Quoted 20 lines
Signed-off-by Larry Chen <[email protected]>--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/namei.c +1
-1@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,if (*bh2) *bh2 =NULL ; -/* we always want to lock the one with the lower lockid first. +/* we always want to lock the one with the lower blockid first. * and if they are nested, we lock ancestor first */ if (oi1->ip_blkno != oi2->ip_blkno) { inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,
Hi Changwei,
Thanks for your review.
I think the original comment is not as clear as you said since the code does not reflect any relation between lockid and blockid.
Besides, the function inside indeed uses the block number for comparision. And it's really misleading for new beginners ,emmmm, like me.
:)
Thanks,
Larry
Quoted 1 line
Quoted 1 line
Quoted 1 line
Changwei Ge <[email protected]> 2018-3-1 ?? 8:37 >>>
Hi Larry,
Quoted 2 lines · Larry Chen
The function
ocfs2_double_locktries to lock the inode with lower blockid first, not lockid.
As ocfs2's lock name includes block number, so I think the comment you want to rework is all right.
So nack.
Thanks,
Changwei
Quoted 12 lines
Signed-off-by Larry Chen <[email protected]>--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/namei.c +0
-0
fs/ocfs2/namei.c static int ocfs2_double_lock(struct ocfs2_super *osb, · line 1139
Quoted 8 lines
fs/ocfs2/namei.c +1
-1@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,if (*bh2) *bh2 =NULL ; -/* we always want to lock the one with the lower lockid first. +/* we always want to lock the one with the lower blockid first. * and if they are nested, we lock ancestor first */ if (oi1->ip_blkno != oi2->ip_blkno) { inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20180228/db74a027/attachment.html
Quoted 9 lines · Lei Chen
Hi Changwei,
Thanks for your review.
I think the original comment is not as clear as you said since the code does not reflect any relation between lockid and blockid.
Besides, the function inside indeed uses the block number for comparision. And it's really misleading for new beginners ,emmmm, like me.
It's OK. Any behavior to fix, improve ocfs2 is encouraged.
-Changwei
Quoted 45 lines
:)
Thanks,
LarryQuoted 1 line
Quoted 1 line
Quoted 1 line
Changwei?Ge?<[email protected]> 2018-3-1 ?? 8:37 >>>
Hi Larry,
Quoted 2 lines · Larry Chen
The function
ocfs2_double_locktries to lock the inode with lower blockid first, not lockid.As ocfs2's lock name includes block number, so I think the comment you want to rework is all right.
So nack.Thanks,
ChangweiQuoted 20 lines
Signed-off-by Larry Chen <[email protected]>---
fs/ocfs2/namei.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/namei.c +1
-1@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb, ????if (*bh2) ????????*bh2 = NULL; -????/* we always want to lock the one with the lower lockid first. +????/* we always want to lock the one with the lower blockid first.???? * and if they are nested, we lock ancestor first */ ????if (
oi1->ip_blkno!=oi2->ip_blkno) { ????????inode1_is_ancestor = ocfs2_check_if_ancestor(osb,oi2->ip_blkno,
Hi Larry,
There is the same mistake in ocfs2_reflink_inodes_lock(), could you help fixing them all?
thanks,
Jun
Quoted 22 lines · Larry Chen
The function
ocfs2_double_locktries to lock the inode with lower blockid first, not lockid.Signed-off-by Larry Chen <[email protected]>--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/namei.c +1
-1@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,if (*bh2) *bh2 =NULL ; -/* we always want to lock the one with the lower lockid first. +/* we always want to lock the one with the lower blockid first. * and if they are nested, we lock ancestor first */ if (oi1->ip_blkno != oi2->ip_blkno) { inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,
Hi Jun,
I think the comments for both two functions are OK.
No need to rework them.
As we know, ocfs2 lock name(lock id) are composed of several parts including block number.
Thanks,
Changw2ei
Quoted 37 lines · piaojun
Hi Larry,
There is the same mistake in
ocfs2_reflink_inodes_lock(), could you help fixing them all?thanks,
JunQuoted 14 lines · Larry Chen
The function
ocfs2_double_locktries to lock the inode with lower blockid first, not lockid.Signed-off-by Larry Chen <[email protected]>--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/namei.c +0
-0fs/ocfs2/namei.c static int ocfs2_double_lock(struct ocfs2_super *osb, · line 1139
Quoted 8 lines
fs/ocfs2/namei.c +1
-1@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,if (*bh2) *bh2 =NULL ; -/* we always want to lock the one with the lower lockid first. +/* we always want to lock the one with the lower blockid first. * and if they are nested, we lock ancestor first */ if (oi1->ip_blkno != oi2->ip_blkno) { inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
Hi Changwei,
Quoted 5 lines · Changwei Ge
Hi Jun,
I think the comments for both two functions are OK.
No need to rework them.
As we know, ocfs2 lock name(lock id) are composed of several parts including block number.
I looked though the comments involved 'lockid', and found 'lockid' is a concept in dlm level, so ocfs2 level should not be aware of it.
thanks,
Jun
Quoted 44 lines
Thanks,
Changw2eiQuoted 25 lines · piaojun
Hi Larry,
There is the same mistake in
ocfs2_reflink_inodes_lock(), could you help fixing them all?thanks,
JunQuoted 16 lines · Larry Chen
The function
ocfs2_double_locktries to lock the inode with lower blockid first, not lockid.Signed-off-by Larry Chen <[email protected]>--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/namei.c +0
-0@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,if (*bh2) *bh2 =NULL ;Quoted 12 lines
fs/ocfs2/namei.c static int ocfs2_double_lock(struct ocfs2_super *osb, · line 1139
Quoted 6 lines
fs/ocfs2/namei.c +1
-1-/* we always want to lock the one with the lower lockid first. +/* we always want to lock the one with the lower blockid first. * and if they are nested, we lock ancestor first */ if (oi1->ip_blkno != oi2->ip_blkno) { inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel.
Hi Changwei and Jun,
Thanks for your advice.
Quoted 10 lines · piaojun
Hi Changwei,
Quoted 5 lines · Changwei Ge
Hi Jun,
I think the comments for both two functions are OK.
No need to rework them.
As we know, ocfs2 lock name(lock id) are composed of several parts including block number.I looked though the comments involved 'lockid', and found 'lockid' is a concept in dlm level, so ocfs2 level should not be aware of it.
When reading source code of ocfs2 level, you'll find that 'lockid' is a new concept that has not occurred or be explained before.
It's kind of difficult to understand.
Maybe 'blockno' or 'blockid' is more sensible than 'lockid'
I'm willing to fix them all.
Thanks
Larry
Quoted 44 lines
thanks,
JunQuoted 42 lines
Thanks,
Changw2eiQuoted 25 lines · piaojun
Hi Larry,
There is the same mistake in
ocfs2_reflink_inodes_lock(), could you help fixing them all?thanks,
JunQuoted 16 lines · Larry Chen
The function
ocfs2_double_locktries to lock the inode with lower blockid first, not lockid.Signed-off-by Larry Chen <[email protected]>--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/namei.c +0
-0@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,if (*bh2) *bh2 =NULL ;Quoted 11 lines
fs/ocfs2/namei.c static int ocfs2_double_lock(struct ocfs2_super *osb, · line 1139
Quoted 6 lines
fs/ocfs2/namei.c +1
-1-/* we always want to lock the one with the lower lockid first. +/* we always want to lock the one with the lower blockid first. * and if they are nested, we lock ancestor first */ if (oi1->ip_blkno != oi2->ip_blkno) { inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel.
Hi Jun,
Quoted 10 lines · piaojun
Hi Changwei,
Quoted 5 lines · Changwei Ge
Hi Jun,
I think the comments for both two functions are OK.
No need to rework them.
As we know, ocfs2 lock name(lock id) are composed of several parts including block number.I looked though the comments involved 'lockid', and found 'lockid' is a concept in dlm level, so ocfs2 level should not be aware of it.
I don't agree.
Please refer to ocfs2_build_lock_name().
DLM should not know how ocfs2 distinguishes objects it wants to protected. Moreover, ocfs2 has a abstraction layer called dlmglue.
-Changwei
Quoted 48 lines
thanks,
JunQuoted 44 lines
Thanks,
Changw2eiQuoted 25 lines · piaojun
Hi Larry,
There is the same mistake in
ocfs2_reflink_inodes_lock(), could you help fixing them all?thanks,
JunQuoted 16 lines · Larry Chen
The function
ocfs2_double_locktries to lock the inode with lower blockid first, not lockid.Signed-off-by Larry Chen <[email protected]>--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/namei.c +0
-0@@ -1133,7 +1133,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,if (*bh2) *bh2 =NULL ;Quoted 12 lines
fs/ocfs2/namei.c static int ocfs2_double_lock(struct ocfs2_super *osb, · line 1139
Quoted 6 lines
fs/ocfs2/namei.c +1
-1-/* we always want to lock the one with the lower lockid first. +/* we always want to lock the one with the lower blockid first. * and if they are nested, we lock ancestor first */ if (oi1->ip_blkno != oi2->ip_blkno) { inode1_is_ancestor = ocfs2_check_if_ancestor(osb, oi2->ip_blkno,_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel.