aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_linux.h
diff options
context:
space:
mode:
Diffstat (limited to 'executor/common_linux.h')
-rw-r--r--executor/common_linux.h11
1 files changed, 11 insertions, 0 deletions
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;