On Tue, Aug 16, 2022 at 9:11 AM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > > filldir_t instances (directory iterators callbacks) used to return 0 for > "OK, keep going" or -E... for "stop". Yeah, and it was really confusing wrt what the reported user space error was. > So let's just return bool ("should we keep going?") - it's less confusing > that way. Ack. And the "true means keep going" that you picked is, I think, the more natural model with the conceptual model being while (dir_emit()) .. and this makes the filldir return value match that dir_emit() one. That said, our filldir code is still confusing as hell. And I would really like to see that "shared vs non-shared" iterator thing go away, with everybody using the shared one - and filesystems that can't deal with it using their own lock. But that's a completely independent wart in our complicated filldir saga. But if somebody were to look at that iterate-vs-iterate_shared, that would be lovely. A quick grep shows that we don't have *that* many of the non-shared cases left: git grep '\.iterate\>.*=' seems to imply that converting them to a "use my own load" wouldn't be _too_ bad. And some of them might actually be perfectly ok with the shared semantics (ie inode->i_rwsem held just for reading) and they just were never converted originally. Anybody? Linus