1
0
Mirror von https://github.com/tkuschel/bees.git synchronisiert 2026-05-08 04:59:37 +02:00

Merge branch 'master' of git://github.com/kakra/bees

Dieser Commit ist enthalten in:
Zygo Blaxell
2017-09-16 13:55:58 -04:00
Commit 088cbd24ff
3 geänderte Dateien mit 22 neuen und 0 gelöschten Zeilen
+6
Datei anzeigen
@@ -13,6 +13,10 @@
#include <sys/stat.h>
#include <fcntl.h>
// ioctl
#include <sys/ioctl.h>
#include <linux/fs.h>
// socket
#include <sys/socket.h>
@@ -141,6 +145,8 @@ namespace crucible {
Stat &lstat(const string &filename);
};
int ioctl_iflags_get(int fd);
string st_mode_ntoa(mode_t mode);
// Because it's not trivial to do correctly
+8
Datei anzeigen
@@ -488,6 +488,14 @@ namespace crucible {
lstat(filename);
}
int
ioctl_iflags_get(int fd)
{
int attr = 0;
DIE_IF_MINUS_ONE(ioctl(fd, FS_IOC_GETFLAGS, &attr));
return attr;
}
string
readlink_or_die(const string &path)
{
+8
Datei anzeigen
@@ -576,6 +576,14 @@ BeesRoots::open_root_ino_nocache(uint64_t root, uint64_t ino)
break;
}
int attr = ioctl_iflags_get(rv);
if (attr & FS_NOCOW_FL) {
BEESLOG("Opening " << name_fd(root_fd) << "/" << file_path << " found incompatible flags " << attr << " (FS_NOCOW_FL)");
rv = Fd();
BEESCOUNT(open_wrong_flags);
break;
}
// Correct root?
auto file_root = btrfs_get_root_id(rv);
if (file_root != root) {