reiserfs is changed to use a version of reiserfs_get_block that is safe for filling holes without i_mutex held. reiserfs_file_write no longer creates a savelink before doing the direct io. When DIO does the expanding truncate, it also tries to create a savelink, and this conflicted with the one created by reiserfs_file_write. Signed-off-by: Chris Mason <chris.mason@xxxxxxxxxx> diff -r 218de24978fc -r b23ba06ac61f fs/reiserfs/file.c --- a/fs/reiserfs/file.c Wed Nov 01 10:24:05 2006 -0500 +++ b/fs/reiserfs/file.c Wed Nov 01 10:24:08 2006 -0500 @@ -1306,56 +1306,8 @@ static ssize_t reiserfs_file_write(struc count = MAX_NON_LFS - (unsigned long)*ppos; } - if (file->f_flags & O_DIRECT) { // Direct IO needs treatment - ssize_t result, after_file_end = 0; - if ((*ppos + count >= inode->i_size) - || (file->f_flags & O_APPEND)) { - /* If we are appending a file, we need to put this savelink in here. - If we will crash while doing direct io, finish_unfinished will - cut the garbage from the file end. */ - reiserfs_write_lock(inode->i_sb); - err = - journal_begin(&th, inode->i_sb, - JOURNAL_PER_BALANCE_CNT); - if (err) { - reiserfs_write_unlock(inode->i_sb); - return err; - } - reiserfs_update_inode_transaction(inode); - add_save_link(&th, inode, 1 /* Truncate */ ); - after_file_end = 1; - err = - journal_end(&th, inode->i_sb, - JOURNAL_PER_BALANCE_CNT); - reiserfs_write_unlock(inode->i_sb); - if (err) - return err; - } - result = do_sync_write(file, buf, count, ppos); - - if (after_file_end) { /* Now update i_size and remove the savelink */ - struct reiserfs_transaction_handle th; - reiserfs_write_lock(inode->i_sb); - err = journal_begin(&th, inode->i_sb, 1); - if (err) { - reiserfs_write_unlock(inode->i_sb); - return err; - } - reiserfs_update_inode_transaction(inode); - mark_inode_dirty(inode); - err = journal_end(&th, inode->i_sb, 1); - if (err) { - reiserfs_write_unlock(inode->i_sb); - return err; - } - err = remove_save_link(inode, 1 /* truncate */ ); - reiserfs_write_unlock(inode->i_sb); - if (err) - return err; - } - - return result; - } + if (file->f_flags & O_DIRECT) // Direct IO needs treatment + return do_sync_write(file, buf, count, ppos); if (unlikely((ssize_t) count < 0)) return -EINVAL; diff -r 218de24978fc -r b23ba06ac61f fs/reiserfs/inode.c --- a/fs/reiserfs/inode.c Wed Nov 01 10:24:05 2006 -0500 +++ b/fs/reiserfs/inode.c Wed Nov 01 10:24:08 2006 -0500 @@ -468,7 +468,8 @@ static int reiserfs_get_blocks_direct_io bh_result->b_size = (1 << inode->i_blkbits); ret = reiserfs_get_block(inode, iblock, bh_result, - create | GET_BLOCK_NO_DANGLE); + create | GET_BLOCK_NO_DANGLE | + GET_BLOCK_NO_IMUX); if (ret) goto out; - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html