win32_apply.c: Don't externally back very large files
authorEric Biggers <ebiggers3@gmail.com>
Sun, 15 Mar 2015 01:47:39 +0000 (20:47 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 15 Mar 2015 01:47:39 +0000 (20:47 -0500)
src/win32_apply.c

index 26814f6..4c65fef 100644 (file)
@@ -392,10 +392,13 @@ will_externally_back_inode(struct wim_inode *inode, struct win32_apply_ctx *ctx,
 
        stream = inode_unnamed_lte_resolved(inode);
 
+       /* Note: Microsoft's WoF driver errors out if it tries to satisfy a
+        * read, with ending offset >= 4 GiB, from an externally backed file. */
        if (!stream ||
            stream->resource_location != RESOURCE_IN_WIM ||
            stream->rspec->wim != ctx->common.wim ||
-           stream->size != stream->rspec->uncompressed_size)
+           stream->size != stream->rspec->uncompressed_size ||
+           stream->size > 4200000000)
                return WIM_BACKING_NOT_POSSIBLE;
 
        /*