Re: [RFC][PATCH 11/13] allow incomplete imports of filenames

Al Viro
2025-11-19T01:14:49Z

On Wed, Nov 19, 2025 at 01:12:23AM +0000, Al Viro wrote:

> int putname_to_incomplete(struct incomplete_name *v, struct filename *name)
> {
> if (likely(name->refcnt == 1)) {
> v->__incomplete_filename = name;
> return 0;
> }
> v->__incomplete_filename = <duplicate name>;
> putname(name);
> if (unlikely(!v->__incomplete_filename))
> return -ENOMEM;
> return 0;
> }
>
> and have
> if (ret == -EAGAIN &&
> (!resolve_nonblock && (issue_flags & IO_URING_F_NONBLOCK))) {
> ret = putname_to_incomplete(&open->filename,
> no_free_ptr(name));
> if (unlikely(ret))
> goto err;
> return -EAGAIN;
> }
>
> in io_openat2() (in addition to what's already done in 11/13). Workable or
> too disgusting?

Note that copying would happen only if extra references had been grabbed
and are still held; that's already a slow path.