[PATCH 13/17] Ensure core.packedGitWindowSize cannot be less than 2 pages.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We cannot allow a window to be smaller than 2 system pages.
This limitation is necessary to support the feature of use_pack()
where we always supply at least 20 bytes after the offset to help
the object header and delta base parsing routines.

If packedGitWindowSize were allowed to be as small as 1 system page
then we would be completely unable to access an object header which
spanned over a page as we would never be able to arrange a mapping
such that the header was contiguous in virtual memory.

Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
---
 config.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/config.c b/config.c
index a8ea063..edc42f4 100644
--- a/config.c
+++ b/config.c
@@ -302,8 +302,8 @@ int git_default_config(const char *var, const char *value)
 		int pgsz = getpagesize();
 		packed_git_window_size = git_config_int(var, value);
 		packed_git_window_size /= pgsz;
-		if (!packed_git_window_size)
-			packed_git_window_size = 1;
+		if (packed_git_window_size < 2)
+			packed_git_window_size = 2;
 		packed_git_window_size *= pgsz;
 		return 0;
 	}
-- 
1.4.4.3.g87d8

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]