... and get rid of a bunch of bugs in it. Background: the reason for path_mountpoint() is that umount() really doesn't want attempts to revalidate the root of what it's trying to umount. The thing we want to avoid actually happen from complete_walk(); solution was to do something parallel to normal path_lookupat() and it both went overboard and got the boilerplate subtly (and not so subtly) wrong. A better solution is to do pretty much what the normal path_lookupat() does, but instead of complete_walk() do unlazy_walk(). All it takes to avoid that ->d_weak_revalidate() call... mountpoint_last() goes away, along with everything it got wrong, and so does the magic around LOOKUP_NO_REVAL. Another source of bugs is that when we traverse mounts at the final location (and we need to do that - umount . expects to get whatever's overmounting ., if any, out of the lookup) we really ought to take care of ->d_manage() - as it is, manual umount of autofs automount in progress can lead to unpleasant surprises for the daemon. Easily solved by using handle_lookup_down() instead of follow_mount().
Showing the changes to include (1 of 3 files). Show all
Unified · Split
| @@ -34,7 +34,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; · 33 unmodified lines | |||
| 34 | 34 | ||
| 35 | /* internal use only */ | 35 | /* internal use only */ |
| 36 | #define LOOKUP_PARENT 0x0010 | 36 | #define LOOKUP_PARENT 0x0010 |
| 37 | #define LOOKUP_NO_REVAL 0x0080 | ||
| 38 | #define LOOKUP_JUMPED 0x1000 | 37 | #define LOOKUP_JUMPED 0x1000 |
| 39 | #define LOOKUP_ROOT 0x2000 | 38 | #define LOOKUP_ROOT 0x2000 |
| 40 | #define LOOKUP_ROOT_GRABBED 0x0008 | 39 | #define LOOKUP_ROOT_GRABBED 0x0008 |