The patch titled
reiserfs: do not add save links for O_DIRECT writes
has been added to the -mm tree. Its filename is
reiserfs-do-not-add-save-links-for-o_direct-writes.patch
See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this
------------------------------------------------------
Subject: reiserfs: do not add save links for O_DIRECT writes
From: Vladimir V. Saveliev <[EMAIL PROTECTED]>
We add a save link for O_DIRECT writes to protect the i_size against the
crashes before we actually finish the I/O. If we hit an -ENOSPC in
aops->prepare_write(), we would do a truncate() to release the blocks which
might have got initialized. Now the truncate would add another save link
for the same inode causing a reiserfs panic for having multiple save links
for the same inode.
Signed-off-by: Vladimir V. Saveliev <[EMAIL PROTECTED]>
Signed-off-by: Amit Arora <[EMAIL PROTECTED]>
Signed-off-by: Suzuki K P <[EMAIL PROTECTED]>
Cc: Jeff Mahoney <[EMAIL PROTECTED]>
Cc: Chris Mason <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
fs/reiserfs/file.c | 52 +------------------------------------------
1 files changed, 2 insertions(+), 50 deletions(-)
diff -puN fs/reiserfs/file.c~reiserfs-do-not-add-save-links-for-o_direct-writes
fs/reiserfs/file.c
--- a/fs/reiserfs/file.c~reiserfs-do-not-add-save-links-for-o_direct-writes
+++ a/fs/reiserfs/file.c
@@ -1307,56 +1307,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)
+ return do_sync_write(file, buf, count, ppos);
if (unlikely((ssize_t) count < 0))
return -EINVAL;
_
Patches currently in -mm which might be from [EMAIL PROTECTED] are
patch-to-fix-reiserfs-bad-path-release-panic-on-2619-rc1.patch
reiserfs-do-not-add-save-links-for-o_direct-writes.patch
reiser4.patch
reiser4-hardirq-include-fix.patch
reiser4-fix-trivial-tyops-which-were-hard-to-hit.patch
reiser4-run-truncate_inode_pages-in-reiser4_delete_inode.patch
reiser4-bug-fixes.patch
reiser4-fix-gcc-ws-compains.patch
fs-reiser4-possible-cleanups.patch
reiser4-get_sb_dev-fix.patch
reiser4-vs-zoned-allocator.patch
reiser4-vs-streamline-generic_file_-interfaces-and-filemap.patch
reiser4-rename-generic_sounding_globalspatch.patch
reiser4-possible-cleanups-2.patch
reiser4-temp-fix.patch
fs-reiser4-more-possible-cleanups.patch
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html