[pacman-dev] Diskspace checking thought- free space cushion

Dan McGee dpmcgee at gmail.com
Tue Dec 14 19:01:20 EST 2010


Code in question is diskspace.c, line ~300:

  for(i = mount_points; i; i = alpm_list_next(i)) {
    alpm_mountpoint_t *data = i->data;
    if(data->used == 1) {
      _alpm_log(PM_LOG_DEBUG, "partition %s, needed %ld, free %ld\n",
          data->mount_dir, data->max_blocks_needed,
          (unsigned long)data->fsp.f_bfree);
      if(data->max_blocks_needed > data->fsp.f_bfree) {
        abort = 1;
      }
    }
  }

This does a strict check of max_blocks_needed > fsp.f_bfree. do we
want to cushion this somehow, as having 1 block free could still spell
disaster given logging, post-install scripts, etc.? And if so, how
much? I don't want to make this something that has loads and loads of
configuration- we hardcode max delta ratio at 0.7, for instance. Is 5%
of total blocks, capped at something like 10 MB (in 4K blocks that
would be 2560 blocks) enough?

-Dan


More information about the pacman-dev mailing list