]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ocfs2: Remove obscure error handling in direct_write.
authorTao Ma <tao.ma@oracle.com>
Wed, 9 Jun 2010 08:48:59 +0000 (16:48 +0800)
committerJoel Becker <joel.becker@oracle.com>
Fri, 10 Sep 2010 15:38:52 +0000 (08:38 -0700)
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: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/file.c

index 9a03c151b5ceabc169215d99777abb92e2d2ad36..4f9133f6368ea9cd1ab631b09bb18601763b9242 100644 (file)
@@ -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;
                }