summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2017-12-28 18:35:21 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2018-01-24 11:26:02 +0100
commit03e1c584ffbcb4ce05c3c61b76aceab4c12d6b68 (patch)
treee7dcca21c1541c1116c22c89296490d576d34d17 /fs
parentovl: copy up before encoding non-connectable dir file handle (diff)
downloadlinux-03e1c584ffbcb4ce05c3c61b76aceab4c12d6b68.tar.xz
linux-03e1c584ffbcb4ce05c3c61b76aceab4c12d6b68.zip
ovl: encode lower file handles
For indexed or lower non-dir, encode a non-connectable lower file handle from origin inode. For indexed or lower dir, when ofs->numlower == 1, encode a lower file handle from lower dir. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/overlayfs/export.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c
index 9da498ea75db..8e37a07b9eff 100644
--- a/fs/overlayfs/export.c
+++ b/fs/overlayfs/export.c
@@ -90,7 +90,6 @@ static int ovl_encode_maybe_copy_up(struct dentry *dentry)
static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen)
{
- struct dentry *upper;
struct dentry *origin = ovl_dentry_lower(dentry);
struct ovl_fh *fh = NULL;
int err;
@@ -107,13 +106,8 @@ static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen)
origin = NULL;
}
- upper = ovl_dentry_upper(dentry);
- err = -EACCES;
- if (!upper || origin)
- goto fail;
-
- /* TODO: encode non pure-upper by origin */
- fh = ovl_encode_fh(upper, true);
+ /* Encode an upper or origin file handle */
+ fh = ovl_encode_fh(origin ?: ovl_dentry_upper(dentry), !origin);
err = -EOVERFLOW;
if (fh->len > buflen)