[Ocfs2-devel] [PATCH] ocfs2: fix a refcount condition checking

Wengang Wang wen.gang.wang at oracle.com
Thu Feb 4 18:23:32 PST 2010


Hi Tao,

On 10-02-05 08:58, Tao Ma wrote:
> Hi wengang,
>
> Wengang Wang wrote:
>> Hi Joel/Tao,
>>
>> I don't know the reflink very well, so please ignore this patch if I am wrong.
>>
>> I think in ocfs2_prepare_inode_for_write(), we disable DIO write if the inode
>> has reflink.
>> If am right, the way we determine if the inode has reflink is wrong in case
>> (!has_refcount && direct_io).
> I just check the caller, all these 2 parameters are either set or NULL  
> simultaneously. You patch only make sense in (!has_refcount &&  
> direct_io), but currently we don't have such a case. So why bother  
> adding redundant code for a not-exist case?

Yes that current calling has no problem. But such interface has potential danger
for callers in future.
If you don't like change code, I think it's better to add comment that
has_refcount and direct_io must be both NULL or both non-NULL.


regards,
wengang.



More information about the Ocfs2-devel mailing list