file locks: Split flock_find_conflict out of flock_lock_file

2008-01-14 Thread Matthew Wilcox
Reduce the spaghetti-like nature of flock_lock_file by making the chunk of code labelled find_conflict into its own function. Also allocate memory before taking the kernel lock in preparation for switching to a normal spinlock. Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> diff --git a/fs/l

file locks: Use wait_event_interruptible_timeout()

2008-01-14 Thread Matthew Wilcox
interruptible_sleep_on_locked() is just an open-coded wait_event_interruptible_timeout() with a few assumptions since we know we hold the BKL. locks_block_on_timeout() is only used in one place, so it's actually simpler to inline it into its caller. Signed-off-by: Matthew Wilcox <[EMAIL PROTECTE

Re: Leak in nlmsvc_testlock for async GETFL case

2008-01-14 Thread Matthew Wilcox
On Mon, Jan 14, 2008 at 03:44:19PM -0500, J. Bruce Fields wrote: > Thanks! I've queued it up for 2.6.25. Hi Bruce, I haven't had as much time to play with de-BKL-ising fs/locks.c as I would like, so fixing that for 2.6.25 is probably out of the question, but here are two janitorial patches that

Re: [RFD] Incremental fsck

2008-01-14 Thread Ric Wheeler
Pavel Machek wrote: On Sat 2008-01-12 09:51:40, Theodore Tso wrote: On Wed, Jan 09, 2008 at 02:52:14PM +0300, Al Boldi wrote: Ok, but let's look at this a bit more opportunistic / optimistic. Even after a black-out shutdown, the corruption is pretty minimal, using ext3fs at least. After a

Re: [patch 9/9] unprivileged mounts: add "no submounts" flag

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Add a new mount flag "nomnt", which denies submounts for the owner. > This would be useful, if we want to support traditional /etc/fstab > based user mounts. > > In this case mount(8) would still have to be

Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse mounts

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Use FS_SAFE for "fuse" fs type, but not for "fuseblk". > > FUSE was designed from the beginning to be safe for unprivileged users. This > has also been verified in practice over many years. In addition un

Re: [UNIONFS] 00/29 Unionfs and related patches pre-merge review (v2)

2008-01-14 Thread Jesse Hathaway
Erez Zadok cs.sunysb.edu> writes: > > Huh? There's still aboslutely not fix to the underlying problems of > > the whole idea. I think we made it pretty clear that unionfs is not > > the way to go, and that we'll get the union mount patches clear once > > the per-mountpoint r/o and unprivilegue

Re: [patch 8/9] unprivileged mounts: propagation: inherit owner from parent

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > On mount propagation, let the owner of the clone be inherited from the > parent into which it has been propagated. Also if the parent has the > "nosuid" flag, set this flag for the child as well. What abou

Re: [patch 6/9] unprivileged mounts: allow unprivileged mounts

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Define a new fs flag FS_SAFE, which denotes, that unprivileged mounting of > this filesystem may not constitute a security problem. > > Since most filesystems haven't been designed with unprivileged mountin

Re: [patch 5/9] unprivileged mounts: allow unprivileged bind mounts

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Allow bind mounts to unprivileged users if the following conditions are met: > > - mountpoint is not a symlink > - parent mount is owned by the user > - the number of user mounts is below the maximum

Re: [patch 4/9] unprivileged mounts: propagate error values from clone_mnt

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Allow clone_mnt() to return errors other than ENOMEM. This will be used for > returning a different error value when the number of user mounts goes over the > limit. > > Fix copy_tree() to return EPERM for

Re: [linux-cifs-client] review 4, was Re: projected date for mount.cifs to support DFS junction points

2008-01-14 Thread Christoph Hellwig
On Mon, Jan 14, 2008 at 04:15:05PM +0300, Q (Igor Mammedov) wrote: > > + dput(nd->dentry); > > + nd->dentry = dget(dentry); > > + if (d_mountpoint(nd->dentry)) > > + goto out_follow; > > > > A link should never be a mountpoint. > > why link? after patch 5 are applied DFS junction

Re: [patch 3/9] unprivileged mounts: account user mounts

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Add sysctl variables for accounting and limiting the number of user > mounts. > > The maximum number of user mounts is set to 1024 by default. This > won't in itself enable user mounts, setting a mount to

Re: [patch 2/9] unprivileged mounts: allow unprivileged umount

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > The owner doesn't need sysadmin capabilities to call umount(). > > Similar behavior as umount(8) on mounts having "user=UID" option in /etc/mtab. > The difference is that umount also checks /etc/fstab, pres

Re: [patch 1/9] unprivileged mounts: add user mounts to the kernel

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > This patchset adds support for keeping mount ownership information in the > kernel, and allow unprivileged mount(2) and umount(2) in certain cases. > > The mount owner has the following privileges: > > -

Re: Leak in nlmsvc_testlock for async GETFL case

2008-01-14 Thread J. Bruce Fields
On Fri, Jan 11, 2008 at 09:57:35PM -0500, Oleg Drokin wrote: > Hello! > > On Nov 29, 2007, at 2:08 PM, J. Bruce Fields wrote: > >> On Thu, Nov 29, 2007 at 01:46:04PM -0500, Oleg Drokin wrote: >>> Hello! >>> >>> Per our discussion, I am resending this patch that fixes a leak in >>> nlmsvc_testlo

Re: lockdep warning with LTP dio test (v2.6.24-rc6-125-g5356f66)

2008-01-14 Thread Chris Mason
On Mon, 14 Jan 2008 18:06:09 +0100 Jan Kara <[EMAIL PROTECTED]> wrote: > On Wed 02-01-08 12:42:19, Zach Brown wrote: > > Erez Zadok wrote: > > > Setting: ltp-full-20071031, dio01 test on ext3 with Linus's > > > latest tree. Kernel w/ SMP, preemption, and lockdep configured. > > > > This is a real

Re: [PATCH][RFC] fast file mapping for loop

2008-01-14 Thread Jens Axboe
On Mon, Jan 14 2008, Chris Mason wrote: > Hello everyone, > > Here is a modified version of Jens' patch. The basic idea is to push > the mapping maintenance out of loop and down into the filesystem (ext2 > in this case). > > Two new address_space operations are added, one to map > extents and th

Re: [patch] rewrite rd

2008-01-14 Thread Jens Axboe
On Mon, Jan 14 2008, Matthew Wilcox wrote: > On Tue, Dec 04, 2007 at 05:26:28AM +0100, Nick Piggin wrote: > > +static void copy_to_brd(struct brd_device *brd, const void *src, > > + sector_t sector, size_t n) > > +{ > > + struct page *page; > > + void *dst; > > + unsigned in

Re: [PATCH][RFC] fast file mapping for loop

2008-01-14 Thread Chris Mason
Hello everyone, Here is a modified version of Jens' patch. The basic idea is to push the mapping maintenance out of loop and down into the filesystem (ext2 in this case). Two new address_space operations are added, one to map extents and the other to provide call backs into the FS as io is compl

Re: lockdep warning with LTP dio test (v2.6.24-rc6-125-g5356f66)

2008-01-14 Thread Jan Kara
On Wed 02-01-08 12:42:19, Zach Brown wrote: > Erez Zadok wrote: > > Setting: ltp-full-20071031, dio01 test on ext3 with Linus's latest tree. > > Kernel w/ SMP, preemption, and lockdep configured. > > This is a real lock ordering problem. Thanks for reporting it. > > The updating of atime inside

Re: [patch] rewrite rd

2008-01-14 Thread Matthew Wilcox
On Tue, Dec 04, 2007 at 05:26:28AM +0100, Nick Piggin wrote: > +static void copy_to_brd(struct brd_device *brd, const void *src, > + sector_t sector, size_t n) > +{ > + struct page *page; > + void *dst; > + unsigned int offset = (sector & (PAGE_SECTORS-1)) << SECTOR_

Re: [linux-cifs-client] review 4, was Re: projected date for mount.cifs to support DFS junction points

2008-01-14 Thread Q (Igor Mammedov)
Christoph Hellwig wrote: > [David, any chance you could look at the suggestion below to refactor > the automount from ->follow_link code into a common helper now that > we've grown a second copy from it] > > > +cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) > +{ > +