linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch 2/6] Bind Mount Extensions 0.06
@ 2005-02-22 12:11 Herbert Poetzl
  2005-02-23 23:01 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Poetzl @ 2005-02-22 12:11 UTC (permalink / raw)
  To: Andrew Morton, Al Viro; +Cc: Linux Kernel ML



;
; Bind Mount Extensions
;
; This part adds the required checks for touch_atime() to allow
; for vfsmount based NOATIME and NODIRATIME
; autofs4 update_atime is the only exception (ignored on purpose)
;
; Copyright (C) 2003-2005 Herbert Pötzl <herbert@13thfloor.at>
;
; Changelog:
;
;   0.01  - broken out part from bme0.05
;
; this patch is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License
; as published by the Free Software Foundation; either version 2
; of the License, or (at your option) any later version.
;
; this patch is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;

diff -NurpP --minimal linux-2.6.11-rc4-bme0.06-bm0.01/include/linux/fs.h linux-2.6.11-rc4-bme0.06-bm0.01-at0.01/include/linux/fs.h
--- linux-2.6.11-rc4-bme0.06-bm0.01/include/linux/fs.h	2005-02-19 06:31:24 +0100
+++ linux-2.6.11-rc4-bme0.06-bm0.01-at0.01/include/linux/fs.h	2005-02-19 06:31:36 +0100
@@ -1038,8 +1038,16 @@ static inline void mark_inode_dirty_sync
 
 static inline void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
 {
-	/* per-mountpoint checks will go here */
-	update_atime(dentry->d_inode);
+	struct inode *inode = dentry->d_inode;
+
+	if (MNT_IS_NOATIME(mnt))
+		return;
+	if (S_ISDIR(inode->i_mode) && MNT_IS_NODIRATIME(mnt))
+		return;
+	if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt))
+		return;
+
+	update_atime(inode);
 }
 
 static inline void file_accessed(struct file *file)

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

* Re: [Patch 2/6] Bind Mount Extensions 0.06
  2005-02-22 12:11 [Patch 2/6] Bind Mount Extensions 0.06 Herbert Poetzl
@ 2005-02-23 23:01 ` Christoph Hellwig
  2005-02-24 21:17   ` Herbert Poetzl
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2005-02-23 23:01 UTC (permalink / raw)
  To: Andrew Morton, Al Viro, Linux Kernel ML

On Tue, Feb 22, 2005 at 01:11:29PM +0100, Herbert Poetzl wrote:
> 
> 
> ;
> ; Bind Mount Extensions
> ;
> ; This part adds the required checks for touch_atime() to allow
> ; for vfsmount based NOATIME and NODIRATIME
> ; autofs4 update_atime is the only exception (ignored on purpose)

and that purpose is?  Did you discuss this with the autofs maintainers?


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

* Re: [Patch 2/6] Bind Mount Extensions 0.06
  2005-02-23 23:01 ` Christoph Hellwig
@ 2005-02-24 21:17   ` Herbert Poetzl
  2005-02-25 13:15     ` raven
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Poetzl @ 2005-02-24 21:17 UTC (permalink / raw)
  To: Christoph Hellwig, Andrew Morton, Al Viro, Linux Kernel ML; +Cc: raven, autofs

On Wed, Feb 23, 2005 at 11:01:05PM +0000, Christoph Hellwig wrote:
> On Tue, Feb 22, 2005 at 01:11:29PM +0100, Herbert Poetzl wrote:
> > 
> > 
> > ;
> > ; Bind Mount Extensions
> > ;
> > ; This part adds the required checks for touch_atime() to allow
> > ; for vfsmount based NOATIME and NODIRATIME
> > ; autofs4 update_atime is the only exception (ignored on purpose)
> 
> and that purpose is?  

this is based on a statement from Al Viro:

| autofs4 use - AFAICS there we want atime updated unconditionally, 
| so calling update_atime() (update atime after checking 
| noatime/nodiratime/readonly flags) is wrong.

agreed, maybe a proper fix would be better ...

> Did you discuss this with the autofs maintainers?

not yet!
(cc-ed to automounter maintainer and list)

thanks,
Herbert

> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [Patch 2/6] Bind Mount Extensions 0.06
  2005-02-24 21:17   ` Herbert Poetzl
@ 2005-02-25 13:15     ` raven
  0 siblings, 0 replies; 4+ messages in thread
From: raven @ 2005-02-25 13:15 UTC (permalink / raw)
  To: Herbert Poetzl
  Cc: Christoph Hellwig, Andrew Morton, Al Viro, Linux Kernel ML, autofs

On Thu, 24 Feb 2005, Herbert Poetzl wrote:

> On Wed, Feb 23, 2005 at 11:01:05PM +0000, Christoph Hellwig wrote:
>> On Tue, Feb 22, 2005 at 01:11:29PM +0100, Herbert Poetzl wrote:
>>>
>>>
>>> ;
>>> ; Bind Mount Extensions
>>> ;
>>> ; This part adds the required checks for touch_atime() to allow
>>> ; for vfsmount based NOATIME and NODIRATIME
>>> ; autofs4 update_atime is the only exception (ignored on purpose)
>>
>> and that purpose is?
>
> this is based on a statement from Al Viro:
>
> | autofs4 use - AFAICS there we want atime updated unconditionally,
> | so calling update_atime() (update atime after checking
> | noatime/nodiratime/readonly flags) is wrong.
>
> agreed, maybe a proper fix would be better ...
>
>> Did you discuss this with the autofs maintainers?

I've had a look at the patch and I can't see any problem.

autofs4 doesn't use the inode atime for expire purposes but does update it 
in sync with its dentry info struct field that is used for this purpose.

So AFAICS the atime is an external view of expire status, 
but only when updated within the autofs4 module VFS callbacks.

I haven't yet looked at the v3 (autofs) module.
I'll get back if I see an issue there.

Ian


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

end of thread, other threads:[~2005-02-25 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22 12:11 [Patch 2/6] Bind Mount Extensions 0.06 Herbert Poetzl
2005-02-23 23:01 ` Christoph Hellwig
2005-02-24 21:17   ` Herbert Poetzl
2005-02-25 13:15     ` raven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).