On Fri, Jul 2, 2021 at 4:32 AM Dmitry Kadashev <dkadashev@xxxxxxxxx> wrote: > > The problem is we have to keep the filenames around for retries on > ESTALE. It's not consumed by __filename_create() on success. So it's not > as simple as setting the name to NULL after calling __filename_create(). I wonder if the semantics couldn't be that __filename_create() never eats the name, and filename_create() keeps the old semantics? You kind of made it go halfway, with filename_create() eating it only on success. That would make the filename_create() wrapper much simpler too, ie we'd have it be just struct dentry *res = __filename_create(dfd, name, path, lookup_flags); putname(name); return res; so it would remove a lot of conditionals, and leave it to callers whether they want to keep the name live or not. But I didn't check all the other cases, so maybe that causes its own set of inconveniences.. Linus