The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] Bind Mount Extensions 0.04
@ 2004-03-15  3:53 Herbert Poetzl
       [not found] ` <20040315045952.GD14537@alpha.home.local>
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Poetzl @ 2004-03-15  3:53 UTC (permalink / raw)
  To: Andrew Morton, Marcelo Tosatti, Linus Torvalds; +Cc: Al Viro, linux-kernel


Greetings!

The following patch extends the 'noatime', 'nodiratime' and 
last but not least the 'ro' (read only) mount option to the 
vfs --bind mounts, allowing them to behave like any other 
mount, by honoring those mount flags (which are silently 
ignored by the current implementation)

an older version of this patch was included in 2.6.0-test6-mm2, 
and it is currently used by several people, without any issues, 
so I'd kindly request to consider it for inclusion into mainline.

if the size of the patch is an issue, I can break it down into
three parts, one preparing the existing structures, one adding
noatime/nodiratime and one doing the read only stuff.


the patch makes the following syscalls behave like expected

 - open (read/write/trunc), create
 - link, symlink, unlink
 - mknod (reg/block/char/fifo), mkfifo
 - mkdir, rmdir
 - (f)chown, (f)chmod, utime
 - access, truncate, mmap
 - ioctl (gen/ext2/ext3/reiser)


the following cases where verified for --bind ro (test tool) 
and showed no difference to a 'real' ro mounted filesystem:

 - open()
 - O_RDONLY: 	file, dir, symlink, broken, cdev, bdev, fifo, new
 - O_WRONLY: 	file, dir, symlink, broken, cdev, bdev, fifo, new
 - O_RDWR: 	file, dir, symlink, broken, cdev, bdev, fifo, new
 - O_CREAT: 	file
 
 - mkdir()  	dir, new, invalid
 - mkfifo() 	fifo, new, invalid

 - mknod()  	
 - S_IFREG: 	file, new, invalid
 - S_IFCHR: 	cdev, new, invalid
 - S_IFBLK: 	bdev, new, invalid
 - S_IFIFO: 	fifo, new, invalid
 
 - chown()  	file, invalid		 - fchown()	file
 - chmod()	file, invalid		 - fchmod()	file

 - link()   	file/file, file/invalid, invalid/file
 - symlink()	file/file, file/invalid, invalid/file
 
 - rename() 	file/file, file/invalid, invalid/file
 - rmdir()  	dir, new, invalid
 - truncate()	file, new invalid   	 - ftruncate()	file
 
 - unlink() 	file, bdev, cdev, fifo, new, invalid


you can download them here, if you prefer that over 
extracting them from emails ...

  http://www.13thfloor.at/patches/

TIA,
Herbert



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

* Re: [PATCH] Bind Mount Extensions 0.04
       [not found] ` <20040315045952.GD14537@alpha.home.local>
@ 2004-03-15  5:36   ` Herbert Poetzl
  2004-03-15 22:04     ` Willy Tarreau
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Poetzl @ 2004-03-15  5:36 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux-kernel

On Mon, Mar 15, 2004 at 05:59:52AM +0100, Willy Tarreau wrote:
> Hi Herbert,
> 
> On Mon, Mar 15, 2004 at 04:53:51AM +0100, Herbert Poetzl wrote:
>  
> > an older version of this patch was included in 2.6.0-test6-mm2, 
> > and it is currently used by several people, without any issues, 
> > so I'd kindly request to consider it for inclusion into mainline.
> 
> I have tested 0.03 on 2.4.25 + some other patches, and discovered something
> annoying : an attempt to change something on the R/O FS marked the parent
> FS busy. But I cannot say for sure that it was a problem with your patch,
> because that kernel had several others. I'll try to reproduce on a naked
> kernel. To reproduce it, you can try this :

it _was_ an issue with 0.03 on 2.4.25 (see changelog)

> # mount /dev/hdaXX /mnt/disk
> # mount -r --bind /mnt/disk /mnt/ro
> # touch /mnt/ro/foo
> Read-only file-system (that's what was expected)
> # umount /mnt/ro
> (I don't remember if the problem already arises here)
> # umount /mnt/disk
> device is busy

this has been fixed in 0.04 for 2.4.25, if you need
the fix to include for 0.03 (for whatever reason)
here is the relevant hunk ..

--- linux-2.4.25-bme0.03/fs/namei.c     2004-03-10 14:45:36.000000000 +0100
+++ linux-2.4.25-bme0.04/fs/namei.c     2004-03-10 12:18:35.000000000 +0100
@@ -1045,7 +1045,7 @@ int open_namei(const char * pathname, in
                return error;
        error = -EROFS;
        if (MNT_IS_RDONLY(nd->mnt))
-               return error;
+               goto exit;
 
        /*
         * We have the parent and last component. First of all, check

> Other than that, this feature is really excellent !

thanks for using it ...

> Thanks,
> Willy

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

* Re: [PATCH] Bind Mount Extensions 0.04
  2004-03-15  5:36   ` Herbert Poetzl
@ 2004-03-15 22:04     ` Willy Tarreau
  0 siblings, 0 replies; 3+ messages in thread
From: Willy Tarreau @ 2004-03-15 22:04 UTC (permalink / raw)
  To: herbert, linux-kernel

Hi Herbert,

On Mon, Mar 15, 2004 at 06:36:55AM +0100, Herbert Poetzl wrote:
> > # mount /dev/hdaXX /mnt/disk
> > # mount -r --bind /mnt/disk /mnt/ro
> > # touch /mnt/ro/foo
> > Read-only file-system (that's what was expected)
> > # umount /mnt/ro
> > (I don't remember if the problem already arises here)
> > # umount /mnt/disk
> > device is busy
> 
> this has been fixed in 0.04 for 2.4.25, if you need
> the fix to include for 0.03 (for whatever reason)
> here is the relevant hunk ..

I can confirm that it now works perfectly, as expected.

Thank you very much,
Willy


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

end of thread, other threads:[~2004-03-15 22:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-15  3:53 [PATCH] Bind Mount Extensions 0.04 Herbert Poetzl
     [not found] ` <20040315045952.GD14537@alpha.home.local>
2004-03-15  5:36   ` Herbert Poetzl
2004-03-15 22:04     ` Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox