Skip to contentSkip to conversation

Direct IO write at end of file error

PATCH New Bob Peterson 2 participants 2 messages Sep 11, 2008 – Sep 15, 2008 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Direct IO write at end of file error

Hi,

This patch fixes a problem whereby a direct_io write doesn't fall back to buffered write properly at end of file.

Regards,

Bob Peterson
--

 fs/gfs2/ops_address.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/ops_address.c +1 -1
index e64a1b0..ae7126a 100644
@@ -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 lore raw

PATCH 1/1 Direct IO write at end of file error

Hi,

Well spotted. Applied, thanks,

Steve.

Quoted 26 lines · Bob Peterson

Hi,

This patch fixes a problem whereby a direct_io write doesn't fall back to buffered write properly at end of file.

Regards,

Bob Peterson
--

 fs/gfs2/ops_address.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/ops_address.c +1 -1
index e64a1b0..ae7126a 100644
@@ -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;
 }