Skip to content
Commit 9dd78d8c authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Theodore Ts'o
Browse files

ext4: use dget_parent() in ext4_file_open()

In f_op->open() lock on parent is not held, so there's no guarantee that
parent dentry won't go away at any time.

Even after this patch there's no guarantee that 'dir' will stay the parent
of 'inode', but at least it won't be freed while being used.

Fixes: ff978b09

 ("ext4 crypto: move context consistency check to ext4_file_open()")
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Cc: <stable@vger.kernel.org> # v4.5
parent be62a1a8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment