From: James Bottomley <James.Bottomley@SteelEye.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] fix bug in read-cache.c which loses files when merging a tree
Date: Mon, 18 Apr 2005 13:17:19 -0500 [thread overview]
Message-ID: <1113848239.4998.45.camel@mulgrave> (raw)
I noticed this when I tried a non-trivial scsi merge and checked the
results against BK. The problem is that remove_entry_at() actually
decrements active_nr, so decrementing it in add_cache_entry() before
calling remove_entry_at() is a double decrement (hence we lose cache
entries at the end).
James
read-cache.c: 4d4d94f75cceb8039eb466c1956f8b54dc0e24b6
--- read-cache.c
+++ read-cache.c 2005-04-18 13:08:09.000000000 -0500
@@ -402,7 +402,6 @@
if (pos < active_nr && ce_stage(ce) == 0) {
while (same_name(active_cache[pos], ce)) {
ok_to_add = 1;
- active_nr--;
if (!remove_entry_at(pos))
break;
}
next reply other threads:[~2005-04-18 18:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-18 18:17 James Bottomley [this message]
2005-04-18 19:25 ` [PATCH] fix bug in read-cache.c which loses files when merging a tree Linus Torvalds
[not found] ` <1113854941.4998.61.camel@mulgrave>
2005-04-18 21:19 ` Linus Torvalds
2005-04-18 21:58 ` Petr Baudis
2005-04-18 22:09 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1113848239.4998.45.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).