• Jan Harkes's avatar
    coda: pass the host file in vma->vm_file on mmap · afa3e571
    Jan Harkes authored
    commit 7fa0a1da upstream.
    
    Patch series "Coda updates".
    
    The following patch series is a collection of various fixes for Coda,
    most of which were collected from linux-fsdevel or linux-kernel but
    which have as yet not found their way upstream.
    
    This patch (of 22):
    
    Various file systems expect that vma->vm_file points at their own file
    handle, several use file_inode(vma->vm_file) to get at their inode or
    use vma->vm_file->private_data.  However the way Coda wrapped mmap on a
    host file broke this assumption, vm_file was still pointing at the Coda
    file and the host file systems would scribble over Coda's inode and
    private file data.
    
    This patch fixes the incorrect expectation and wraps vm_ops->open and
    vm_ops->close to allow Coda to track when the vm_area_struct is
    destroyed so we still release the reference on the Coda file handle at
    the right time.
    
    Link: http://lkml.kernel.org/r/0e850c6e59c0b147dc2dcd51a3af004c948c3697.1558117389.git.jaharkes@cs.cmu.eduSigned-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Colin Ian King <colin.king@canonical.com>
    Cc: Dan Carpenter <dan.carpenter@oracle.com>
    Cc: David Howells <dhowells@redhat.com>
    Cc: Fabian Frederick <fabf@skynet.be>
    Cc: Mikko Rapeli <mikko.rapeli@iki.fi>
    Cc: Sam Protsenko <semen.protsenko@linaro.org>
    Cc: Yann Droneaud <ydroneaud@opteya.com>
    Cc: Zhouyang Jia <jiazhouyang09@gmail.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    afa3e571
file.c 6.98 KB