Comment on statvfs
authorRobert Swiecki <swiecki@google.com>
Tue, 1 Mar 2016 15:01:39 +0000 (16:01 +0100)
committerRobert Swiecki <swiecki@google.com>
Tue, 1 Mar 2016 15:01:39 +0000 (16:01 +0100)
contain.c

index a8b68b9dcccde582d049e21a577864646cdfbff8..28cb998860625dc2f6fc0e7b40d241758973a16c 100644 (file)
--- a/contain.c
+++ b/contain.c
@@ -274,6 +274,12 @@ static bool containRemountRO(struct mounts_t *mpt)
 
        if (mpt->flags & MS_RDONLY) {
                LOG_D("Re-mounting RO '%s'", mpt->dst);
+               /*
+                * It's fine to use 'flags | vfs.f_flag' here as per
+                * /usr/include/x86_64-linux-gnu/bits/statvfs.h: 'Definitions for
+                * the flag in `f_flag'.  These definitions should be
+                * kept in sync with the definitions in <sys/mount.h>'
+                */
                if (mount
                    (mpt->dst, mpt->dst, NULL,
                     MS_BIND | MS_REMOUNT | MS_RDONLY | vfs.f_flag, 0) == -1) {