]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ext3: handle aborted journals in
authorAndrew Morton <akpm@osdl.org>
Thu, 7 Aug 2003 04:14:52 +0000 (21:14 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 7 Aug 2003 04:14:52 +0000 (21:14 -0700)
Teach journal_get_write_access() and journal_get_undo_access() to handle
aborted trasaction handles.

fs/jbd/transaction.c

index 83de01cd53f52b5c0c48c3ae6aec1e6d88c6b98f..cf9edd99e4921b4f8c020aeb2ad9cb50dff8fae1 100644 (file)
@@ -525,12 +525,18 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
                        int force_copy, int *credits) 
 {
        struct buffer_head *bh;
-       transaction_t *transaction = handle->h_transaction;
-       journal_t *journal = transaction->t_journal;
+       transaction_t *transaction;
+       journal_t *journal;
        int error;
        char *frozen_buffer = NULL;
        int need_copy = 0;
 
+       if (is_handle_aborted(handle))
+               return -EROFS;
+
+       transaction = handle->h_transaction;
+       journal = transaction->t_journal;
+
        jbd_debug(5, "buffer_head %p, force_copy %d\n", jh, force_copy);
 
        JBUFFER_TRACE(jh, "entry");