From 863981e96738983919de841ec669e157e6bdaeb0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sun, 11 Sep 2016 04:34:46 -0300 Subject: Linux-libre 4.7.1-gnu --- fs/aufs/finfo.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'fs/aufs/finfo.c') diff --git a/fs/aufs/finfo.c b/fs/aufs/finfo.c index 07f6eb32d..e0c16b2f1 100644 --- a/fs/aufs/finfo.c +++ b/fs/aufs/finfo.c @@ -8,10 +8,9 @@ #include "aufs.h" -void au_hfput(struct au_hfile *hf, struct file *file) +void au_hfput(struct au_hfile *hf, int execed) { - /* todo: direct access f_flags */ - if (vfsub_file_flags(file) & __FMODE_EXEC) + if (execed) allow_write_access(hf->hf_file); fput(hf->hf_file); hf->hf_file = NULL; @@ -33,7 +32,7 @@ void au_set_h_fptr(struct file *file, aufs_bindex_t bindex, struct file *val) hf = fidir->fd_hfile + bindex; if (hf && hf->hf_file) - au_hfput(hf, file); + au_hfput(hf, vfsub_file_execed(file)); if (val) { FiMustWriteLock(file); AuDebugOn(IS_ERR_OR_NULL(file->f_path.dentry)); @@ -90,7 +89,7 @@ int au_fidir_realloc(struct au_finfo *finfo, int nbr) /* ---------------------------------------------------------------------- */ -void au_finfo_fin(struct file *file) +void au_finfo_fin(struct file *file, int atonce) { struct au_finfo *finfo; @@ -99,7 +98,10 @@ void au_finfo_fin(struct file *file) finfo = au_fi(file); AuDebugOn(finfo->fi_hdir); AuRwDestroy(&finfo->fi_rwsem); - au_cache_free_finfo(finfo); + if (!atonce) + au_cache_dfree_finfo(finfo); + else + au_cache_free_finfo(finfo); } void au_fi_init_once(void *_finfo) -- cgit v1.2.3-54-g00ecf