mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
When file unlinked check open_files map
Inadvertantly removed. Didn't realize that the kernel would not always send file handle when unlinked.
This commit is contained in:
parent
7616d8b1ac
commit
9308a3729c
16 changed files with 140 additions and 36 deletions
|
|
@ -46,7 +46,13 @@ _fgetattr(const FileInfo *fi_,
|
|||
return rv;
|
||||
}
|
||||
|
||||
|
||||
// In cases where the node was opened but unlinked there will be no
|
||||
// path and no guarentee of a `fh`. It could always do the lookup but
|
||||
// why bother if the kernel has provided it to us? The reason the
|
||||
// function doesn't need to run within the visit lambda is because
|
||||
// since the request is outstanding the kernel won't be releasing the
|
||||
// node and therefore the entry will be valid over the lifetime of
|
||||
// this function.
|
||||
int
|
||||
FUSE::fgetattr(const fuse_req_ctx_t *ctx_,
|
||||
cu64 fh_,
|
||||
|
|
@ -54,13 +60,11 @@ FUSE::fgetattr(const fuse_req_ctx_t *ctx_,
|
|||
fuse_timeouts_t *timeout_)
|
||||
{
|
||||
int rv;
|
||||
FileInfo *fi = FileInfo::from_fh(fh_);
|
||||
FileInfo *fi;
|
||||
|
||||
fi = state.get_fi(ctx_,fh_);
|
||||
if(not fi)
|
||||
{
|
||||
timeout_->entry = cfg.cache_negative_entry;
|
||||
return -EBADF;
|
||||
}
|
||||
return -EBADF;
|
||||
|
||||
rv = ::_fgetattr(fi,st_);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue