diff options
author | Amir Goldstein <amir73il@gmail.com> | 2018-01-11 07:25:32 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-01-24 10:19:54 +0100 |
commit | 051224438af21047b34160b1e0ad1c5af45fdace (patch) | |
tree | 236eb05c06c40ca34f1e89f9aee63fe613c58c28 /fs/overlayfs/super.c | |
parent | ovl: simplify arguments to ovl_check_origin_fh() (diff) | |
download | linux-051224438af21047b34160b1e0ad1c5af45fdace.tar.xz linux-051224438af21047b34160b1e0ad1c5af45fdace.zip |
ovl: generalize ovl_verify_origin() and helpers
Remove the "origin" language from the functions that handle set, get
and verify of "origin" xattr and pass the xattr name as an argument.
The same helpers are going to be used for NFS export to get, get and
verify the "upper" xattr for directory index entries.
ovl_verify_origin() is now a helper used only to verify non upper
file handle stored in "origin" xattr of upper inode.
The upper root dir file handle is still stored in "origin" xattr on
the index dir for backward compatibility. This is going to be changed
by the patch that adds directory index entries support.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r-- | fs/overlayfs/super.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 4345c3f83fde..4ebbb368fce8 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1041,7 +1041,7 @@ static int ovl_get_indexdir(struct ovl_fs *ofs, struct ovl_entry *oe, /* Verify lower root is upper root origin */ err = ovl_verify_origin(upperpath->dentry, oe->lowerstack[0].dentry, - false, true); + true); if (err) { pr_err("overlayfs: failed to verify upper root origin\n"); goto out; @@ -1049,9 +1049,9 @@ static int ovl_get_indexdir(struct ovl_fs *ofs, struct ovl_entry *oe, ofs->indexdir = ovl_workdir_create(ofs, OVL_INDEXDIR_NAME, true); if (ofs->indexdir) { - /* Verify upper root is index dir origin */ - err = ovl_verify_origin(ofs->indexdir, upperpath->dentry, - true, true); + /* Verify upper root is exclusively associated with index dir */ + err = ovl_verify_set_fh(ofs->indexdir, OVL_XATTR_ORIGIN, + upperpath->dentry, true, true); if (err) pr_err("overlayfs: failed to verify index dir origin\n"); |