• Alexander Viro's avatar
    [PATCH] O_DIRECT open() fix · a45a6dde
    Alexander Viro authored
    Trivial bugfix: opening a file that doesn't have ->direct_IO() with
    O_DIRECT passed in flags fails (as it should) but doesn't call
    ->release() even though ->open() had been successful.
    
    IOW, we have a leak there - e.g.  open() of a tty with O_DIRECT will
    leak a reference to tty and tty_driver.  Besides, quite a few drivers
    are _not_ happy with struct file being freed without ->release() after
    ->open() has returned 0.
    a45a6dde
open.c 19.6 KB