ocfs2: clear unaligned io flag when dio fails
authorJunxiao Bi <junxiao.bi@oracle.com>
Wed, 27 Jun 2012 09:09:55 +0000 (17:09 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Jul 2012 03:32:17 +0000 (04:32 +0100)
commit 3e5d3c35a68c9a933bdbdd8685bd1a205b57e806 upstream.

The unaligned io flag is set in the kiocb when an unaligned
dio is issued, it should be cleared even when the dio fails,
or it may affect the following io which are using the same
kiocb.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ocfs2/file.c

index 6e39668..07ee5b4 100644 (file)
@@ -2422,8 +2422,10 @@ out_dio:
                unaligned_dio = 0;
        }
 
-       if (unaligned_dio)
+       if (unaligned_dio) {
+               ocfs2_iocb_clear_unaligned_aio(iocb);
                atomic_dec(&OCFS2_I(inode)->ip_unaligned_aio);
+       }
 
 out:
        if (rw_level != -1)