Skip to contentSkip to conversation

ocfs2: Remove obscure error handling in direct_write.

PATCH New Tao Ma 2 participants 2 messages Jun 9, 2010 – Aug 12, 2010 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 ocfs2: Remove obscure error handling in direct_write.

In ocfs2, actually we don't allow any direct write pass i_size, see the function ocfs2_prepare_inode_for_write. So we don't need the bogus simple_setsize.

---
 fs/ocfs2/file.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)
fs/ocfs2/file.c +0 -11
index 06fd85c..4f782b0 100644
@@ -2114,17 +2114,6 @@ relock:
 		written = generic_file_direct_write(iocb, iov, &nr_segs, *ppos,
 						    ppos, count, ocount);
 		if (written < 0) {
-			/*
-			 * direct write may have instantiated a few
-			 * blocks outside i_size. Trim these off again.
-			 * Don't need i_size_read because we hold i_mutex.
-			 *
-			 * XXX(hch): this looks buggy because ocfs2 did not
-			 * actually implement ->truncate.  Take a look at
-			 * the new truncate sequence and update this accordingly
-			 */
-			if (*ppos + count > inode->i_size)
-				simple_setsize(inode, inode->i_size);
 			ret = written;
 			goto out_dio;
 		}
Signature · 1 line
1.5.5
#1 lore raw

PATCH 1/1 ocfs2: Remove obscure error handling in direct_write.

Quoted 5 lines · Tao Ma

In ocfs2, actually we don't allow any direct write pass i_size, see the function ocfs2_prepare_inode_for_write. So we don't need the bogus simple_setsize.

This patch is now in the merge-window branch of ocfs2.git.

Joel

Signature · 9 lines
Life's Little Instruction Book #444

	"Never underestimate the power of a kind word or deed."

Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127