From 844e3cded9c8665e95b1e43b707a6c3adcbc901f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Sun, 28 Feb 2016 05:29:16 -0300 Subject: Linux-libre 4.4.3-gnu --- fs/aufs/f_op.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'fs/aufs/f_op.c') diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c index c1be75cb0..2baacd7a6 100644 --- a/fs/aufs/f_op.c +++ b/fs/aufs/f_op.c @@ -16,7 +16,7 @@ int au_do_open_nondir(struct file *file, int flags, struct file *h_file) { int err; aufs_bindex_t bindex; - struct dentry *dentry; + struct dentry *dentry, *h_dentry; struct au_finfo *finfo; struct inode *h_inode; @@ -29,10 +29,19 @@ int au_do_open_nondir(struct file *file, int flags, struct file *h_file) memset(&finfo->fi_htop, 0, sizeof(finfo->fi_htop)); atomic_set(&finfo->fi_mmapped, 0); bindex = au_dbstart(dentry); - if (!h_file) + if (!h_file) { + h_dentry = au_h_dptr(dentry, bindex); + err = vfsub_test_mntns(file->f_path.mnt, h_dentry->d_sb); + if (unlikely(err)) + goto out; h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); - else + } else { + h_dentry = h_file->f_path.dentry; + err = vfsub_test_mntns(file->f_path.mnt, h_dentry->d_sb); + if (unlikely(err)) + goto out; get_file(h_file); + } if (IS_ERR(h_file)) err = PTR_ERR(h_file); else { @@ -50,6 +59,7 @@ int au_do_open_nondir(struct file *file, int flags, struct file *h_file) /* file->f_ra = h_file->f_ra; */ } +out: return err; } -- cgit v1.2.3