Wengang Wang
2010-Feb-09 06:57 UTC
[Ocfs2-devel] [PATCH] ocfs2: fix a refcount condition checking -v2
We disable DIO write if the inode has reflink. The way to determine if the inode has reflink is wrong in case (!has_refcount && direct_io). The patch fixes it. Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com> --- file.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 06ccf6a..c9e4c51 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1836,6 +1836,8 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry, &meta_level); if (has_refcount) *has_refcount = 1; + if (direct_io) + *direct_io = 0; } if (ret < 0) { @@ -1859,10 +1861,6 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry, break; } - if (has_refcount && *has_refcount == 1) { - *direct_io = 0; - break; - } /* * Allowing concurrent direct writes means * i_size changes wouldn't be synchronized, so
Joel Becker
2010-Feb-17 06:16 UTC
[Ocfs2-devel] [PATCH] ocfs2: fix a refcount condition checking -v2
On Tue, Feb 09, 2010 at 02:57:45PM +0800, Wengang Wang wrote:> We disable DIO write if the inode has reflink. The way to determine if the inode > has reflink is wrong in case (!has_refcount && direct_io). The patch fixes it. > > Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com>This patch, with a modified description, is now in the 'merge-window' branch of ocfs2.git. Joel -- "There is a country in Europe where multiple-choice tests are illegal." - Sigfried Hulzer Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127