summaryrefslogtreecommitdiffstats
path: root/module/zfs/zpl_file.c
diff options
context:
space:
mode:
authorChen Haiquan <[email protected]>2016-08-04 23:57:35 +0800
committerBrian Behlendorf <[email protected]>2016-08-11 12:06:37 -0700
commitd9c97ec08b995f1a36657accc4bbc6057645a72c (patch)
treef2262c55fe0e9a4cd656c90553f9e95d20e28000 /module/zfs/zpl_file.c
parentd5884c3453c5de5892eaae672c5186ed02846113 (diff)
Use file_dentry and file_inode wrappers
Fix bugs due to kernel change in torvalds/linux@4bacc9c9234c ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay"). This problem crashes system when use zfs as a layer of overlayfs. Signed-off-by: Chen Haiquan <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4914 Closes #4935
Diffstat (limited to 'module/zfs/zpl_file.c')
-rw-r--r--module/zfs/zpl_file.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
index 4481237bc..c8ac7f8a3 100644
--- a/module/zfs/zpl_file.c
+++ b/module/zfs/zpl_file.c
@@ -78,14 +78,13 @@ zpl_release(struct inode *ip, struct file *filp)
static int
zpl_iterate(struct file *filp, struct dir_context *ctx)
{
- struct dentry *dentry = filp->f_path.dentry;
cred_t *cr = CRED();
int error;
fstrans_cookie_t cookie;
crhold(cr);
cookie = spl_fstrans_mark();
- error = -zfs_readdir(dentry->d_inode, ctx, cr);
+ error = -zfs_readdir(file_inode(filp), ctx, cr);
spl_fstrans_unmark(cookie);
crfree(cr);
ASSERT3S(error, <=, 0);
@@ -135,7 +134,7 @@ static int
zpl_aio_fsync(struct kiocb *kiocb, int datasync)
{
struct file *filp = kiocb->ki_filp;
- return (zpl_fsync(filp, filp->f_path.dentry, datasync));
+ return (zpl_fsync(filp, file_dentry(filp), datasync));
}
#elif defined(HAVE_FSYNC_WITHOUT_DENTRY)
/*
@@ -688,7 +687,7 @@ zpl_fallocate_common(struct inode *ip, int mode, loff_t offset, loff_t len)
static long
zpl_fallocate(struct file *filp, int mode, loff_t offset, loff_t len)
{
- return zpl_fallocate_common(filp->f_path.dentry->d_inode,
+ return zpl_fallocate_common(file_inode(filp),
mode, offset, len);
}
#endif /* HAVE_FILE_FALLOCATE */