From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Date: Fri, 26 Sep 2008 13:00:50 +0100 Subject: [Cluster-devel] [PATCH 07/12] GFS2: Direct IO write at end of file error In-Reply-To: <1222430455-4632-7-git-send-email-swhiteho@redhat.com> References: <1222430455-4632-1-git-send-email-swhiteho@redhat.com> <1222430455-4632-2-git-send-email-swhiteho@redhat.com> <1222430455-4632-3-git-send-email-swhiteho@redhat.com> <1222430455-4632-4-git-send-email-swhiteho@redhat.com> <1222430455-4632-5-git-send-email-swhiteho@redhat.com> <1222430455-4632-6-git-send-email-swhiteho@redhat.com> <1222430455-4632-7-git-send-email-swhiteho@redhat.com> Message-ID: <1222430455-4632-8-git-send-email-swhiteho@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: Bob Peterson This patch fixes a problem whereby a direct_io write doesn't fall back to buffered write properly at end of file. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c index e64a1b0..ae7126a 100644 --- a/fs/gfs2/ops_address.c +++ b/fs/gfs2/ops_address.c @@ -975,7 +975,7 @@ static int gfs2_ok_for_dio(struct gfs2_inode *ip, int rw, loff_t offset) if (gfs2_is_stuffed(ip)) return 0; - if (offset > i_size_read(&ip->i_inode)) + if (offset >= i_size_read(&ip->i_inode)) return 0; return 1; } -- 1.5.5.1