[Gluster-devel] a link issue maybe introduced in a bug fix " Don't let NFS cache stat after writes"

Lian, George (NSB - CN/Hangzhou) george.lian at nokia-sbell.com
Wed Jan 10 05:39:00 UTC 2018


Hi, Pranith Kumar,

I has create a bug on Bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1531457
After my investigation for this link issue, I suppose your changes on afr-dir-write.c with issue " Don't let NFS cache stat after writes" , your fix is like:
--------------------------------------
       if (afr_txn_nothing_failed (frame, this)) {
                        /*if it did pre-op, it will do post-op changing ctime*/
                        if (priv->consistent_metadata &&
                            afr_needs_changelog_update (local))
                                afr_zero_fill_stat (local);
                        local->transaction.unwind (frame, this);
                }
In the above fix, it set the ia_nlink to '0' if option consistent-metadata is set to "on".
And hard link a file with which just created will lead to an error, and the error is caused in kernel function "vfs_link":
if (inode->i_nlink == 0 && !(inode->i_state & I_LINKABLE))
             error =  -ENOENT;

could you please have a check and give some comments here?

Thanks & Best Regards,
George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20180110/c7b4110b/attachment-0001.html>


More information about the Gluster-devel mailing list