• Roland Dreier's avatar
    [PATCH] fs/compat.c: rwsem instead of BKL around ioctl32_hash_table · 6043dddc
    Roland Dreier authored
    Currently the BKL is used to synchronize access to ioctl32_hash_table in
    fs/compat.c.  It seems that an rwsem would be more appropriate, since this
    would allow multiple lookups to occur in parallel (and also serve the
    general good of minimizing use of the BKL).
    
    I added lock_kernel()/unlock_kernel() around the call to t->handler when a
    compatibility handler is found in compat_sys_ioctl() to preserve the
    expectation that the BKL will be held during driver ioctl operations.  It
    should be safe to do lock_kernel() while holding ioctl32_sem because of the
    magic BKL sleep semantics.
    Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    6043dddc
compat.c 43.8 KB