Re: buggered I_CREATING implementation?
From: Al Viro
Date: Thu Sep 11 2025 - 12:05:50 EST
On Thu, Sep 11, 2025 at 05:15:47PM +0200, Mateusz Guzik wrote:
> So as far as I understand the intent was to make it so that discarded
> inodes can be tested for with:
> (inode->i_state & (I_NEW | I_CREATING) == I_CREATING)
It is not the intent. The problem is dealing with incoming fhandle that
has guessed the inumber of freshly created (and not yet linked) inode.
> This means another call for the same inode will find it and:
>
> if (unlikely(old->i_state & I_CREATING)) {
> spin_unlock(&old->i_lock);
> spin_unlock(&inode_hash_lock);
> return -EBUSY;
> }
>
> ... return with -EBUSY instead of waiting to check what will happen with it.
What's there to wait for?