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:02:37 +0000 |
commit | b2ada3ad5f7aefff107f013e0c9decea481c7ef6 (patch) | |
tree | 25f6a8bc3f11e4abd2899ff87bbd56def164c1bb | |
parent | 59921ce3ed7a4c0b7f8ef1a101ad9127469bf1fd (diff) | |
download | bitbake-b2ada3ad5f7aefff107f013e0c9decea481c7ef6.tar.gz |
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]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/monitordisk.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bb/monitordisk.py b/lib/bb/monitordisk.py index 2bd488123..1c1e61484 100644 --- a/lib/bb/monitordisk.py +++ b/lib/bb/monitordisk.py @@ -128,7 +128,7 @@ def getDiskData(BBDirs, configuration): if not os.path.exists(path): bb.utils.mkdirhier(path) mountedDev = getMountedDev(path) - devDict[mountedDev] = action, path, minSpace, minInode + devDict[mountedDev] = [action, path, minSpace, minInode] return devDict @@ -231,6 +231,13 @@ class diskMonitor: freeInode = st.f_favail if self.devDict[dev][3] and freeInode < self.devDict[dev][3]: + # Some fs formats' (e.g., btrfs) statvfs.f_files (inodes) is + # zero, this is a feature of the fs, we disable the inode + # checking for such a fs. + if st.f_files == 0: + logger.warn("Inode check for %s is unavaliable, remove it from disk monitor" % dev) + self.devDict[dev][3] = None + continue # Always show warning, the self.checked would always be False if the action is WARN if self.preFreeI[dev] == 0 or self.preFreeI[dev] - freeInode > self.inodeInterval and not self.checked[dev]: logger.warn("The free inode of %s is running low (%.3fK left)" % (dev, freeInode / 1024.0)) |