]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "ext4: allow readdir()'s of large empty directories to be interrupted"
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 10 Apr 2016 23:52:24 +0000 (16:52 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 10 Apr 2016 23:52:24 +0000 (16:52 -0700)
commit67f586c73f015e99a76da83f60e1379a86ecfd74
tree6ace4923e1038f45aa57acb5f1c1166cad61c5c3
parent8e7e2e215043fb524301b69a316a057aa6cf38f7
Revert "ext4: allow readdir()'s of large empty directories to be interrupted"

This reverts commit cf6a3a2bce12ef33b31113f209d6237caa2ee5f8.

It's broken: it makes ext4 return an error at an invalid point, causing
the readdir wrappers to write the the position of the last successful
directory entry into the position field, which means that the next
readdir will now return that last successful entry _again_.

You can only return fatal errors (that terminate the readdir directory
walk) from within the filesystem readdir functions, the "normal" errors
(that happen when the readdir buffer fills up, for example) happen in
the iterorator where we know the position of the actual failing entry.

I do have a very different patch that does the "signal_pending()"
handling inside the iterator function where it is allowable, but while
that one passes all the sanity checks, I screwed up something like four
times while emailing it out, so I'm not going to commit it today.

So my track record is not good enough, and the stars will have to align
better before that one gets committed.  And it would be good to get some
review too, of course, since celestial alignments are always an iffy
debugging model.

IOW, let's just revert the commit that caused the problem for now.

Reported-by: Greg Thelen <gthelen@google.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ext4/dir.c
fs/ext4/namei.c