09 May, 2009
2 commits
-
Put generic_show_options read access to s_options under rcu_read_lock,
split save_mount_options() into "we are setting it the first time"
(uses in foo_fill_super()) and "we are relacing and freeing the old one",
synchronize_rcu() before kfree() in the latter.Signed-off-by: Al Viro
-
Push BKL down into ->umount_begin()
Signed-off-by: Alessio Igor Bogani
Signed-off-by: Al Viro
21 Apr, 2009
1 commit
-
We shouldn't just touch the namespace of current process
Caught-by: Trond Myklebust
Signed-off-by: Al Viro
20 Apr, 2009
1 commit
-
Since commit 0a1c01c9477602ee8b44548a9405b2c1d587b5a2 ("Make relatime
default") when a file system is mounted explicitely with noatime it gets
both the MNT_RELATIME and MNT_NOATIME bits set.This shows up like this in /proc/mounts:
/dev/xxx /yyy ext3 rw,noatime,relatime,errors=continue,data=writeback 0 0
That looks strange. The VFS uses noatime in this case, but both flags
are set. So it's more a cosmetic issue, but still better to fix.Cc: mjg@redhat.com
Signed-off-by: Andi Kleen
Signed-off-by: Linus Torvalds
01 Apr, 2009
3 commits
-
Don't pull it in sched.h; very few files actually need it and those
can include directly. sched.h itself only needs forward declaration
of struct fs_struct;Signed-off-by: Al Viro
-
Pure code move; two new helper functions for nfsd and daemonize
(unshare_fs_struct() and daemonize_fs_struct() resp.; for now -
the same code as used to be in callers). unshare_fs_struct()
exported (for nfsd, as copy_fs_struct()/exit_fs() used to be),
copy_fs_struct() and exit_fs() don't need exports anymore.Signed-off-by: Al Viro
-
Not because execve races with _that_ are serious - we really
need a situation when final drop of fs_struct refcount is
done by something that used to have it as current->fs.Signed-off-by: Al Viro
28 Mar, 2009
2 commits
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (37 commits)
fs: avoid I_NEW inodes
Merge code for single and multiple-instance mounts
Remove get_init_pts_sb()
Move common mknod_ptmx() calls into caller
Parse mount options just once and copy them to super block
Unroll essentials of do_remount_sb() into devpts
vfs: simple_set_mnt() should return void
fs: move bdev code out of buffer.c
constify dentry_operations: rest
constify dentry_operations: configfs
constify dentry_operations: sysfs
constify dentry_operations: JFS
constify dentry_operations: OCFS2
constify dentry_operations: GFS2
constify dentry_operations: FAT
constify dentry_operations: FUSE
constify dentry_operations: procfs
constify dentry_operations: ecryptfs
constify dentry_operations: CIFS
constify dentry_operations: AFS
... -
simple_set_mnt() is defined as returning 'int' but always returns 0.
Callers assume simple_set_mnt() never fails and don't properly cleanup if
it were to _ever_ fail. For instance, get_sb_single() and get_sb_nodev()
should:up_write(sb->s_unmount);
deactivate_super(sb);if simple_set_mnt() fails.
Since simple_set_mnt() never fails, would be cleaner if it did not
return anything.[akpm@linux-foundation.org: fix build]
Signed-off-by: Sukadev Bhattiprolu
Acked-by: Serge Hallyn
Cc: Al Viro
Cc: Christoph Hellwig
Signed-off-by: Andrew Morton
Signed-off-by: Al Viro
27 Mar, 2009
2 commits
-
Change the default behaviour of the kernel to use relatime for all
filesystems. This can be overridden with the "strictatime" mount
option.Signed-off-by: Matthew Garrett
Signed-off-by: Linus Torvalds -
Add support for explicitly requesting full atime updates. This makes it
possible for kernels to default to relatime but still allow userspace to
override it.Signed-off-by: Matthew Garrett
Signed-off-by: Linus Torvalds
18 Feb, 2009
1 commit
-
Getting this wrong caused
WARNING: at fs/namespace.c:636 mntput_no_expire+0xac/0xf2()
due to optimistically checking cpu_writer->mnt outside the spinlock.
Here's what we really want:
* we know that nobody will set cpu_writer->mnt to mnt from now on
* all changes to that sucker are done under cpu_writer->lock
* we want the laziest equivalent of
spin_lock(&cpu_writer->lock);
if (likely(cpu_writer->mnt != mnt)) {
spin_unlock(&cpu_writer->lock);
continue;
}
/* do stuff */
that would make sure we won't miss earlier setting of ->mnt done by
another CPU.Anyway, for now we just move the spin_lock() earlier and move the test
into the properly locked region.Signed-off-by: Al Viro
Reported-and-tested-by: Li Zefan
Signed-off-by: Linus Torvalds
14 Jan, 2009
2 commits
-
Signed-off-by: Heiko Carstens
-
Signed-off-by: Heiko Carstens
01 Jan, 2009
1 commit
-
The extra semicolon serves no purpose.
Signed-off-by: Julia Lawall
Reviewed-by: Richard Genoud
Cc: Al Viro
Cc: Christoph Hellwig
Signed-off-by: Andrew Morton
Signed-off-by: Al Viro
14 Nov, 2008
2 commits
-
Conflicts:
security/keys/internal.h
security/keys/process_keys.c
security/keys/request_key.cFixed conflicts above by using the non 'tsk' versions.
Signed-off-by: James Morris
-
Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().
Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.Signed-off-by: David Howells
Reviewed-by: James Morris
Acked-by: Serge Hallyn
Cc: Al Viro
Signed-off-by: James Morris
13 Nov, 2008
1 commit
-
In the last refactoring of shrink_submounts a variable was not completely
renamed. So finish the renaming of mnt to m now.Without this if you attempt to mount an nfs mount that has both automatic
nfs sub mounts on it, and has normal mounts on it. The unmount will
succeed when it should not.Signed-off-by: Eric W. Biederman
Cc: Alexey Dobriyan
Cc: Al Viro
Signed-off-by: Linus Torvalds
23 Oct, 2008
3 commits
-
Daemons that need to be launched while the rootfs is read-only can now
poll /proc/mounts to be notified when their O_RDWR requests may no
longer end in EROFS.Cc: Kay Sievers
Cc: Neil Brown
Signed-off-by: Dan Williams -
Stack footprint from hell had been due to many struct nameidata in there.
No more.Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
01 Aug, 2008
1 commit
-
Signed-off-by: Al Viro
27 Jul, 2008
4 commits
-
* do not pass nameidata; struct path is all the callers want.
* switch to new helpers:
user_path_at(dfd, pathname, flags, &path)
user_path(pathname, &path)
user_lpath(pathname, &path)
user_path_dir(pathname, &path) (fail if not a directory)
The last 3 are trivial macro wrappers for the first one.
* remove nameidata in callers.Signed-off-by: Al Viro
-
- use kstrdup() instead of kmalloc() + memcpy()
- return NULL if allocating ->mnt_devname failed
- mnt_devname should be constSigned-off-by: Li Zefan
Acked-by: Cyrill Gorcunov
Signed-off-by: Al Viro -
long overdue...
Signed-off-by: Al Viro
-
Use WARN() instead of a printk+WARN_ON() pair; this way the message
becomes part of the warning section for better reporting/collection.Signed-off-by: Arjan van de Ven
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Jul, 2008
1 commit
-
This patch causes SELinux mount options to show up in /proc/mounts. As
with other code in the area seq_put errors are ignored. Other LSM's
will not have their mount options displayed until they fill in their own
security_sb_show_options() function.Signed-off-by: Eric Paris
Signed-off-by: Miklos Szeredi
Signed-off-by: James Morris
30 Apr, 2008
1 commit
-
__FUNCTION__ is gcc-specific, use __func__
Signed-off-by: Harvey Harrison
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 Apr, 2008
1 commit
-
Remove lives_below_in_same_fs() since is_subdir() from fs/dcache.c is
providing the same functionality.Signed-off-by: Jan Blunck
Acked-by: Miklos Szeredi
Cc: Al Viro
Cc: Christoph Hellwig
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
28 Apr, 2008
1 commit
-
We don't need to turn quotas off before remounting root ro, because
do_remount_sb() already handles this.Signed-off-by: Jan Kara
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 Apr, 2008
1 commit
-
Signed-off-by: Al Viro
23 Apr, 2008
5 commits
-
Show peer group ID of nearest dominating group that has intersection
with the mount's namespace.Signed-off-by: Miklos Szeredi
Signed-off-by: Al Viro -
[mszeredi@suse.cz] rewrite and split big patch into managable chunks
/proc/mounts in its current form lacks important information:
- propagation state
- root of mount for bind mounts
- the st_dev value used within the filesystem
- identifier for each mount and it's parentIt also suffers from the following problems:
- not easily extendable
- ambiguity of mountpoints within a chrooted environment
- doesn't distinguish between filesystem dependent and independent options
- doesn't distinguish between per mount and per super block optionsThis patch introduces /proc//mountinfo which attempts to address
all these deficiencies.Code shared between /proc//mounts and /proc//mountinfo is
extracted into separate functions.Thanks to Al Viro for the help in getting the design right.
Signed-off-by: Ram Pai
Signed-off-by: Miklos Szeredi
Signed-off-by: Al Viro -
Allow /proc//mountinfo to use the root of to calculate
mountpoints.- move definition of 'struct proc_mounts' to
- add the process's namespace and root to this structure
- pass a pointer to 'struct proc_mounts' into seq_operationsIn addition the following cleanups are made:
- use a common open function for /proc//{mounts,mountstat}
- surround namespace.c part of these proc files with #ifdef CONFIG_PROC_FS
- make the seq_operations structures constSigned-off-by: Miklos Szeredi
Signed-off-by: Al Viro -
Add a unique ID to each peer group using the IDR infrastructure. The
identifiers are reused after the peer group dissolves.The IDR structures are protected by holding namepspace_sem for write
while allocating or deallocating IDs.IDs are allocated when a previously unshared vfsmount becomes the
first member of a peer group. When a new member is added to an
existing group, the ID is copied from one of the old members.IDs are freed when the last member of a peer group is unshared.
Setting the MNT_SHARED flag on members of a subtree is done as a
separate step, after all the IDs have been allocated. This way an
allocation failure can be cleaned up easilty, without affecting the
propagation state.Based on design sketch by Al Viro.
Signed-off-by: Miklos Szeredi
Signed-off-by: Al Viro -
Add a unique ID to each vfsmount using the IDR infrastructure. The
identifiers are reused after the vfsmount is freed.Signed-off-by: Miklos Szeredi
Signed-off-by: Al Viro
22 Apr, 2008
3 commits
-
Further reduction of stack footprint (sys_pivot_root());
lose useless BKL in there, while we are at it.Signed-off-by: Al Viro
-
Namely, ones from namespace.c
Signed-off-by: Al Viro
-
Taking namespace_sem shared there isn't worth the trouble, especially with
vfsmount ID allocation about to be added. That way we know that umount_tree(),
copy_tree() and clone_mnt() are _always_ serialized by namespace_sem.
umount_tree() still needs vfsmount_lock (it manipulates hash chains, among
other things), but that's a separate story.Signed-off-by: Al Viro
19 Apr, 2008
1 commit
-
Originally from: Herbert Poetzl
This is the core of the read-only bind mount patch set.
Note that this does _not_ add a "ro" option directly to the bind mount
operation. If you require such a mount, you must first do the bind, then
follow it up with a 'mount -o remount,ro' operation:If you wish to have a r/o bind mount of /foo on bar:
mount --bind /foo /bar
mount -o remount,ro /barAcked-by: Al Viro
Signed-off-by: Christoph Hellwig
Signed-off-by: Dave Hansen
Signed-off-by: Andrew Morton
Signed-off-by: Al Viro