* 64bit JBD patch bug!
@ 2006-09-15 0:56 张军伟
2006-09-19 1:37 ` 张军伟
0 siblings, 1 reply; 2+ messages in thread
From: 张军伟 @ 2006-09-15 0:56 UTC (permalink / raw)
To: linux-fsdevel, cmm
I think I have found a bug of 64bit JBD patches!
in 64bit_JBD_core.patch
"while(offset + record_len < max) {"
must be changed to
"while(offset + record_len <= max) {"
or
"while(offset < max) {" just same as original
otherwise the last revoke record will be ignored!
@@ -571,17 +580,24 @@ static int scan_revoke_records(journal_t
{
journal_revoke_header_t *header;
int offset, max;
+ int record_len = 4;
header = (journal_revoke_header_t *) bh->b_data;
offset = sizeof(journal_revoke_header_t);
max = be32_to_cpu(header->r_count);
- while (offset < max) {
+ if (JFS_HAS_INCOMPAT_FEATURE(journal, JFS_FEATURE_INCOMPAT_64BIT))
+ record_len = 8;
+
+ while (offset + record_len < max) {
/* changes here */
>>> while (offset + record_len <= max) {
unsigned long blocknr;
int err;
- blocknr = be32_to_cpu(* ((__be32 *) (bh->b_data+offset)));
- offset += 4;
+ if (record_len == 4)
+ blocknr = be32_to_cpu(* ((__be32 *)
(bh->b_data+offset)));
+ else
+ blocknr = be64_to_cpu(* ((__be64 *)
(bh->b_data+offset)));
+ offset += record_len;
err = journal_set_revoke(journal, blocknr, sequence);
if (err)
return err;
^ permalink raw reply [flat|nested] 2+ messages in thread
* re: 64bit JBD patch bug!
2006-09-15 0:56 64bit JBD patch bug! 张军伟
@ 2006-09-19 1:37 ` 张军伟
0 siblings, 0 replies; 2+ messages in thread
From: 张军伟 @ 2006-09-19 1:37 UTC (permalink / raw)
To: '张军伟', linux-fsdevel, cmm
Anyone can help me!
I think I have found a bug of 64bit JBD patches!
in 64bit_JBD_core.patch
"while(offset + record_len < max) {"
must be changed to
"while(offset + record_len <= max) {"
or
"while(offset < max) {" just same as original
otherwise the last revoke record will be ignored!
@@ -571,17 +580,24 @@ static int scan_revoke_records(journal_t
{
journal_revoke_header_t *header;
int offset, max;
+ int record_len = 4;
header = (journal_revoke_header_t *) bh->b_data;
offset = sizeof(journal_revoke_header_t);
max = be32_to_cpu(header->r_count);
- while (offset < max) {
+ if (JFS_HAS_INCOMPAT_FEATURE(journal, JFS_FEATURE_INCOMPAT_64BIT))
+ record_len = 8;
+
+ while (offset + record_len < max) {
/* changes here */
>>> while (offset + record_len <= max) {
unsigned long blocknr;
int err;
- blocknr = be32_to_cpu(* ((__be32 *) (bh->b_data+offset)));
- offset += 4;
+ if (record_len == 4)
+ blocknr = be32_to_cpu(* ((__be32 *)
(bh->b_data+offset)));
+ else
+ blocknr = be64_to_cpu(* ((__be64 *)
(bh->b_data+offset)));
+ offset += record_len;
err = journal_set_revoke(journal, blocknr, sequence);
if (err)
return err;
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-19 1:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 0:56 64bit JBD patch bug! 张军伟
2006-09-19 1:37 ` 张军伟
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).