diff options
Diffstat (limited to 'fs/jbd2')
| -rw-r--r-- | fs/jbd2/commit.c | 6 | ||||
| -rw-r--r-- | fs/jbd2/journal.c | 7 | ||||
| -rw-r--r-- | fs/jbd2/revoke.c | 2 | ||||
| -rw-r--r-- | fs/jbd2/transaction.c | 2 |
4 files changed, 10 insertions, 7 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index fa36d7662b21..6e28000a4b21 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
| @@ -105,6 +105,8 @@ static int journal_submit_commit_record(journal_t *journal, | |||
| 105 | int ret; | 105 | int ret; |
| 106 | struct timespec now = current_kernel_time(); | 106 | struct timespec now = current_kernel_time(); |
| 107 | 107 | ||
| 108 | *cbh = NULL; | ||
| 109 | |||
| 108 | if (is_journal_aborted(journal)) | 110 | if (is_journal_aborted(journal)) |
| 109 | return 0; | 111 | return 0; |
| 110 | 112 | ||
| @@ -403,7 +405,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) | |||
| 403 | * we do not require it to remember exactly which old buffers it | 405 | * we do not require it to remember exactly which old buffers it |
| 404 | * has reserved. This is consistent with the existing behaviour | 406 | * has reserved. This is consistent with the existing behaviour |
| 405 | * that multiple jbd2_journal_get_write_access() calls to the same | 407 | * that multiple jbd2_journal_get_write_access() calls to the same |
| 406 | * buffer are perfectly permissable. | 408 | * buffer are perfectly permissible. |
| 407 | */ | 409 | */ |
| 408 | while (commit_transaction->t_reserved_list) { | 410 | while (commit_transaction->t_reserved_list) { |
| 409 | jh = commit_transaction->t_reserved_list; | 411 | jh = commit_transaction->t_reserved_list; |
| @@ -806,7 +808,7 @@ wait_for_iobuf: | |||
| 806 | if (err) | 808 | if (err) |
| 807 | __jbd2_journal_abort_hard(journal); | 809 | __jbd2_journal_abort_hard(journal); |
| 808 | } | 810 | } |
| 809 | if (!err && !is_journal_aborted(journal)) | 811 | if (cbh) |
| 810 | err = journal_wait_on_commit_record(journal, cbh); | 812 | err = journal_wait_on_commit_record(journal, cbh); |
| 811 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, | 813 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, |
| 812 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) && | 814 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) && |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 90407b8fece7..e0ec3db1c395 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
| @@ -917,7 +917,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev, | |||
| 917 | journal->j_wbufsize = n; | 917 | journal->j_wbufsize = n; |
| 918 | journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL); | 918 | journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL); |
| 919 | if (!journal->j_wbuf) { | 919 | if (!journal->j_wbuf) { |
| 920 | printk(KERN_ERR "%s: Cant allocate bhs for commit thread\n", | 920 | printk(KERN_ERR "%s: Can't allocate bhs for commit thread\n", |
| 921 | __func__); | 921 | __func__); |
| 922 | goto out_err; | 922 | goto out_err; |
| 923 | } | 923 | } |
| @@ -983,7 +983,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode) | |||
| 983 | journal->j_wbufsize = n; | 983 | journal->j_wbufsize = n; |
| 984 | journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL); | 984 | journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL); |
| 985 | if (!journal->j_wbuf) { | 985 | if (!journal->j_wbuf) { |
| 986 | printk(KERN_ERR "%s: Cant allocate bhs for commit thread\n", | 986 | printk(KERN_ERR "%s: Can't allocate bhs for commit thread\n", |
| 987 | __func__); | 987 | __func__); |
| 988 | goto out_err; | 988 | goto out_err; |
| 989 | } | 989 | } |
| @@ -2413,10 +2413,12 @@ const char *jbd2_dev_to_name(dev_t device) | |||
| 2413 | new_dev = kmalloc(sizeof(struct devname_cache), GFP_KERNEL); | 2413 | new_dev = kmalloc(sizeof(struct devname_cache), GFP_KERNEL); |
| 2414 | if (!new_dev) | 2414 | if (!new_dev) |
| 2415 | return "NODEV-ALLOCFAILURE"; /* Something non-NULL */ | 2415 | return "NODEV-ALLOCFAILURE"; /* Something non-NULL */ |
| 2416 | bd = bdget(device); | ||
| 2416 | spin_lock(&devname_cache_lock); | 2417 | spin_lock(&devname_cache_lock); |
| 2417 | if (devcache[i]) { | 2418 | if (devcache[i]) { |
| 2418 | if (devcache[i]->device == device) { | 2419 | if (devcache[i]->device == device) { |
| 2419 | kfree(new_dev); | 2420 | kfree(new_dev); |
| 2421 | bdput(bd); | ||
| 2420 | ret = devcache[i]->devname; | 2422 | ret = devcache[i]->devname; |
| 2421 | spin_unlock(&devname_cache_lock); | 2423 | spin_unlock(&devname_cache_lock); |
| 2422 | return ret; | 2424 | return ret; |
| @@ -2425,7 +2427,6 @@ const char *jbd2_dev_to_name(dev_t device) | |||
| 2425 | } | 2427 | } |
| 2426 | devcache[i] = new_dev; | 2428 | devcache[i] = new_dev; |
| 2427 | devcache[i]->device = device; | 2429 | devcache[i]->device = device; |
| 2428 | bd = bdget(device); | ||
| 2429 | if (bd) { | 2430 | if (bd) { |
| 2430 | bdevname(bd, devcache[i]->devname); | 2431 | bdevname(bd, devcache[i]->devname); |
| 2431 | bdput(bd); | 2432 | bdput(bd); |
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index 9ad321fd63fd..69fd93588118 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c | |||
| @@ -71,7 +71,7 @@ | |||
| 71 | * switching hash tables under them. For operations on the lists of entries in | 71 | * switching hash tables under them. For operations on the lists of entries in |
| 72 | * the hash table j_revoke_lock is used. | 72 | * the hash table j_revoke_lock is used. |
| 73 | * | 73 | * |
| 74 | * Finally, also replay code uses the hash tables but at this moment noone else | 74 | * Finally, also replay code uses the hash tables but at this moment no one else |
| 75 | * can touch them (filesystem isn't mounted yet) and hence no locking is | 75 | * can touch them (filesystem isn't mounted yet) and hence no locking is |
| 76 | * needed. | 76 | * needed. |
| 77 | */ | 77 | */ |
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 1d1191050f99..05fa77a23711 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
| @@ -1403,7 +1403,7 @@ int jbd2_journal_stop(handle_t *handle) | |||
| 1403 | 1403 | ||
| 1404 | /* | 1404 | /* |
| 1405 | * Once we drop t_updates, if it goes to zero the transaction | 1405 | * Once we drop t_updates, if it goes to zero the transaction |
| 1406 | * could start commiting on us and eventually disappear. So | 1406 | * could start committing on us and eventually disappear. So |
| 1407 | * once we do this, we must not dereference transaction | 1407 | * once we do this, we must not dereference transaction |
| 1408 | * pointer again. | 1408 | * pointer again. |
| 1409 | */ | 1409 | */ |
