Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95fa859a authored by Tao Ma's avatar Tao Ma Committed by Joel Becker
Browse files

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.

Signed-off-by: default avatarTao Ma <tao.ma@oracle.com>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent 3c3f20c9
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -2312,17 +2312,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(truncate): 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)
				truncate_setsize(inode, inode->i_size);
			ret = written;
			goto out_dio;
		}