mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-22 07:56:32 -05:00
Add extra checks in for file handle lookup
This commit is contained in:
parent
184464f60a
commit
170c1cbfa0
3 changed files with 7 additions and 0 deletions
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "assert.hpp"
|
||||
#include "fh.hpp"
|
||||
|
||||
#include "base_types.h"
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ FUSE::ftruncate(const fuse_req_ctx_t *ctx_,
|
|||
});
|
||||
}
|
||||
|
||||
if(fh == 0)
|
||||
return -ENOENT;
|
||||
|
||||
FileInfo *fi = FileInfo::from_fh(fh);
|
||||
|
||||
return ::_ftruncate(fi->fd,size_);
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ FUSE::futimens(const fuse_req_ctx_t *ctx_,
|
|||
});
|
||||
}
|
||||
|
||||
if(fh == 0)
|
||||
return -ENOENT;
|
||||
|
||||
FileInfo *fi = FileInfo::from_fh(fh);
|
||||
|
||||
return ::_futimens(fi->fd,ts_);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue