aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-10-26 18:01:18 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-10-26 18:01:18 +0000
commitd681c51d36ab0c2eacd7a2c260dafd50be2343a3 (patch)
tree799717492e04b03caaff63a748768a8d024cbeea /sys/kern/vfs_cache.c
parentf61a22193c0d088da51b411bb79e3d6f8a73765d (diff)
downloadsrc-d681c51d36ab0c2eacd7a2c260dafd50be2343a3.tar.gz
src-d681c51d36ab0c2eacd7a2c260dafd50be2343a3.zip
cache: add missing NIRES_ABS handling
Notes
Notes: svn path=/head/; revision=367064
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index cb2137c5210b..2fd6226d2f99 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -3607,7 +3607,7 @@ cache_fpl_checkpoint(struct cache_fpl *fpl, struct nameidata_saved *snd)
}
static void
-cache_fpl_restore(struct cache_fpl *fpl, struct nameidata_saved *snd)
+cache_fpl_restore_partial(struct cache_fpl *fpl, struct nameidata_saved *snd)
{
fpl->ndp->ni_cnd.cn_flags = snd->cn_flags;
@@ -3616,6 +3616,17 @@ cache_fpl_restore(struct cache_fpl *fpl, struct nameidata_saved *snd)
fpl->ndp->ni_pathlen = snd->ni_pathlen;
}
+static void
+cache_fpl_restore_abort(struct cache_fpl *fpl, struct nameidata_saved *snd)
+{
+
+ cache_fpl_restore_partial(fpl, snd);
+ /*
+ * It is 0 on entry by API contract.
+ */
+ fpl->ndp->ni_resflags = 0;
+}
+
#ifdef INVARIANTS
#define cache_fpl_smr_assert_entered(fpl) ({ \
struct cache_fpl *_fpl = (fpl); \
@@ -3846,7 +3857,7 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl)
return (cache_fpl_aborted(fpl));
}
- cache_fpl_restore(fpl, &fpl->snd);
+ cache_fpl_restore_partial(fpl, &fpl->snd);
ndp->ni_startdir = dvp;
cnp->cn_flags |= MAKEENTRY;
@@ -4696,6 +4707,7 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status,
cnp->cn_nameptr = cnp->cn_pnbuf;
if (cnp->cn_pnbuf[0] == '/') {
cache_fpl_handle_root(ndp, &dvp);
+ ndp->ni_resflags |= NIRES_ABS;
} else {
if (ndp->ni_dirfd == AT_FDCWD) {
dvp = pwd->pwd_cdir;
@@ -4730,7 +4742,7 @@ out:
*/
break;
case CACHE_FPL_STATUS_ABORTED:
- cache_fpl_restore(&fpl, &orig);
+ cache_fpl_restore_abort(&fpl, &orig);
break;
}
return (error);