Commit 3d9d1320 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix default value for commit interval for older reiserfs filesystems.

From: Bart Samwel <bart@samwel.tk>

The reiserfs patch that adds support for "commit=0" saves the default max
commit age in a variable when the fs is originally mounted, so that it can
later restore it.  Unfortunately it makes some mistakes with that:

- The default is not saved when the original mount has a commit=NNN option.

- The default is not correctly saved for older reiserfs filesystems, where
  the default was not stored on disk.

This patch fixes these mistakes.
parent 59fed502
...@@ -2304,14 +2304,8 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo ...@@ -2304,14 +2304,8 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
SB_JOURNAL_TRANS_MAX(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_trans_max); SB_JOURNAL_TRANS_MAX(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_trans_max);
SB_JOURNAL_MAX_BATCH(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_max_batch); SB_JOURNAL_MAX_BATCH(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_max_batch);
if (commit_max_age != 0) {
SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = commit_max_age;
SB_JOURNAL_MAX_TRANS_AGE(p_s_sb) = commit_max_age;
} else {
SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_max_commit_age); SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_max_commit_age);
SB_JOURNAL_DEFAULT_MAX_COMMIT_AGE(p_s_sb) = SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb);
SB_JOURNAL_MAX_TRANS_AGE(p_s_sb) = JOURNAL_MAX_TRANS_AGE; SB_JOURNAL_MAX_TRANS_AGE(p_s_sb) = JOURNAL_MAX_TRANS_AGE;
}
if (SB_JOURNAL_TRANS_MAX(p_s_sb)) { if (SB_JOURNAL_TRANS_MAX(p_s_sb)) {
/* make sure these parameters are available, assign it if they are not */ /* make sure these parameters are available, assign it if they are not */
...@@ -2350,6 +2344,14 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo ...@@ -2350,6 +2344,14 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
SB_JOURNAL_MAX_BATCH(p_s_sb) = (SB_JOURNAL_TRANS_MAX(p_s_sb)) * 9 / 10 ; SB_JOURNAL_MAX_BATCH(p_s_sb) = (SB_JOURNAL_TRANS_MAX(p_s_sb)) * 9 / 10 ;
} }
} }
SB_JOURNAL_DEFAULT_MAX_COMMIT_AGE(p_s_sb) = SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb);
if (commit_max_age != 0) {
SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = commit_max_age;
SB_JOURNAL_MAX_TRANS_AGE(p_s_sb) = commit_max_age;
}
printk ("Reiserfs journal params: device %s, size %u, " printk ("Reiserfs journal params: device %s, size %u, "
"journal first block %u, max trans len %u, max batch %u, " "journal first block %u, max trans len %u, max batch %u, "
"max commit age %u, max trans age %u\n", "max commit age %u, max trans age %u\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment