All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 0/2] support strictatime in ocfs2
@ 2011-03-02 11:27 Tiger Yang
  2011-03-02 11:30 ` [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: " Tiger Yang
  2011-03-02 11:32 ` [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt Tiger Yang
  0 siblings, 2 replies; 8+ messages in thread
From: Tiger Yang @ 2011-03-02 11:27 UTC (permalink / raw)
  To: ocfs2-devel

Hi, all,

As strictatime was introduced into vfs, we must support it in ocfs2.
This two patches (one for kernel, one for tools) adding support to it 
and update the relative document in ocfs2.
Vfs set RELATIME by default at the beginning, so we need STRICTATIME to 
clear that flag, otherwise we can not always update atime.
With strictatime, the the minimum update interval is specified by 
atime_quantum,  and these two options need work together.

thanks,
tiger

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: support strictatime in ocfs2
  2011-03-02 11:27 [Ocfs2-devel] [PATCH 0/2] support strictatime in ocfs2 Tiger Yang
@ 2011-03-02 11:30 ` Tiger Yang
  2011-03-26 21:42   ` Joel Becker
  2011-03-02 11:32 ` [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt Tiger Yang
  1 sibling, 1 reply; 8+ messages in thread
From: Tiger Yang @ 2011-03-02 11:30 UTC (permalink / raw)
  To: ocfs2-devel

Strictatime was introduced into vfs, so this patch adding support
to it in ocfs2. Now we have three types behavior about update atime,
noatime, relatime and strictatime. With strictatime, the minimum
update interval is specified by atime_quantum, which defaults to 60 secs.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
---
 mount.ocfs2/mount.ocfs2.8.in  |   11 ++++++-----
 mount.ocfs2/mount_constants.h |    3 +++
 mount.ocfs2/opts.c            |    2 +-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/mount.ocfs2/mount.ocfs2.8.in b/mount.ocfs2/mount.ocfs2.8.in
index b367bf1..3bd1d09 100644
--- a/mount.ocfs2/mount.ocfs2.8.in
+++ b/mount.ocfs2/mount.ocfs2.8.in
@@ -20,17 +20,18 @@ specify this mount option to delay the system from mounting the volume until
 after the network has been enabled.
 
 .TP
-\fBatime\_quantum=nrsec\fR
-The file system will not update atime unless this number of seconds has passed
-since the last update. Set to zero to always update atime. It defaults to 60 secs.
+\fBnoatime\fR
+The file system will not update access time.
 
 .TP
 \fBrelatime\fR
 The file system only update atime if the previous atime is older than mtime or ctime.
 
 .TP
-\fBnoatime\fR
-The file system will not update access time.
+\fBstrictatime,atime\_quantum=nrsec\fR
+The file system will always perform atime updates, but the minimum update
+interval is specified by atime_quantum. Atime_quantum defaults to 60 secs,
+set it to zero to always update atime. These two options need work together.
 
 .TP
 \fBacl / noacl\fR
diff --git a/mount.ocfs2/mount_constants.h b/mount.ocfs2/mount_constants.h
index ed475db..feffe8f 100644
--- a/mount.ocfs2/mount_constants.h
+++ b/mount.ocfs2/mount_constants.h
@@ -60,6 +60,9 @@ if we have a stack or plain mount - mount atop of it, forming a stack. */
 #ifndef MS_RELATIME
 #define MS_RELATIME	(1<<21)	/* Update atime relative to mtime/ctime. */
 #endif
+#ifndef MS_STRICTATIME
+#define MS_STRICTATIME	(1<<24)	/* Strict atime semantics */
+#endif
 /*
  * Magic mount flag number. Had to be or-ed to the flag values.
  */
diff --git a/mount.ocfs2/opts.c b/mount.ocfs2/opts.c
index 5ecd36b..96037da 100644
--- a/mount.ocfs2/opts.c
+++ b/mount.ocfs2/opts.c
@@ -78,12 +78,12 @@ static const struct opt_map opt_map[] = {
   { "mand",	0, 0, MS_MANDLOCK },	/* Allow mandatory locks on this FS */
   { "nomand",	0, 1, MS_MANDLOCK },	/* Forbid mandatory locks on this FS */
   { "loop",	1, 0, MS_LOOP	},	/* use a loop device */
-  { "atime",	0, 1, MS_NOATIME },	/* Update access time */
   { "noatime",	0, 0, MS_NOATIME },	/* Do not update access time */
   { "relatime",	0, 0, MS_RELATIME },	/* only update atime if previous */
 					/* atime is older than mtime/ctime */
   { "diratime",	0, 1, MS_NODIRATIME },	/* Update dir access times */
   { "nodiratime", 0, 0, MS_NODIRATIME },/* Do not update dir access times */
+  { "strictatime", 0, 0, MS_STRICTATIME },/* Strict atime semantics */
   { "kudzu",	0, 0, MS_COMMENT },	/* Silently remove this option (backwards compat use only) */
   { "managed",	0, 0, MS_COMMENT },	/* Silently remove this option */
   { NULL,	0, 0, 0	}
-- 
1.7.2.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt
  2011-03-02 11:27 [Ocfs2-devel] [PATCH 0/2] support strictatime in ocfs2 Tiger Yang
  2011-03-02 11:30 ` [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: " Tiger Yang
@ 2011-03-02 11:32 ` Tiger Yang
  2011-03-26 21:44   ` Joel Becker
  2011-05-24  6:56   ` Joel Becker
  1 sibling, 2 replies; 8+ messages in thread
From: Tiger Yang @ 2011-03-02 11:32 UTC (permalink / raw)
  To: ocfs2-devel

As ocfs2 supports relatime and strictatime, we need update the
relative document. Atime_quantum need work with strictatime, so only
show it in procfs when mount with strictatime.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
---
 Documentation/filesystems/ocfs2.txt |    8 +++++++-
 fs/ocfs2/super.c                    |    2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt
index 5393e66..a149606 100644
--- a/Documentation/filesystems/ocfs2.txt
+++ b/Documentation/filesystems/ocfs2.txt
@@ -46,9 +46,15 @@ errors=panic		Panic and halt the machine if an error occurs.
 intr		(*)	Allow signals to interrupt cluster operations.
 nointr			Do not allow signals to interrupt cluster
 			operations.
+noatime			Do not update access time.
+relatime(*)		Update atime if the previous atime is older than
+			mtime or ctime
+strictatime		Always update atime, but the minimum update interval
+			is specified by atime_quantum.
 atime_quantum=60(*)	OCFS2 will not update atime unless this number
 			of seconds has passed since the last update.
-			Set to zero to always update atime.
+			Set to zero to always update atime. This option need
+			work with strictatime.
 data=ordered	(*)	All data are forced directly out to the main file
 			system prior to its metadata being committed to the
 			journal.
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 38f986d..f5463a6 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1564,7 +1564,7 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
 	if (osb->preferred_slot != OCFS2_INVALID_SLOT)
 		seq_printf(s, ",preferred_slot=%d", osb->preferred_slot);
 
-	if (osb->s_atime_quantum != OCFS2_DEFAULT_ATIME_QUANTUM)
+	if (!(mnt->mnt_flags & MNT_NOATIME) && !(mnt->mnt_flags & MNT_RELATIME))
 		seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
 
 	if (osb->osb_commit_interval)
-- 
1.7.2.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: support strictatime in ocfs2
  2011-03-02 11:30 ` [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: " Tiger Yang
@ 2011-03-26 21:42   ` Joel Becker
  2011-03-28  8:37     ` Tiger Yang
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Becker @ 2011-03-26 21:42 UTC (permalink / raw)
  To: ocfs2-devel

On Wed, Mar 02, 2011 at 07:30:37PM +0800, Tiger Yang wrote:
> Strictatime was introduced into vfs, so this patch adding support
> to it in ocfs2. Now we have three types behavior about update atime,
> noatime, relatime and strictatime. With strictatime, the minimum
> update interval is specified by atime_quantum, which defaults to 60 secs.

<snip>

> diff --git a/mount.ocfs2/opts.c b/mount.ocfs2/opts.c
> index 5ecd36b..96037da 100644
> --- a/mount.ocfs2/opts.c
> +++ b/mount.ocfs2/opts.c
> @@ -78,12 +78,12 @@ static const struct opt_map opt_map[] = {
>    { "mand",	0, 0, MS_MANDLOCK },	/* Allow mandatory locks on this FS */
>    { "nomand",	0, 1, MS_MANDLOCK },	/* Forbid mandatory locks on this FS */
>    { "loop",	1, 0, MS_LOOP	},	/* use a loop device */
> -  { "atime",	0, 1, MS_NOATIME },	/* Update access time */

	Won't this break people saying 'mount -o noatime'?

Joel

-- 

"Maybe the time has drawn the faces I recall.
 But things in this life change very slowly,
 If they ever change at all."

			http://www.jlbec.org/
			jlbec at evilplan.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt
  2011-03-02 11:32 ` [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt Tiger Yang
@ 2011-03-26 21:44   ` Joel Becker
  2011-03-28  8:50     ` Tiger Yang
  2011-05-24  6:56   ` Joel Becker
  1 sibling, 1 reply; 8+ messages in thread
From: Joel Becker @ 2011-03-26 21:44 UTC (permalink / raw)
  To: ocfs2-devel

On Wed, Mar 02, 2011 at 07:32:09PM +0800, Tiger Yang wrote:
> -	if (osb->s_atime_quantum != OCFS2_DEFAULT_ATIME_QUANTUM)
> +	if (!(mnt->mnt_flags & MNT_NOATIME) && !(mnt->mnt_flags & MNT_RELATIME))
>  		seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);

	I can see why you don't print in the case of noatime or
relatime, but you should keep the check for DEFAULT_ATIME_QUANTUM.
There's no point in printing it if it is the default.

Joel

-- 

Life's Little Instruction Book #510

	"Count your blessings."

			http://www.jlbec.org/
			jlbec at evilplan.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: support strictatime in ocfs2
  2011-03-26 21:42   ` Joel Becker
@ 2011-03-28  8:37     ` Tiger Yang
  0 siblings, 0 replies; 8+ messages in thread
From: Tiger Yang @ 2011-03-28  8:37 UTC (permalink / raw)
  To: ocfs2-devel

On 03/27/2011 05:42 AM, Joel Becker wrote:
> diff --git a/mount.ocfs2/opts.c b/mount.ocfs2/opts.c
> index 5ecd36b..96037da 100644
> --- a/mount.ocfs2/opts.c
> +++ b/mount.ocfs2/opts.c
> @@ -78,12 +78,12 @@ static const struct opt_map opt_map[] = {
>     { "mand",	0, 0, MS_MANDLOCK },	/* Allow mandatory locks on this FS */
>     { "nomand",	0, 1, MS_MANDLOCK },	/* Forbid mandatory locks on this FS */
>     { "loop",	1, 0, MS_LOOP	},	/* use a loop device */
> -  { "atime",	0, 1, MS_NOATIME },	/* Update access time */
> 	Won't this break people saying 'mount -o noatime'?
No, It would not affect "-o noatime", actually it just disallowed "-o 
atime".

Thanks,
Tiger

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt
  2011-03-26 21:44   ` Joel Becker
@ 2011-03-28  8:50     ` Tiger Yang
  0 siblings, 0 replies; 8+ messages in thread
From: Tiger Yang @ 2011-03-28  8:50 UTC (permalink / raw)
  To: ocfs2-devel

On 03/27/2011 05:44 AM, Joel Becker wrote:
> On Wed, Mar 02, 2011 at 07:32:09PM +0800, Tiger Yang wrote:
>> -	if (osb->s_atime_quantum != OCFS2_DEFAULT_ATIME_QUANTUM)
>> +	if (!(mnt->mnt_flags&  MNT_NOATIME)&&  !(mnt->mnt_flags&  MNT_RELATIME))
>>   		seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
> 	I can see why you don't print in the case of noatime or
> relatime, but you should keep the check for DEFAULT_ATIME_QUANTUM.
> There's no point in printing it if it is the default.
Hi, Joel,
I have thought this issue, I choose to show the quantum value when user 
mount with strictatime, because we don't as "strict" as the other file 
system to update atime by default.  If we don't show the default quantum 
value, that may be confuse the new user to ocfs2.

Thanks,
tiger

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt
  2011-03-02 11:32 ` [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt Tiger Yang
  2011-03-26 21:44   ` Joel Becker
@ 2011-05-24  6:56   ` Joel Becker
  1 sibling, 0 replies; 8+ messages in thread
From: Joel Becker @ 2011-05-24  6:56 UTC (permalink / raw)
  To: ocfs2-devel

On Wed, Mar 02, 2011 at 07:32:09PM +0800, Tiger Yang wrote:
> As ocfs2 supports relatime and strictatime, we need update the
> relative document. Atime_quantum need work with strictatime, so only
> show it in procfs when mount with strictatime.
> 
> Signed-off-by: Tiger Yang <tiger.yang@oracle.com>

	This patch is now in the merge-window branch of ocfs2.git.

Joel

-- 

"Too much walking shoes worn thin.
 Too much trippin' and my soul's worn thin.
 Time to catch a ride it leaves today
 Her name is what it means.
 Too much walking shoes worn thin."

			http://www.jlbec.org/
			jlbec at evilplan.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-24  6:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 11:27 [Ocfs2-devel] [PATCH 0/2] support strictatime in ocfs2 Tiger Yang
2011-03-02 11:30 ` [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: " Tiger Yang
2011-03-26 21:42   ` Joel Becker
2011-03-28  8:37     ` Tiger Yang
2011-03-02 11:32 ` [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt Tiger Yang
2011-03-26 21:44   ` Joel Becker
2011-03-28  8:50     ` Tiger Yang
2011-05-24  6:56   ` Joel Becker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.