lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <201307021345043628495@gmail.com>
Date:	Tue, 2 Jul 2013 13:45:08 +0800
From:	majianpeng <majianpeng@...il.com>
To:	sage <sage@...tank.com>
Cc:	ceph-devel <ceph-devel@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/3] ceph: update atime after read-operation.

Now ceph don't support updating atime after read-operation if the open
mode is CEPH_CAP_FILE_RD.There are two reasons:
1:in client of fs,it don't set dirty cap of CEPH_CAP_FILE_RD.
2:in mds,it only update the atime if the condition
"dirty & (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR) is true.
But if we can read, we can update atime. This patch only modify client to
support.

Signed-off-by: Jianpeng Ma <majianpeng@...il.com>
---
 fs/ceph/file.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 87df15a..9daea70 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -672,6 +672,15 @@ again:
 out:
 	dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n",
 	     inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret);
+
+	if (ret >= 0) {
+		int dirty;
+		spin_lock(&ci->i_ceph_lock);
+		dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_RD);
+		spin_unlock(&ci->i_ceph_lock);
+		if (dirty)
+			__mark_inode_dirty(inode, dirty);
+	}
 	ceph_put_cap_refs(ci, got);
 
 	if (checkeof && ret >= 0) {
-- 
1.8.1.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ