[PATCH 04/14] PMFS: Check f_mode, not f_flags

Matthew Wilcox matthew.r.wilcox at intel.com
Mon Oct 7 09:36:47 EDT 2013


From: Matthew Wilcox <willy at linux.intel.com>

FMODE_WRITE is set in f_mode, not f_flags.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox at intel.com>
---
 fs/pmfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pmfs/file.c b/fs/pmfs/file.c
index e5805c5..54c4724 100644
--- a/fs/pmfs/file.c
+++ b/fs/pmfs/file.c
@@ -250,7 +250,7 @@ static int pmfs_flush(struct file *file, fl_owner_t id)
 	int ret = 0;
 	/* if the file was opened for writing, make it persistent.
 	 * TODO: Should we be more smart to check if the file was modified? */
-	if (file->f_flags & FMODE_WRITE) {
+	if (file->f_mode & FMODE_WRITE) {
 		PERSISTENT_MARK();
 		PERSISTENT_BARRIER();
 	}
-- 
1.8.4.rc3




More information about the Linux-pmfs mailing list