From 1eb0f2df8bdd94df330af7c828f7762b51989d15 Mon Sep 17 00:00:00 2001
From: johann <johann>
Date: Mon, 29 Oct 2007 16:08:06 +0000
Subject: [PATCH] Branch HEAD b=13930 i=johann,adilger

ll_inode_fill_obdo() expects OBD_BRW_WRITE or OBD_BRW_READ as rw argument
rather than READ/WRITE.
---
 lustre/ChangeLog    | 6 ++++++
 lustre/llite/rw26.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 04788de1b3..760b47b4a6 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -465,6 +465,12 @@ Details    : Remove 2.5.0 check from dcache.c dir.c file.c llite_internal.h
 	     mds_internal.h mds_lib.c mds_open.c mds_reint.c mds_xattr.c
 	     in mds subsystem.
 
+Severity   : normal
+Frequency  : when using O_DIRECT and quotas
+Bugzilla   : 13930
+Description: Incorrect file ownership on O_DIRECT output files
+Details    : block usage reported by 'lfs quota' does not take into account
+	     files that have been written with O_DIRECT.
 
 --------------------------------------------------------------------------------
 
diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c
index 3cfc77d33e..85450c1533 100644
--- a/lustre/llite/rw26.c
+++ b/lustre/llite/rw26.c
@@ -177,7 +177,7 @@ static ssize_t ll_direct_IO_26_seg(int rw, struct inode *inode,
                         POISON_PAGE(pages[i], 0x0d);
         }
 
-        ll_inode_fill_obdo(inode, rw, &oa);
+        ll_inode_fill_obdo(inode, rw == WRITE ? OBD_BRW_WRITE : OBD_BRW_READ, &oa);
 
         if (rw == WRITE) {
                 lprocfs_counter_add(ll_i2sbi(inode)->ll_stats,
-- 
GitLab