http://jfs.bkbits.net/linux-2.5 shaggy@austin.ibm.com|ChangeSet|20050323224350|27452 shaggy # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/03/23 16:43:50-06:00 shaggy@austin.ibm.com # JFS: Don't allow xtLookup to run against directory with inline data # # Signed-off-by: Dave Kleikamp # # fs/jfs/jfs_txnmgr.c # 2005/03/23 16:43:27-06:00 shaggy@austin.ibm.com +1 -1 # jfs_dirtable_inline function # # fs/jfs/jfs_incore.h # 2005/03/23 16:43:27-06:00 shaggy@austin.ibm.com +5 -1 # jfs_dirtable_inline function # # fs/jfs/jfs_dtree.c # 2005/03/23 16:43:27-06:00 shaggy@austin.ibm.com +2 -2 # jfs_dirtable_inline function # # fs/jfs/inode.c # 2005/03/23 16:43:27-06:00 shaggy@austin.ibm.com +5 -8 # disallow xtLookup of directory that contains inline data # # ChangeSet # 2005/03/16 15:43:34-06:00 shaggy@austin.ibm.com # JFS: Fix hang caused by race waking commit threads # # The flag, jfs_commit_threads_waking, is meant to avoid waking up too # many jfs_commit threads when only one is needed. There is a # possibility that all the threads will be running, and the flag gets # set, but never reset. The fix is to make sure the flag is reset # before a thread sleeps. # # Signed-off-by: Dave Kleikamp # # fs/jfs/jfs_txnmgr.c # 2005/03/16 15:43:17-06:00 shaggy@austin.ibm.com +3 -1 # Reset jfs_commit_threads_waking before going to sleep # # ChangeSet # 2005/03/15 09:16:28-06:00 shaggy@austin.ibm.com # JFS: Don't clobber wait_queue_head while there are waitors on it # # The resize code closes down the log and reinitializes it in another location # on the disk. The problem is that it re-initializes a wait_queue_head while # there are waitors waiting for the resize to be completed. The result # is that the waitors are never awakened. # # Signed-off-by: Dave Kleikamp # # fs/jfs/jfs_logmgr.c # 2005/03/15 09:15:55-06:00 shaggy@austin.ibm.com +3 -2 # Don't clobber wait_queue_head while there are waitors on it # # ChangeSet # 2005/03/13 18:10:17-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/13 18:10:12-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/12 12:38:08-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/12 12:38:03-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/10 12:11:55-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/10 12:11:50-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/08 23:38:39-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/08 23:38:34-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/08 13:14:29-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/08 13:14:24-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/07 14:55:45-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/07 14:55:38-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/07 13:59:12-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/07 13:59:07-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/06 19:24:18-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/06 19:24:13-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/05 15:22:26-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/05 15:22:21-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/04 20:50:25-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-jfs # # MAINTAINERS # 2005/03/04 20:50:20-08:00 akpm@bix.(none) +0 -0 # Auto merged # diff -Nru a/fs/jfs/inode.c b/fs/jfs/inode.c --- a/fs/jfs/inode.c 2005-03-23 19:27:37 -08:00 +++ b/fs/jfs/inode.c 2005-03-23 19:27:37 -08:00 @@ -176,7 +176,6 @@ struct buffer_head *bh_result, int create) { s64 lblock64 = lblock; - int no_size_check = 0; int rc = 0; int take_locks; xad_t xad; @@ -201,15 +200,13 @@ } /* - * A directory's "data" is the inode index table, but i_size is the - * size of the d-tree, so don't check the offset against i_size + * Don't try to do xtLookup when there is no xtree */ - if (S_ISDIR(ip->i_mode)) - no_size_check = 1; + if (S_ISDIR(ip->i_mode) && jfs_dirtable_inline(ip)) + goto unlock; - if ((no_size_check || - ((lblock64 << ip->i_sb->s_blocksize_bits) < ip->i_size)) && - (xtLookup(ip, lblock64, max_blocks, &xflag, &xaddr, &xlen, no_size_check) + if (((lblock64 << ip->i_sb->s_blocksize_bits) < ip->i_size) && + (xtLookup(ip, lblock64, max_blocks, &xflag, &xaddr, &xlen, 0) == 0) && xlen) { if (xflag & XAD_NOTRECORDED) { if (!create) diff -Nru a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c --- a/fs/jfs/jfs_dtree.c 2005-03-23 19:27:37 -08:00 +++ b/fs/jfs/jfs_dtree.c 2005-03-23 19:27:37 -08:00 @@ -268,7 +268,7 @@ return NULL; } - if (jfs_ip->next_index <= (MAX_INLINE_DIRTABLE_ENTRY + 1)) { + if (jfs_dirtable_inline(ip)) { /* * Inline directory table */ @@ -2828,7 +2828,7 @@ * the old directory table. */ if (DO_INDEX(ip)) { - if (jfs_ip->next_index > (MAX_INLINE_DIRTABLE_ENTRY + 1)) { + if (!jfs_dirtable_inline(ip)) { struct tblock *tblk = tid_to_tblock(tid); /* * We're playing games with the tid's xflag. If diff -Nru a/fs/jfs/jfs_incore.h b/fs/jfs/jfs_incore.h --- a/fs/jfs/jfs_incore.h 2005-03-23 19:27:37 -08:00 +++ b/fs/jfs/jfs_incore.h 2005-03-23 19:27:37 -08:00 @@ -178,6 +178,11 @@ return list_entry(inode, struct jfs_inode_info, vfs_inode); } +static inline int jfs_dirtable_inline(struct inode *inode) +{ + return (JFS_IP(inode)->next_index <= (MAX_INLINE_DIRTABLE_ENTRY + 1)); +} + static inline struct jfs_sb_info *JFS_SBI(struct super_block *sb) { return sb->s_fs_info; @@ -189,5 +194,4 @@ return 0; return 1; } - #endif /* _H_JFS_INCORE */ diff -Nru a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c --- a/fs/jfs/jfs_logmgr.c 2005-03-23 19:27:37 -08:00 +++ b/fs/jfs/jfs_logmgr.c 2005-03-23 19:27:37 -08:00 @@ -1119,6 +1119,7 @@ } memset(log, 0, sizeof(struct jfs_log)); INIT_LIST_HEAD(&log->sb_list); + init_waitqueue_head(&log->syncwait); /* * external log as separate logical volume @@ -1192,6 +1193,7 @@ return -ENOMEM; memset(log, 0, sizeof(struct jfs_log)); INIT_LIST_HEAD(&log->sb_list); + init_waitqueue_head(&log->syncwait); set_bit(log_INLINELOG, &log->flag); log->bdev = sb->s_bdev; @@ -1229,6 +1231,7 @@ } memset(dummy_log, 0, sizeof(struct jfs_log)); INIT_LIST_HEAD(&dummy_log->sb_list); + init_waitqueue_head(&dummy_log->syncwait); dummy_log->no_integrity = 1; /* Make up some stuff */ dummy_log->base = 0; @@ -1290,8 +1293,6 @@ LOGSYNC_LOCK_INIT(log); INIT_LIST_HEAD(&log->synclist); - - init_waitqueue_head(&log->syncwait); INIT_LIST_HEAD(&log->cqueue); log->flush_tblk = NULL; diff -Nru a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c --- a/fs/jfs/jfs_txnmgr.c 2005-03-23 19:27:37 -08:00 +++ b/fs/jfs/jfs_txnmgr.c 2005-03-23 19:27:37 -08:00 @@ -1,5 +1,5 @@ /* - * Copyright (C) International Business Machines Corp., 2000-2004 + * Copyright (C) International Business Machines Corp., 2000-2005 * Portions Copyright (C) Christoph Hellwig, 2001-2002 * * This program is free software; you can redistribute it and/or modify @@ -1567,7 +1567,7 @@ /* log after-image for logredo(): */ lrd->type = cpu_to_le16(LOG_REDOPAGE); - if (JFS_IP(tlck->ip)->next_index < MAX_INLINE_DIRTABLE_ENTRY) { + if (jfs_dirtable_inline(tlck->ip)) { /* * The table has been truncated, we've must have deleted * the last entry, so don't bother logging this @@ -2796,6 +2796,8 @@ if (!WorkDone) break; } + /* In case a wakeup came while all threads were active */ + jfs_commit_thread_waking = 0; if (current->flags & PF_FREEZE) { LAZY_UNLOCK(flags);