Lines Matching full:origin
73 * A non-dir origin may be disconnected, which is fine, because in ovl_acceptable()
91 * Return -ENODATA for "origin unknown".
102 /* Treat larger version and unknown flags as "origin unknown" */ in ovl_check_fb_len()
106 /* Treat endianness mismatch as "origin unknown" */ in ovl_check_fb_len()
126 /* Zero size value means "copied up but origin unknown" */ in ovl_get_fh()
152 pr_warn_ratelimited("failed to get origin (%i)\n", res); in ovl_get_fh()
155 pr_warn_ratelimited("invalid origin (%*phN)\n", res, fh); in ovl_get_fh()
184 * Treat stale file handle to lower file as "origin unknown". in ovl_decode_real_fh()
422 struct dentry *origin = NULL; in ovl_check_origin_fh() local
434 origin = ovl_decode_real_fh(ofs, fh, ofs->layers[i].mnt, in ovl_check_origin_fh()
436 if (origin) in ovl_check_origin_fh()
440 if (!origin) in ovl_check_origin_fh()
442 else if (IS_ERR(origin)) in ovl_check_origin_fh()
443 return PTR_ERR(origin); in ovl_check_origin_fh()
446 inode_wrong_type(d_inode(upperdentry), d_inode(origin)->i_mode)) in ovl_check_origin_fh()
452 dput(origin); in ovl_check_origin_fh()
456 .dentry = origin, in ovl_check_origin_fh()
463 pr_warn_ratelimited("invalid origin (%pd2, ftype=%x, origin ftype=%x).\n", in ovl_check_origin_fh()
465 d_inode(origin)->i_mode & S_IFMT); in ovl_check_origin_fh()
466 dput(origin); in ovl_check_origin_fh()
561 is_upper ? "upper" : "origin", real, in ovl_verify_origin_xattr()
598 * Verify that an index entry name matches the origin file handle stored in
599 * OVL_XATTR_ORIGIN and that origin file handle can be decoded to lower path.
600 * Return 0 on match, -ESTALE on mismatch or stale origin, < 0 on error.
606 struct ovl_path origin = { }; in ovl_verify_index() local
607 struct ovl_path *stack = &origin; in ovl_verify_index()
635 * of the overlay inode). These entries contain no origin xattr. in ovl_verify_index()
650 * real inode. For non-dir index, we can read the copy up origin xattr in ovl_verify_index()
681 if (ovl_get_nlink(ofs, origin.dentry, index, 0) == 0) in ovl_verify_index()
686 dput(origin.dentry); in ovl_verify_index()
720 * origin inode. The index entry name is the hex representation of the lower
727 * If the index dentry for a copy up origin inode is positive, but points
733 int ovl_get_index_name(struct ovl_fs *ofs, struct dentry *origin, in ovl_get_index_name() argument
739 fh = ovl_encode_real_fh(ofs, d_inode(origin), false); in ovl_get_index_name()
780 struct dentry *origin, bool verify) in ovl_lookup_index() argument
785 bool is_dir = d_is_dir(origin); in ovl_lookup_index()
788 err = ovl_get_index_name(ofs, origin, &name); in ovl_lookup_index()
802 d_inode(origin)->i_ino, name.len, name.name, in ovl_lookup_index()
819 inode_wrong_type(inode, d_inode(origin)->i_mode)) { in ovl_lookup_index()
821 * Index should always be of the same file type as origin in ovl_lookup_index()
824 * unlinked, which means that finding a lower origin on lookup in ovl_lookup_index()
827 pr_warn_ratelimited("bad index found (index=%pd2, ftype=%x, origin ftype=%x).\n", in ovl_lookup_index()
829 d_inode(origin)->i_mode & S_IFMT); in ovl_lookup_index()
833 pr_warn_ratelimited("suspected uncovered redirected dir found (origin=%pd2, index=%pd2).\n", in ovl_lookup_index()
834 origin, index); in ovl_lookup_index()
842 …pr_warn_ratelimited("suspected multiply redirected dir found (upper=%pd2, origin=%pd2, index=%pd2)… in ovl_lookup_index()
843 upper, origin, index); in ovl_lookup_index()
892 /* Fix missing 'origin' xattr */
1037 struct dentry *origin = NULL; in ovl_lookup() local
1077 * Lookup copy up origin by decoding origin file handle. in ovl_lookup()
1079 * because we only need to hold the origin inode in in ovl_lookup()
1132 pr_warn_ratelimited("refusing to follow metacopy origin for (%pd2)\n", dentry); in ovl_lookup()
1137 * If no origin fh is stored in upper of a merge dir, store fh in ovl_lookup()
1150 * lower dir that does not match a stored origin xattr. In any in ovl_lookup()
1151 * case, only verified origin is used for index lookup. in ovl_lookup()
1153 * For non-dir dentry, if index=on, then ensure origin in ovl_lookup()
1167 origin = this; in ovl_lookup()
1224 * using ORIGIN xattr on upper, install it in stack. in ovl_lookup()
1241 origin = origin_path->dentry; in ovl_lookup()
1248 * For the case of upperdentry, we have set origin by now if it in ovl_lookup()
1253 * matches origin, otherwise dir index entries may be inconsistent in ovl_lookup()
1256 * For regular upper, we already set origin if upper had ORIGIN in ovl_lookup()
1260 * For metacopy upper, we set a verified origin already if index in ovl_lookup()
1261 * is enabled and if upper had an ORIGIN xattr. in ovl_lookup()
1265 origin = stack[0].dentry; in ovl_lookup()
1267 if (origin && ovl_indexdir(dentry->d_sb) && in ovl_lookup()
1269 index = ovl_lookup_index(ofs, upperdentry, origin, true); in ovl_lookup()