Skip to contentSkip to conversation

ocfs2: fix a refcount condition checking -v2

PATCH New Wengang Wang 2 participants 2 messages Feb 9, 2010 – Feb 17, 2010 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 file.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/ocfs2/file.c +2 -4
index 06ccf6a..c9e4c51 100644
@@ -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
#1 lore raw

PATCH 1/1 ocfs2: fix a refcount condition checking -v2

Quoted 4 lines · Wengang Wang

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.

This patch, with a modified description, is now in the 'merge-window' branch of ocfs2.git.

Joel

Signature · 9 lines
"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