Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / jbd / revoke.c
index 0bb60db..a561441 100644 (file)
@@ -116,7 +116,8 @@ static inline int hash(journal_t *journal, unsigned long block)
                (block << (hash_shift - 12))) & (table->hash_size - 1);
 }
 
-int insert_revoke_hash(journal_t *journal, unsigned long blocknr, tid_t seq)
+static int insert_revoke_hash(journal_t *journal, unsigned long blocknr,
+                             tid_t seq)
 {
        struct list_head *hash_list;
        struct jbd_revoke_record_s *record;
@@ -376,7 +377,12 @@ int journal_revoke(handle_t *handle, unsigned long blocknr,
            first having the revoke cancelled: it's illegal to free a
            block twice without allocating it in between! */
        if (bh) {
-               J_ASSERT_BH(bh, !buffer_revoked(bh));
+               if (!J_EXPECT_BH(bh, !buffer_revoked(bh),
+                                "inconsistent data on disk")) {
+                       if (!bh_in)
+                               brelse(bh);
+                       return -EIO;
+               }
                set_buffer_revoked(bh);
                set_buffer_revokevalid(bh);
                if (bh_in) {
@@ -608,7 +614,7 @@ static void flush_descriptor(journal_t *journal,
        set_buffer_jwrite(bh);
        BUFFER_TRACE(bh, "write");
        set_buffer_dirty(bh);
-       ll_rw_block(WRITE, 1, &bh);
+       ll_rw_block(SWRITE, 1, &bh);
 }
 #endif