diff -drupN a/fs/squashfs/cache.c b/fs/squashfs/cache.c --- a/fs/squashfs/cache.c 2018-08-06 17:23:04.000000000 +0300 +++ b/fs/squashfs/cache.c 2022-06-12 05:28:14.000000000 +0300 @@ -191,6 +191,17 @@ void squashfs_cache_put(struct squashfs_ entry->refcount--; if (entry->refcount == 0) { cache->unused++; + + /* + * If error of this entry is occured, we need to + * mark it to SQUASHFS_INVALID_BLK, and clear the + * error variable. + */ + if (entry->error) { + entry->error = 0; + entry->block = SQUASHFS_INVALID_BLK; + } + /* * If there's any processes waiting for a block to become * available, wake one up.