checkFreeSpace says it checks /var but may not really

Bug #1718497 reported by Brian Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

The function checkFreeSpace in DistUpgrade/DistUpgradeCache.py says, in the docstring, that it checks "free space on /var" but then there is no required size given so I'm pretty sure /var is not checked for free space. Here's the check for free space:

1169 # sum up space requirements
1170 for (dir, size) in [(archivedir, self.required_download),
1171 # plus 50M safety buffer in /usr
1172 ("/usr", self.additional_required_space),
1173 ("/usr", 50*1024*1024),
1174 ("/boot", space_in_boot),
1175 ("/tmp", 5*1024*1024), # /tmp for dkms LP: #427035
1176 ("/", 10*1024*1024), # small safety buffer /
1177 (aufs_rw_dir, required_for_aufs),
1178 # if snapshots are in use
1179 ("/usr", required_for_snapshots),
1180 ]:
1181 dir = os.path.realpath(dir)
1182 logging.debug("dir '%s' needs '%s' of '%s' (%f)" % (dir, size, fs_free[dir], fs_free[dir].free))
1183 fs_free[dir].free -= size
1184 fs_free[dir].need += size
1185
1186 # check for space required violations
1187 required_list = {}
1188 for dir in fs_free:

It's possible that checking /var is unnecessary since we check "archivedir" which is:

archivedir = apt_pkg.config.find_dir("Dir::Cache::archives")

Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → Medium
tags: added: artful rls-bb-incoming
Revision history for this message
Brian Murray (brian-murray) wrote :

I went ahead and tested this by installing Ubuntu 17.10 with a separate /var partition and then filled it up with junk. I did receive an error message indicating that the upgrade aborted because /var needed a total of 506 M free. So it seems all good.

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.