Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/fuse/fuse_vnops.c
Show First 20 Lines • Show All 1,171 Lines • ▼ Show 20 Lines | fuse_lookup_alloc(struct mount *mp, void *arg, int lkflags, struct vnode **vpp) | ||||
struct fuse_lookup_alloc_arg *flaa = arg; | struct fuse_lookup_alloc_arg *flaa = arg; | ||||
return fuse_vnode_get(mp, flaa->feo, flaa->nid, NULL, vpp, flaa->cnp, | return fuse_vnode_get(mp, flaa->feo, flaa->nid, NULL, vpp, flaa->cnp, | ||||
flaa->vtyp); | flaa->vtyp); | ||||
} | } | ||||
SDT_PROBE_DEFINE3(fusefs, , vnops, cache_lookup, | SDT_PROBE_DEFINE3(fusefs, , vnops, cache_lookup, | ||||
"int", "struct timespec*", "struct timespec*"); | "int", "struct timespec*", "struct timespec*"); | ||||
SDT_PROBE_DEFINE2(fusefs, , vnops, lookup_cache_incoherent, | |||||
"struct vnode*", "struct fuse_entry_out*"); | |||||
/* | /* | ||||
struct vnop_lookup_args { | struct vnop_lookup_args { | ||||
struct vnodeop_desc *a_desc; | struct vnodeop_desc *a_desc; | ||||
struct vnode *a_dvp; | struct vnode *a_dvp; | ||||
struct vnode **a_vpp; | struct vnode **a_vpp; | ||||
struct componentname *a_cnp; | struct componentname *a_cnp; | ||||
}; | }; | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | if (flags & ISDOTDOT) { | ||||
*/ | */ | ||||
fvdat = VTOFUD(vp); | fvdat = VTOFUD(vp); | ||||
if (vnode_isreg(vp) && | if (vnode_isreg(vp) && | ||||
((filesize != fvdat->cached_attrs.va_size && | ((filesize != fvdat->cached_attrs.va_size && | ||||
fvdat->flag & FN_SIZECHANGE) || | fvdat->flag & FN_SIZECHANGE) || | ||||
((vap = VTOVA(vp)) && | ((vap = VTOVA(vp)) && | ||||
filesize != vap->va_size))) | filesize != vap->va_size))) | ||||
{ | { | ||||
SDT_PROBE2(fusefs, , vnops, lookup_cache_incoherent, vp, feo); | |||||
fvdat->flag &= ~FN_SIZECHANGE; | fvdat->flag &= ~FN_SIZECHANGE; | ||||
/* | /* | ||||
* The server changed the file's size even | * The server changed the file's size even | ||||
* though we had it cached, or had dirty writes | * though we had it cached, or had dirty writes | ||||
* in the WB cache! | * in the WB cache! | ||||
*/ | */ | ||||
printf("%s: cache incoherent on %s! " | fuse_warn(data, FSESS_WARN_CACHE_INCOHERENT, | ||||
"Buggy FUSE server detected. To prevent " | "cache incoherent! " | ||||
"To prevent " | |||||
"data corruption, disable the data cache " | "data corruption, disable the data cache " | ||||
"by mounting with -o direct_io, or as " | "by mounting with -o direct_io, or as " | ||||
"directed otherwise by your FUSE server's " | "directed otherwise by your FUSE server's " | ||||
"documentation\n", __func__, | "documentation."); | ||||
vnode_mount(vp)->mnt_stat.f_mntonname); | |||||
int iosize = fuse_iosize(vp); | int iosize = fuse_iosize(vp); | ||||
v_inval_buf_range(vp, 0, INT64_MAX, iosize); | v_inval_buf_range(vp, 0, INT64_MAX, iosize); | ||||
} | } | ||||
MPASS(feo != NULL); | MPASS(feo != NULL); | ||||
fuse_internal_cache_attrs(*vpp, &feo->attr, | fuse_internal_cache_attrs(*vpp, &feo->attr, | ||||
feo->attr_valid, feo->attr_valid_nsec, NULL); | feo->attr_valid, feo->attr_valid_nsec, NULL); | ||||
fuse_validity_2_bintime(feo->entry_valid, | fuse_validity_2_bintime(feo->entry_valid, | ||||
▲ Show 20 Lines • Show All 1,177 Lines • ▼ Show 20 Lines | if (err == ERANGE) { | ||||
err = ERESTART; | err = ERESTART; | ||||
goto out; | goto out; | ||||
} else if (err != 0) | } else if (err != 0) | ||||
goto out; | goto out; | ||||
linux_list = fdi.answ; | linux_list = fdi.answ; | ||||
/* FUSE doesn't allow the server to return more data than requested */ | /* FUSE doesn't allow the server to return more data than requested */ | ||||
if (fdi.iosize > linux_list_len) { | if (fdi.iosize > linux_list_len) { | ||||
printf("WARNING: FUSE protocol violation. Server returned " | struct fuse_data *data = fuse_get_mpdata(mp); | ||||
fuse_warn(data, FSESS_WARN_LSEXTATTR_LONG, | |||||
"server returned " | |||||
"more extended attribute data than requested; " | "more extended attribute data than requested; " | ||||
"should've returned ERANGE instead"); | "should've returned ERANGE instead."); | ||||
} else { | } else { | ||||
/* But returning less data is fine */ | /* But returning less data is fine */ | ||||
linux_list_len = fdi.iosize; | linux_list_len = fdi.iosize; | ||||
} | } | ||||
/* | /* | ||||
* Retrieve the BSD compatible list values. | * Retrieve the BSD compatible list values. | ||||
* The Linux / FUSE attribute list format isn't the same | * The Linux / FUSE attribute list format isn't the same | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |