From acf31536e9e570b2a5ee11a7818c96e4d177c808 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 8 Aug 2018 19:55:34 +0200 Subject: executor: clean up immutable dirs Turns out dirs can be immutable too. Update #650 --- executor/common_linux.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'executor/common_linux.h') diff --git a/executor/common_linux.h b/executor/common_linux.h index 53684f646..49c33c108 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -1825,6 +1825,17 @@ retry: if (rmdir(dir) == 0) break; if (i < 100) { + if (errno == EPERM) { + // Try to reset FS_XFLAG_IMMUTABLE. + int fd = open(dir, O_RDONLY); + if (fd != -1) { + struct fsxattr attr = {0}; + if (ioctl(fd, FS_IOC_FSSETXATTR, &attr) == 0) + debug("reset FS_XFLAG_IMMUTABLE\n"); + close(fd); + continue; + } + } if (errno == EROFS) { debug("ignoring EROFS\n"); break; -- cgit mrf-deployment