err = unionfs_file_revalidate(file, false);
if (unlikely(err))
- goto out;
+ goto out_unlock;
inode = dentry->d_inode;
if (IS_ERR(odf_cache)) {
err = PTR_ERR(odf_cache);
odf_cache = NULL;
- goto out;
+ goto out_unlock;
}
/* check if cached dir does not exist */
err = odf_cache_dir(file->f_path.dentry, odf_cache,
&file->f_path.dentry->d_inode->i_mtime);
if (err)
- goto out;
+ goto out_unlock;
/*
* Reset file position, since an operation like rm *
*/
file->f_pos = 0;
}
+ unionfs_unlock_dentry(dentry);
dget(odf_cache);
mntget(UNIONFS_SB(file->f_path.dentry->d_sb)->odf.path.mnt);
if (file->f_pos >= size)
file->f_pos = DIREOF;
+ goto out;
+
+out_unlock:
+ unionfs_unlock_dentry(dentry);
out:
kfree(name);
if (odf_file)
filp_close(odf_file, NULL);
dput(odf_cache);
- unionfs_unlock_dentry(dentry);
unionfs_read_unlock(dentry->d_sb);
return err;
}