--- x/fs/namei.c +++ y/fs/namei.c @@ -3494,6 +3494,7 @@ static struct dentry *lookup_open(struct goto out_dput; } + BUG_ON(!got_write); error = dir_inode->i_op->create(idmap, dir_inode, dentry, mode, open_flag & O_EXCL); if (error)