20 Jan, 2011
7 commits
-
We sometimes need to map between the virtio device and
the given pci device. One such use is OS installer that
gets the boot pci device from BIOS and needs to
find the relevant block device. Since it can't,
installation fails.Instead of creating a top-level devices/virtio-pci
directory, create each device under the corresponding
pci device node. Symlinks to all virtio-pci
devices can be found under the pci driver link in
bus/pci/drivers/virtio-pci/devices, and all virtio
devices under drivers/bus/virtio/devices.Signed-off-by: Milton Miller
Signed-off-by: Rusty Russell
Acked-by: Michael S. Tsirkin
Tested-by: Michael S. Tsirkin
Acked-by: Gleb Natapov
Tested-by: "Daniel P. Berrange"
Cc: stable@kernel.org -
Honor the kconfig menu hierarchy to remove kconfig dependency warnings:
VIRTIO and VIRTIO_RING are subordinate to VIRTUALIZATION.warning: (LGUEST_GUEST) selects VIRTIO which has unmet direct dependencies (VIRTUALIZATION)
warning: (LGUEST_GUEST && VIRTIO_PCI && VIRTIO_BALLOON) selects VIRTIO_RING which has unmet direct dependencies (VIRTUALIZATION && VIRTIO)Reported-by: Toralf F_rster
Signed-off-by: Randy Dunlap
Signed-off-by: Rusty Russell -
arch/x86/lguest/boot.c: In function ‘lguest_init_IRQ’:
arch/x86/lguest/boot.c:824: error: macro "__this_cpu_write" requires 2 arguments, but only 1 given
arch/x86/lguest/boot.c:824: error: ‘__this_cpu_write’ undeclared (first use in this function)
arch/x86/lguest/boot.c:824: error: (Each undeclared identifier is reported only once
arch/x86/lguest/boot.c:824: error: for each function it appears in.)drivers/lguest/x86/core.c: In function ‘copy_in_guest_info’:
drivers/lguest/x86/core.c:94: error: lvalue required as left operand of assignmentSigned-off-by: Rusty Russell
-
Use this_cpu_ops in a couple of places in lguest.
Signed-off-by: Christoph Lameter
Signed-off-by: Rusty Russell -
Rusty Russell wrote:
> Ah, it will appear as /dev/hwrng. It's a weirdness of Linux that our actual
> hardware number generators are not wired up to /dev/random...Reflected this in the documentation, thanks :-)
Signed-off-by: Rusty Russell
-
PROT_EXEC seems to be completely unnecessary (as the lguest binary
never executes there), and will allow it to work with SELinux (and
more importantly, PaX :-) as they can/do forbid writable and
executable mappings.Also, map PROT_NONE guard pages at start and end of guest memory for extra
paranoia.I changed the length check to addr + size > guest_limit because >= is wrong
(addr of 0, size of getpagesize() with a guest_limit of getpagesize() would
false positive).Signed-off-by: Rusty Russell
-
I've attached a patch which implements dropping to privileges
and chrooting to a directory.Signed-off-by: Rusty Russell
17 Jan, 2011
16 commits
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/scsi-post-merge-2.6:
ocfs2: Make OCFS2_FS depend on CONFIGFS_FS
dlm: Make DLM depend on CONFIGFS_FS
net: Make NETCONSOLE_DYNAMIC depend on CONFIGFS_FS
configfs: change depends -> select SYSFS
[SCSI] sd,sr: kill compat SDEV_MEDIA_CHANGE event
[SCSI] sd: implement sd_check_events() -
On PARISC, we have an include of linux/mm.h inside our asm/pgtable.h, so
this patchcommit 14fd403f2146f740942d78af4e0ee59396ad8eab
Author: Andrea Arcangeli
Date: Thu Jan 13 15:46:37 2011 -0800thp: export maybe_mkwrite
causes us an unsatisfiable use of pte_mkwrite in linux/mm.h.
The fix is to avoid including linux/mm.h in our pgtable.h, which
unbreaks the build.Signed-off-by: Linus Torvalds
-
pmdp_get_and_clear/pmdp_clear_flush/pmdp_splitting_flush were trapped as
BUG() and they were defined only to diminish the risk of build issues on
not-x86 archs and to be consistent with the generic pte methods previously
defined in include/asm-generic/pgtable.h.But they are causing more trouble than they were supposed to solve, so
it's simpler not to define them when THP is off.This is also correcting the export of pmdp_splitting_flush which is
currently unused (x86 isn't using the generic implementation in
mm/pgtable-generic.c and no other arch needs that [yet]).Signed-off-by: Andrea Arcangeli
Sam Ravnborg
Cc: Stephen Rothwell
Cc: "David S. Miller"
Cc: Benjamin Herrenschmidt
Cc: "Luck, Tony"
Cc: James Bottomley
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
mnt_longterm is there only on SMP
Reported-and-tested-by: Joachim Eastwood
Signed-off-by: Al Viro
Signed-off-by: Linus Torvalds -
This patch fixes the following kconfig error after changing
CONFIGFS_FS -> select SYSFS:fs/sysfs/Kconfig:1:error: recursive dependency detected!
fs/sysfs/Kconfig:1: symbol SYSFS is selected by CONFIGFS_FS
fs/configfs/Kconfig:1: symbol CONFIGFS_FS is selected by OCFS2_FS
fs/ocfs2/Kconfig:1: symbol OCFS2_FS depends on SYSFSSigned-off-by: Nicholas A. Bellinger
Cc: Joel Becker
Cc: Randy Dunlap
Cc: Stephen Rothwell
Cc: James Bottomley -
This patch fixes the following kconfig error after changing
CONFIGFS_FS -> select SYSFS:fs/sysfs/Kconfig:1:error: recursive dependency detected!
fs/sysfs/Kconfig:1: symbol SYSFS is selected by CONFIGFS_FS
fs/configfs/Kconfig:1: symbol CONFIGFS_FS is selected by DLM
fs/dlm/Kconfig:1: symbol DLM depends on SYSFSSigned-off-by: Nicholas A. Bellinger
Cc: Joel Becker
Cc: Randy Dunlap
Cc: Stephen Rothwell
Cc: James Bottomley -
This patch fixes the following kconfig error after changing
CONFIGFS_FS -> select SYSFS:fs/sysfs/Kconfig:1:error: recursive dependency detected!
fs/sysfs/Kconfig:1: symbol SYSFS is selected by CONFIGFS_FS
fs/configfs/Kconfig:1: symbol CONFIGFS_FS is selected by NETCONSOLE_DYNAMIC
drivers/net/Kconfig:3390: symbol NETCONSOLE_DYNAMIC depends on SYSFSSigned-off-by: Nicholas A. Bellinger
Cc: Joel Becker
Cc: Randy Dunlap
Cc: Stephen Rothwell
Cc: James Bottomley -
This patch changes configfs to select SYSFS to fix the following:
warning: (TARGET_CORE && GFS2_FS) selects CONFIGFS_FS which has unmet direct dependencies (SYSFS)
Reported-by: Randy Dunlap
Signed-off-by: Nicholas A. Bellinger
Acked-by: Joel Becker -
Fix the build failure in some configurations:
CC [M] fs/btrfs/ctree.o
In file included from fs/btrfs/ctree.c:21:0:
fs/btrfs/ctree.h:1003:17: error: field 'super_kobj' has incomplete type
fs/btrfs/ctree.h:1074:17: error: field 'root_kobj' has incomplete type
make[2]: *** [fs/btrfs/ctree.o] Error 1
make[1]: *** [fs/btrfs] Error 2
make: *** [fs] Error 2caused by commit 57cc7215b708 ("headers: kobject.h redux")
We need to include kobject.h here.
Reported-by: Jeff Garzik
Fix-suggested-by: Li Zefan
Signed-off-by: Stefan Schmidt
Signed-off-by: Linus Torvalds -
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
Squashfs: simplify CONFIG_SQUASHFS_LZO handling
Squashfs: move squashfs_i() definition from squashfs.h
Squashfs: get rid of default n in Kconfig
Squashfs: add missing check in zlib_wrapper
Squashfs: remove unnecessary variable in zlib_wrapper
Squashfs: Add XZ compression configuration option
Squashfs: add XZ compression support -
Commit 415e12b23792 ("PCI/ACPI: Request _OSC control once for each root
bridge (v3)") put the acpi_hest_init() call in acpi_pci_root_init() into
a wrong place, presumably because the author confused acpi_pci_disabled
with acpi_disabled. Bring the code ordering in acpi_pci_root_init()
back to sanity.Additionally, make sure that hest_disable is set when acpi_disabled is
set, which is going to prevent acpi_hest_parse(), that still may be
executed for acpi_disabled=1 through aer_acpi_firmware_first(), from
crashing because of uninitialized hest_tab.Reported-and-tested-by: Andres Salomon
Signed-off-by: Rafael J. Wysocki
Signed-off-by: Linus Torvalds -
After commit 415e12b23792 ("PCI/ACPI: Request _OSC control once for each
root bridge (v3)") include/linux/pci-acpi.h is included by
drivers/pci/pcie/aer/aerdrv.c and if CONFIG_ACPI is unset, the bogus and
unnecessary alternative definition of acpi_find_root_bridge_handle()
causes a build error to occur.Remove the offending piece of garbage.
Reported-and-tested-by: Stephen Rothwell
Signed-off-by: Rafael J. Wysocki
Signed-off-by: Linus Torvalds -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (23 commits)
sanitize vfsmount refcounting changes
fix old umount_tree() breakage
autofs4: Merge the remaining dentry ops tables
Unexport do_add_mount() and add in follow_automount(), not ->d_automount()
Allow d_manage() to be used in RCU-walk mode
Remove a further kludge from __do_follow_link()
autofs4: Bump version
autofs4: Add v4 pseudo direct mount support
autofs4: Fix wait validation
autofs4: Clean up autofs4_free_ino()
autofs4: Clean up dentry operations
autofs4: Clean up inode operations
autofs4: Remove unused code
autofs4: Add d_manage() dentry operation
autofs4: Add d_automount() dentry operation
Remove the automount through follow_link() kludge code from pathwalk
CIFS: Use d_automount() rather than abusing follow_link()
NFS: Use d_automount() rather than abusing follow_link()
AFS: Use d_automount() rather than abusing follow_link()
Add an AT_NO_AUTOMOUNT flag to suppress terminal automount
... -
Instead of splitting refcount between (per-cpu) mnt_count
and (SMP-only) mnt_longrefs, make all references contribute
to mnt_count again and keep track of how many are longterm
ones.Accounting rules for longterm count:
* 1 for each fs_struct.root.mnt
* 1 for each fs_struct.pwd.mnt
* 1 for having non-NULL ->mnt_ns
* decrement to 0 happens only under vfsmount lock exclusiveThat allows nice common case for mntput() - since we can't drop the
final reference until after mnt_longterm has reached 0 due to the rules
above, mntput() can grab vfsmount lock shared and check mnt_longterm.
If it turns out to be non-zero (which is the common case), we know
that this is not the final mntput() and can just blindly decrement
percpu mnt_count. Otherwise we grab vfsmount lock exclusive and
do usual decrement-and-check of percpu mnt_count.For fs_struct.c we have mnt_make_longterm() and mnt_make_shortterm();
namespace.c uses the latter in places where we don't already hold
vfsmount lock exclusive and opencodes a few remaining spots where
we need to manipulate mnt_longterm.Note that we mostly revert the code outside of fs/namespace.c back
to what we used to have; in particular, normal code doesn't need
to care about two kinds of references, etc. And we get to keep
the optimization Nick's variant had bought us...Signed-off-by: Al Viro
-
Expiry-related code calls umount_tree() several times with
the same list to collect vfsmounts to. Which is fine, except
that umount_tree() implicitly assumed that the list would
be empty on each call - it moves the victims over there and
then iterates through the list kicking them out. It's *almost*
idempotent, so everything nearly worked. However, mnt->ghosts
handling (and thus expirability checks) had been broken - that
part was not idempotent...The fix is trivial - use local temporary list, splice it to
the the collector list when we are through.Signed-off-by: Al Viro
16 Jan, 2011
17 commits
-
Merge the remaining autofs4 dentry ops tables. It doesn't matter if
d_automount and d_manage are present on something that's not mountable or
holdable as these ops are only used if the appropriate flags are set in
dentry->d_flags.[AV] switch to ->s_d_op, since now _everything_ on autofs4 is using the
same dentry_operations.Signed-off-by: David Howells
Signed-off-by: Al Viro -
Unexport do_add_mount() and make ->d_automount() return the vfsmount to be
added rather than calling do_add_mount() itself. follow_automount() will then
do the addition.This slightly complicates things as ->d_automount() normally wants to add the
new vfsmount to an expiration list and start an expiration timer. The problem
with that is that the vfsmount will be deleted if it has a refcount of 1 and
the timer will not repeat if the expiration list is empty.To this end, we require the vfsmount to be returned from d_automount() with a
refcount of (at least) 2. One of these refs will be dropped unconditionally.
In addition, follow_automount() must get a 3rd ref around the call to
do_add_mount() lest it eat a ref and return an error, leaving the mount we
have open to being expired as we would otherwise have only 1 ref on it.d_automount() should also add the the vfsmount to the expiration list (by
calling mnt_set_expiry()) and start the expiration timer before returning, if
this mechanism is to be used. The vfsmount will be unlinked from the
expiration list by follow_automount() if do_add_mount() fails.This patch also fixes the call to do_add_mount() for AFS to propagate the mount
flags from the parent vfsmount.Signed-off-by: David Howells
Signed-off-by: Al Viro -
Allow d_manage() to be called from pathwalk when it is in RCU-walk mode as well
as when it is in Ref-walk mode. This permits __follow_mount_rcu() to call
d_manage() directly. d_manage() needs a parameter to indicate that it is in
RCU-walk mode as it isn't allowed to sleep if in that mode (but should return
-ECHILD instead).autofs4_d_manage() can then be set to retain RCU-walk mode if the daemon
accesses it and otherwise request dropping back to ref-walk mode.Signed-off-by: David Howells
Signed-off-by: Al Viro -
Remove a further kludge from __do_follow_link() as it's no longer required with
the automount code.This reverts the non-helper-function parts of
051d381259eb57d6074d02a6ba6e90e744f1a29f, which breaks union mounts.Reported-by: vaurora@redhat.com
Signed-off-by: David Howells
Signed-off-by: Al Viro -
Increase the autofs module sub-version so we can tell what kernel
implementation is being used from user space debug logging.Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
Version 4 of autofs provides a pseudo direct mount implementation
that relies on directories at the leaves of a directory tree under
an indirect mount to trigger mounts.This patch adds support for that functionality.
Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
It is possible for the check in wait.c:validate_request() to return
an incorrect result if the dentry that was mounted upon has changed
during the callback.Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
When this function is called the local reference count does't need to
be updated since the dentry is going away and dput definitely must
not be called here.Also the autofs info struct field inode isn't used so remove it.
Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
There are now two distinct dentry operations uses. One for dentrys
that trigger mounts and one for dentrys that do not.Rationalize the use of these dentry operations and rename them to
reflect their function.Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
Since the use of ->follow_link() has been eliminated there is no
need to separate the indirect and direct inode operations.Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
Remove code that is not used due to the use of ->d_automount()
and ->d_manage().Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
This patch required a previous patch to add the ->d_automount()
dentry operation.Add a function to use the newly defined ->d_manage() dentry operation
for blocking during mount and expire.Whether the VFS calls the dentry operations d_automount() and d_manage()
is controled by the DMANAGED_AUTOMOUNT and DMANAGED_TRANSIT flags. autofs
uses the d_automount() operation to callback to user space to request
mount operations and the d_manage() operation to block walks into mounts
that are under construction or destruction.In order to prevent these functions from being called unnecessarily the
DMANAGED_* flags are cleared for cases which would cause this. In the
common case the DMANAGED_AUTOMOUNT and DMANAGED_TRANSIT flags are both
set for dentrys waiting to be mounted. The DMANAGED_TRANSIT flag is
cleared upon successful mount request completion and set during expire
runs, both during the dentry expire check, and if selected for expire,
is left set until a subsequent successful mount request completes.The exception to this is the so-called rootless multi-mount which has
no actual mount at its base. In this case the DMANAGED_AUTOMOUNT flag
is cleared upon successful mount request completion as well and set
again after a successful expire.Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
Add a function to use the newly defined ->d_automount() dentry operation
for triggering mounts instead of doing the user space callback in ->lookup()
and ->d_revalidate().Note, to be useful the subsequent patch to add the ->d_manage() dentry
operation is also needed so the discussion of functionality is deferred to
that patch.Signed-off-by: Ian Kent
Signed-off-by: David Howells
Signed-off-by: Al Viro -
Remove the automount through follow_link() kludge code from pathwalk in favour
of using d_automount().Signed-off-by: David Howells
Acked-by: Ian Kent
Signed-off-by: Al Viro -
Make CIFS use the new d_automount() dentry operation rather than abusing
follow_link() on directories.[NOTE: THIS IS UNTESTED!]
Signed-off-by: David Howells
Cc: Steve French
Signed-off-by: Al Viro -
Make NFS use the new d_automount() dentry operation rather than abusing
follow_link() on directories.Signed-off-by: David Howells
Acked-by: Trond Myklebust
Acked-by: Ian Kent
Signed-off-by: Al Viro -
Make AFS use the new d_automount() dentry operation rather than abusing
follow_link() on directories.Signed-off-by: David Howells
Signed-off-by: Al Viro