diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2013-02-04 18:03:35 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-15 12:12:36 +0000 |
commit | b0587077a47b2af0d88e17613fb48787e4c11716 (patch) | |
tree | 379311b3f6384578855e873c8b2bf5bc45f0ba63 /bitbake/lib/bb/monitordisk.py | |
parent | 804d1d57a2ea8ecde8adc9bf20c6460e039837c4 (diff) | |
download | poky-b0587077a47b2af0d88e17613fb48787e4c11716.tar.gz |
bitbake: monitordisk.py: disable the inode checking for some fs
There is an error when use disk monitor on btrfs:
WARNING: The free inode of rootfs is running low (0.000K left)
ERROR: Immediately abort since the disk space monitor action is "ABORT"!
This is beucase some fs formats' statvfs.f_files (inodes) is zero, thus
the statvfs.f_favail (free inodes) is zero, too, this a feature of the
fs, we disable the inode checking for such a fs.
[YOCTO #3609]
(Bitbake rev: b2ada3ad5f7aefff107f013e0c9decea481c7ef6)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/monitordisk.py')
-rw-r--r-- | bitbake/lib/bb/monitordisk.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py index 2bd488123e..1c1e614848 100644 --- a/bitbake/lib/bb/monitordisk.py +++ b/bitbake/lib/bb/monitordisk.py | |||
@@ -128,7 +128,7 @@ def getDiskData(BBDirs, configuration): | |||
128 | if not os.path.exists(path): | 128 | if not os.path.exists(path): |
129 | bb.utils.mkdirhier(path) | 129 | bb.utils.mkdirhier(path) |
130 | mountedDev = getMountedDev(path) | 130 | mountedDev = getMountedDev(path) |
131 | devDict[mountedDev] = action, path, minSpace, minInode | 131 | devDict[mountedDev] = [action, path, minSpace, minInode] |
132 | 132 | ||
133 | return devDict | 133 | return devDict |
134 | 134 | ||
@@ -231,6 +231,13 @@ class diskMonitor: | |||
231 | freeInode = st.f_favail | 231 | freeInode = st.f_favail |
232 | 232 | ||
233 | if self.devDict[dev][3] and freeInode < self.devDict[dev][3]: | 233 | if self.devDict[dev][3] and freeInode < self.devDict[dev][3]: |
234 | # Some fs formats' (e.g., btrfs) statvfs.f_files (inodes) is | ||
235 | # zero, this is a feature of the fs, we disable the inode | ||
236 | # checking for such a fs. | ||
237 | if st.f_files == 0: | ||
238 | logger.warn("Inode check for %s is unavaliable, remove it from disk monitor" % dev) | ||
239 | self.devDict[dev][3] = None | ||
240 | continue | ||
234 | # Always show warning, the self.checked would always be False if the action is WARN | 241 | # Always show warning, the self.checked would always be False if the action is WARN |
235 | if self.preFreeI[dev] == 0 or self.preFreeI[dev] - freeInode > self.inodeInterval and not self.checked[dev]: | 242 | if self.preFreeI[dev] == 0 or self.preFreeI[dev] - freeInode > self.inodeInterval and not self.checked[dev]: |
236 | logger.warn("The free inode of %s is running low (%.3fK left)" % (dev, freeInode / 1024.0)) | 243 | logger.warn("The free inode of %s is running low (%.3fK left)" % (dev, freeInode / 1024.0)) |