storage/FileInfo, db/simple/Directory: use 64 bit for device/inode
An ino_t is usually a 64 bit integer, and some file systems (such as Linux's kernel NFS client) really uses the upper 32 bit. This can lead to false positives in the directory loop detection in FindAncestorLoop(). Increasing these two attributes (in StorageFileInfo and Directory) to 64 bit adds little overhead, but makes the check a lot safer.
This commit is contained in:
parent
32bcad51b8
commit
504f5f7bdd
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
||||||
ver 0.20.7 (not yet released)
|
ver 0.20.7 (not yet released)
|
||||||
|
* database
|
||||||
|
- simple: fix false positive directory loop detection with NFS
|
||||||
|
|
||||||
ver 0.20.6 (2017/03/10)
|
ver 0.20.6 (2017/03/10)
|
||||||
* input
|
* input
|
||||||
|
|
|
@ -86,7 +86,7 @@ struct Directory {
|
||||||
|
|
||||||
Directory *parent;
|
Directory *parent;
|
||||||
time_t mtime;
|
time_t mtime;
|
||||||
unsigned inode, device;
|
uint64_t inode, device;
|
||||||
|
|
||||||
std::string path;
|
std::string path;
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct StorageFileInfo {
|
||||||
* Device id and inode number. 0 means unknown / not
|
* Device id and inode number. 0 means unknown / not
|
||||||
* applicable.
|
* applicable.
|
||||||
*/
|
*/
|
||||||
unsigned device, inode;
|
uint64_t device, inode;
|
||||||
|
|
||||||
constexpr bool IsRegular() const {
|
constexpr bool IsRegular() const {
|
||||||
return type == Type::REGULAR;
|
return type == Type::REGULAR;
|
||||||
|
|
Loading…
Reference in New Issue