Whamcloud - gitweb
Correct number of journal credits calculated for FSFILT_OP_CANCEL_UNLINK_LOG
authoradilger <adilger>
Tue, 16 Mar 2004 16:05:48 +0000 (16:05 +0000)
committeradilger <adilger>
Tue, 16 Mar 2004 16:05:48 +0000 (16:05 +0000)
so that we don't have transaction errors on small MDS filesystems.
b=2931
r=tianying

lustre/ChangeLog
lustre/lvfs/fsfilt_ext3.c

index f6eed85..d48da47 100644 (file)
@@ -12,6 +12,7 @@ tbd  Cluster File Systems, Inc. <info@clusterfs.com>
        - bump LLOG_CHUNKSIZE to 8k to allow for larger clusters (2306)
        - fix race in target_handle_connect (2898)
        - mds_reint_create() should take same inode create lock (2926)
+       - correct journal credits calculated for CANCEL_UNLINK_LOG (2931)
 
 2004-03-04  Cluster File Systems, Inc. <info@clusterfs.com>
        * version 1.2.0
index 91513f8..7774eb5 100644 (file)
@@ -74,11 +74,11 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private)
 {
         /* For updates to the last recieved file */
         int nblocks = EXT3_DATA_TRANS_BLOCKS;
-        int blocksize, block_count = 0;
         void *handle;
 
         if (current->journal_info) {
-                CDEBUG(D_INODE, "increasing refcount on %p\n", current->journal_info);
+                CDEBUG(D_INODE, "increasing refcount on %p\n",
+                       current->journal_info);
                 goto journal_start;
         }
 
@@ -121,11 +121,8 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private)
                 nblocks += 1;
                 break;
         case FSFILT_OP_CANCEL_UNLINK_LOG:
-                blocksize = 1 << inode->i_blkbits;
-                block_count = (blocksize - 1) + LLOG_CHUNK_SIZE;
-                block_count = (block_count + blocksize - 1) >> inode->i_blkbits;
-                block_count = block_count * EXT3_DATA_TRANS_BLOCKS + 2;
-                nblocks = 2 * 2 * block_count;
+                nblocks = (LLOG_CHUNK_SIZE >> inode->i_blkbits) +
+                        EXT3_DELETE_TRANS_BLOCKS;
                 break;
         default: CERROR("unknown transaction start op %d\n", op);
                  LBUG();