Skip to content

Commit

Permalink
core: reset cache on invalidate vol_list->contents
Browse files Browse the repository at this point in the history
Fixes #1112: After mount/unmount of tape "status slots" shows empty list

Previously the cache timestamp on vol_list->contents was not reset when
the list has been emptied. This lead to strange behaviour with empty
vol_lists showing up.
This patch now resets timestamp to zero when clearing vol_list->contents
so the cache is always rebuilt if contents had been cleared.

(cherry picked from commit c8dff08c03ed07d51bb5cda6deaed68878d20997)
  • Loading branch information
arogge committed Sep 17, 2019
1 parent 334c612 commit 839032c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/dird/storage.cc
Expand Up @@ -555,6 +555,9 @@ static inline void FreeVolList(changer_vol_list_t *vol_list)
{
vol_list_t *vl;

// make sure cache is treated as empty
vol_list->timestamp = 0;

if (vol_list->contents) {
foreach_dlist(vl, vol_list->contents) {
if (vl->VolName) {
Expand Down

0 comments on commit 839032c

Please sign in to comment.