diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 00:54:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 00:54:31 -0400 |
commit | 81280572ca6f54009edfa4deee563e8678784218 (patch) | |
tree | 4fac10bcb71261823d261e5f8551fdb16ab653ba /fs/jbd2 | |
parent | b83db1deb29eb4eea9bf5992431d26978e039ce6 (diff) | |
parent | a107e5a3a473a2ea62bd5af24e11b84adf1486ff (diff) |
Merge branch 'upstream-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'upstream-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (50 commits)
ext4,jbd2: convert tracepoints to use major/minor numbers
ext4: optimize orphan_list handling for ext4_setattr
ext4: fix unbalanced mutex unlock in error path of ext4_li_request_new
ext4: fix compile error in ext4_fallocate()
ext4: move ext4_mb_{get,put}_buddy_cache_lock and make them static
ext4: rename mark_bitmap_end() to ext4_mark_bitmap_end()
ext4: move flush_completed_IO to fs/ext4/fsync.c and make it static
ext4: rename {ext,idx}_pblock and inline small extent functions
ext4: make various ext4 functions be static
ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*()
ext4: fix kernel oops if the journal superblock has a non-zero j_errno
ext4: update writeback_index based on last page scanned
ext4: implement writeback livelock avoidance using page tagging
ext4: tidy up a void argument in inode.c
ext4: add batched_discard into ext4 feature list
ext4: Add batched discard support for ext4
fs: Add FITRIM ioctl
ext4: Use return value from sb_issue_discard()
ext4: Check return value of sb_getblk() and friends
ext4: use bio layer instead of buffer layer in mpage_da_submit_io
...
Diffstat (limited to 'fs/jbd2')
-rw-r--r-- | fs/jbd2/checkpoint.c | 10 | ||||
-rw-r--r-- | fs/jbd2/commit.c | 12 | ||||
-rw-r--r-- | fs/jbd2/journal.c | 4 | ||||
-rw-r--r-- | fs/jbd2/transaction.c | 1 |
4 files changed, 22 insertions, 5 deletions
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 6571a056e55d..6a79fd0a1a32 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c | |||
@@ -299,6 +299,16 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh, | |||
299 | transaction->t_chp_stats.cs_forced_to_close++; | 299 | transaction->t_chp_stats.cs_forced_to_close++; |
300 | spin_unlock(&journal->j_list_lock); | 300 | spin_unlock(&journal->j_list_lock); |
301 | jbd_unlock_bh_state(bh); | 301 | jbd_unlock_bh_state(bh); |
302 | if (unlikely(journal->j_flags & JBD2_UNMOUNT)) | ||
303 | /* | ||
304 | * The journal thread is dead; so starting and | ||
305 | * waiting for a commit to finish will cause | ||
306 | * us to wait for a _very_ long time. | ||
307 | */ | ||
308 | printk(KERN_ERR "JBD2: %s: " | ||
309 | "Waiting for Godot: block %llu\n", | ||
310 | journal->j_devname, | ||
311 | (unsigned long long) bh->b_blocknr); | ||
302 | jbd2_log_start_commit(journal, tid); | 312 | jbd2_log_start_commit(journal, tid); |
303 | jbd2_log_wait_commit(journal, tid); | 313 | jbd2_log_wait_commit(journal, tid); |
304 | ret = 1; | 314 | ret = 1; |
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index bc6be8bda1cc..f3ad1598b201 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -26,7 +26,9 @@ | |||
26 | #include <linux/backing-dev.h> | 26 | #include <linux/backing-dev.h> |
27 | #include <linux/bio.h> | 27 | #include <linux/bio.h> |
28 | #include <linux/blkdev.h> | 28 | #include <linux/blkdev.h> |
29 | #include <linux/bitops.h> | ||
29 | #include <trace/events/jbd2.h> | 30 | #include <trace/events/jbd2.h> |
31 | #include <asm/system.h> | ||
30 | 32 | ||
31 | /* | 33 | /* |
32 | * Default IO end handler for temporary BJ_IO buffer_heads. | 34 | * Default IO end handler for temporary BJ_IO buffer_heads. |
@@ -201,7 +203,7 @@ static int journal_submit_data_buffers(journal_t *journal, | |||
201 | spin_lock(&journal->j_list_lock); | 203 | spin_lock(&journal->j_list_lock); |
202 | list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) { | 204 | list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) { |
203 | mapping = jinode->i_vfs_inode->i_mapping; | 205 | mapping = jinode->i_vfs_inode->i_mapping; |
204 | jinode->i_flags |= JI_COMMIT_RUNNING; | 206 | set_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
205 | spin_unlock(&journal->j_list_lock); | 207 | spin_unlock(&journal->j_list_lock); |
206 | /* | 208 | /* |
207 | * submit the inode data buffers. We use writepage | 209 | * submit the inode data buffers. We use writepage |
@@ -216,7 +218,8 @@ static int journal_submit_data_buffers(journal_t *journal, | |||
216 | spin_lock(&journal->j_list_lock); | 218 | spin_lock(&journal->j_list_lock); |
217 | J_ASSERT(jinode->i_transaction == commit_transaction); | 219 | J_ASSERT(jinode->i_transaction == commit_transaction); |
218 | commit_transaction->t_flushed_data_blocks = 1; | 220 | commit_transaction->t_flushed_data_blocks = 1; |
219 | jinode->i_flags &= ~JI_COMMIT_RUNNING; | 221 | clear_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
222 | smp_mb__after_clear_bit(); | ||
220 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); | 223 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); |
221 | } | 224 | } |
222 | spin_unlock(&journal->j_list_lock); | 225 | spin_unlock(&journal->j_list_lock); |
@@ -237,7 +240,7 @@ static int journal_finish_inode_data_buffers(journal_t *journal, | |||
237 | /* For locking, see the comment in journal_submit_data_buffers() */ | 240 | /* For locking, see the comment in journal_submit_data_buffers() */ |
238 | spin_lock(&journal->j_list_lock); | 241 | spin_lock(&journal->j_list_lock); |
239 | list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) { | 242 | list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) { |
240 | jinode->i_flags |= JI_COMMIT_RUNNING; | 243 | set_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
241 | spin_unlock(&journal->j_list_lock); | 244 | spin_unlock(&journal->j_list_lock); |
242 | err = filemap_fdatawait(jinode->i_vfs_inode->i_mapping); | 245 | err = filemap_fdatawait(jinode->i_vfs_inode->i_mapping); |
243 | if (err) { | 246 | if (err) { |
@@ -253,7 +256,8 @@ static int journal_finish_inode_data_buffers(journal_t *journal, | |||
253 | ret = err; | 256 | ret = err; |
254 | } | 257 | } |
255 | spin_lock(&journal->j_list_lock); | 258 | spin_lock(&journal->j_list_lock); |
256 | jinode->i_flags &= ~JI_COMMIT_RUNNING; | 259 | clear_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
260 | smp_mb__after_clear_bit(); | ||
257 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); | 261 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); |
258 | } | 262 | } |
259 | 263 | ||
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 168d1894317a..538417c1fdbb 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -42,12 +42,14 @@ | |||
42 | #include <linux/log2.h> | 42 | #include <linux/log2.h> |
43 | #include <linux/vmalloc.h> | 43 | #include <linux/vmalloc.h> |
44 | #include <linux/backing-dev.h> | 44 | #include <linux/backing-dev.h> |
45 | #include <linux/bitops.h> | ||
45 | 46 | ||
46 | #define CREATE_TRACE_POINTS | 47 | #define CREATE_TRACE_POINTS |
47 | #include <trace/events/jbd2.h> | 48 | #include <trace/events/jbd2.h> |
48 | 49 | ||
49 | #include <asm/uaccess.h> | 50 | #include <asm/uaccess.h> |
50 | #include <asm/page.h> | 51 | #include <asm/page.h> |
52 | #include <asm/system.h> | ||
51 | 53 | ||
52 | EXPORT_SYMBOL(jbd2_journal_extend); | 54 | EXPORT_SYMBOL(jbd2_journal_extend); |
53 | EXPORT_SYMBOL(jbd2_journal_stop); | 55 | EXPORT_SYMBOL(jbd2_journal_stop); |
@@ -2210,7 +2212,7 @@ void jbd2_journal_release_jbd_inode(journal_t *journal, | |||
2210 | restart: | 2212 | restart: |
2211 | spin_lock(&journal->j_list_lock); | 2213 | spin_lock(&journal->j_list_lock); |
2212 | /* Is commit writing out inode - we have to wait */ | 2214 | /* Is commit writing out inode - we have to wait */ |
2213 | if (jinode->i_flags & JI_COMMIT_RUNNING) { | 2215 | if (test_bit(__JI_COMMIT_RUNNING, &jinode->i_flags)) { |
2214 | wait_queue_head_t *wq; | 2216 | wait_queue_head_t *wq; |
2215 | DEFINE_WAIT_BIT(wait, &jinode->i_flags, __JI_COMMIT_RUNNING); | 2217 | DEFINE_WAIT_BIT(wait, &jinode->i_flags, __JI_COMMIT_RUNNING); |
2216 | wq = bit_waitqueue(&jinode->i_flags, __JI_COMMIT_RUNNING); | 2218 | wq = bit_waitqueue(&jinode->i_flags, __JI_COMMIT_RUNNING); |
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index f3479d6e0a83..6bf0a242613e 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
@@ -156,6 +156,7 @@ alloc_transaction: | |||
156 | */ | 156 | */ |
157 | repeat: | 157 | repeat: |
158 | read_lock(&journal->j_state_lock); | 158 | read_lock(&journal->j_state_lock); |
159 | BUG_ON(journal->j_flags & JBD2_UNMOUNT); | ||
159 | if (is_journal_aborted(journal) || | 160 | if (is_journal_aborted(journal) || |
160 | (journal->j_errno != 0 && !(journal->j_flags & JBD2_ACK_ERR))) { | 161 | (journal->j_errno != 0 && !(journal->j_flags & JBD2_ACK_ERR))) { |
161 | read_unlock(&journal->j_state_lock); | 162 | read_unlock(&journal->j_state_lock); |