summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)Author
2009-03-20Merge branch 'quilt/driver-core'Stephen Rothwell
Conflicts: drivers/media/video/v4l2-device.c drivers/net/wimax/i2400m/usb-notif.c drivers/sh/maple/maple.c
2009-03-20Merge commit 'trivial/for-next'Stephen Rothwell
2009-03-20Merge commit 'osd/linux-next'Stephen Rothwell
2009-03-20Merge commit 'proc/proc'Stephen Rothwell
Conflicts: security/selinux/hooks.c
2009-03-20Merge branch 'quilt/ttydev'Stephen Rothwell
2009-03-20Merge commit 'security-testing/next'Stephen Rothwell
2009-03-20Merge commit 'md/for-next'Stephen Rothwell
2009-03-20Merge commit 'block/for-next'Stephen Rothwell
Conflicts: fs/bio-integrity.c fs/bio.c include/linux/bio.h
2009-03-20Merge commit 'ubifs/linux-next'Stephen Rothwell
2009-03-20Merge commit 'bkl-removal/bkl-removal'Stephen Rothwell
2009-03-20Merge commit 'gfs2/master'Stephen Rothwell
2009-03-20Merge commit 'cifs/master'Stephen Rothwell
2009-03-20Merge branch 'quilt/rr'Stephen Rothwell
Conflicts: arch/powerpc/kernel/irq.c arch/x86/include/asm/topology.h arch/x86/kernel/cpu/cpufreq/powernow-k8.c arch/x86/kernel/cpu/cpufreq/speedstep-ich.c arch/x86/kernel/cpu/cpufreq/speedstep-lib.c arch/x86/lguest/boot.c arch/x86/mach-default/setup.c arch/x86/mach-voyager/setup.c drivers/firmware/dcdbas.c drivers/hid/hid-core.c drivers/media/video/saa7134/saa7134-core.c drivers/media/video/saa7134/saa7134.h drivers/net/virtio_net.c kernel/module.c
2009-03-20Merge commit 'net/master'Stephen Rothwell
Conflicts: drivers/net/virtio_net.c
2009-03-20Merge commit 'udf/for_next'Stephen Rothwell
2009-03-20Merge commit 'ext4/next'Stephen Rothwell
Conflicts: fs/ext4/inode.c
2009-03-20Merge commit 'ocfs2/linux-next'Stephen Rothwell
2009-03-20Merge commit 'dlm/next'Stephen Rothwell
2009-03-20Merge commit 'nfsd/nfsd-next'Stephen Rothwell
2009-03-20Merge commit 'xfs/master'Stephen Rothwell
2009-03-20Merge commit 'nfs/linux-next'Stephen Rothwell
2009-03-20Merge commit 'jfs/next'Stephen Rothwell
2009-03-20Merge commit 'quota/for_next'Stephen Rothwell
2009-03-20Merge commit 'tracing/auto-tracing-next'Stephen Rothwell
2009-03-20Merge commit 's390/features'Stephen Rothwell
2009-03-20sysfs: only allow one scheduled removal callback per kobjAlex Chiang
The only way for a sysfs attribute to remove itself (without deadlock) is to use the sysfs_schedule_callback() interface. Vegard Nossum discovered that a poorly written sysfs ->store callback can repeatedly schedule remove callbacks on the same device over and over, e.g. $ while true ; do echo 1 > /sys/devices/.../remove ; done If the 'remove' attribute uses the sysfs_schedule_callback API and also does not protect itself from concurrent accesses, its callback handler will be called multiple times, and will eventually attempt to perform operations on a freed kobject, leading to many problems. Instead of requiring all callers of sysfs_schedule_callback to implement their own synchronization, provide the protection in the infrastructure. Now, sysfs_schedule_callback will only allow one scheduled callback per kobject. On subsequent calls with the same kobject, return -EAGAIN. This is a short term fix. The long term fix is to allow sysfs attributes to remove themselves directly, without any of this callback hokey pokey. [cornelia.huck@de.ibm.com: s390 ccwgroup bits] Reported-by: vegard.nossum@gmail.com Signed-off-by: Alex Chiang <achiang@hp.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-20Driver core: implement uevent suppress in kobjectMing Lei
This patch implements uevent suppress in kobject and removes it from struct device, based on the following ideas: 1,Uevent sending should be one attribute of kobject, so suppressing it in kobject layer is more natural than in device layer. By this way, we can do it for other objects embedded with kobject. 2,It may save several bytes for each instance of struct device.(On my omap3(32bit ARM) based box, can save 8bytes per device object) This patch also introduces dev_set|get_uevent_suppress() helpers to set and query uevent_suppress attribute in case to help kobject as private part of struct device in future. [This version is against the latest driver-core patch set of Greg,please ignore the last version.] Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-20sysfs: don't block indefinitely for unmapped files.Eric W. Biederman
Modify sysfs bin files so that we can remove the bin file while they are still mapped. When the kobject is removed we unmap the bin file and arrange for future accesses to the mapping to receive SIGBUS. Implementing this prevents a nasty DOS when pci devices are hot plugged and unplugged. Where if any of their resources were mmaped the kernel could not free up their pci resources or release their pci data structures. [akpm@linux-foundation.org: remove unused var] Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Acked-by: Tejun Heo <tj@kernel.org> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-20sysfs: reference sysfs_dirent from sysfs inodesEric W. Biederman
The sysfs_dirent serves as both an inode and a directory entry for sysfs. To prevent the sysfs inode numbers from being freed prematurely hold a reference to sysfs_dirent from the sysfs inode. [akpm@linux-foundation.org: add comment] Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Cc: Tejun Heo <tj@kernel.org> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-20sysfs: sysfs_add_one WARNs with full path to duplicate filenameAlex Chiang
sysfs: sysfs_add_one WARNs with full path to duplicate filename As a debugging aid, it can be useful to know the full path to a duplicate file being created in sysfs. We now will display warnings such as: sysfs: cannot create duplicate filename '/foo' when attempting to create multiple files named 'foo' in the sysfs root, or: sysfs: cannot create duplicate filename '/bus/pci/slots/5/foo' when attempting to create multiple files named 'foo' under a given directory in sysfs. The path displayed is always a relative path to sysfs_root. The leading '/' in the path name refers to the sysfs_root mount point, and should not be confused with the "real" '/'. Thanks to Alex Williamson for essentially writing sysfs_pathname. Cc: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-20sysfs: Take sysfs_mutex when fetching the root inode.Eric W. Biederman
sysfs_get_inode ultimately calls sysfs_count_nlink when the a directory inode is fectched. sysfs_count_nlink needs to be called under the sysfs_mutex to guard against the unlikely but possible scenario that the root directory is changing as we are counting the number entries in it, and just in general to be consistent. Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-20SYSFS: use standard magic.h for sysfsQinghuang Feng
SYSFS_MAGIC has been added into magic.h, so only use that definition in magic.h to avoid potential consistency problem. Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-20cpumask:fix-seq_cpumask_listRusty Russell
1) seq_bitmap_list() should take a const. 2) All the seq_bitmap should use cpumask_bits(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-03-19Merge branch 'vfs-changes' into nextTrond Myklebust
Conflicts: fs/nfs/super.c
2009-03-19Merge branch 'devel' into nextTrond Myklebust
Conflicts: fs/nfs/inode.c include/linux/nfs_fs.h
2009-03-19Merge branch 'cachefs' into nextTrond Myklebust
2009-03-19NFS: Fix up a mismerged patchTrond Myklebust
Move the definition of nfs_need_commit() into the #ifdef CONFIG_NFS_V3 section as originally intended in the patch "NFS: cleanup - remove struct nfs_inode->ncommit" Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2009-03-19fs: Add exofs to Kernel buildBoaz Harrosh
- Add exofs to fs/Kconfig under "menu 'Miscellaneous filesystems'" - Add exofs to fs/Makefile Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
2009-03-19exofs: DocumentationBoaz Harrosh
Added some documentation in exofs.txt, as well as a BUGS file. For further reading, operation instructions, example scripts and up to date infomation and code please see: http://open-osd.org Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
2009-03-19exofs: super_operations and file_system_typeBoaz Harrosh
This patch ties all operation vectors into a file system superblock and registers the exofs file_system_type at module's load time. * The file system control block (AKA on-disk superblock) resides in an object with a special ID (defined in common.h). Information included in the file system control block is used to fill the in-memory superblock structure at mount time. This object is created before the file system is used by mkexofs.c It contains information such as: - The file system's magic number - The next inode number to be allocated Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
2009-03-19exofs: dir_inode and directory operationsBoaz Harrosh
implementation of directory and inode operations. * A directory is treated as a file, and essentially contains a list of <file name, inode #> pairs for files that are found in that directory. The object IDs correspond to the files' inode numbers and are allocated using a 64bit incrementing global counter. * Each file's control block (AKA on-disk inode) is stored in its object's attributes. This applies to both regular files and other types (directories, device files, symlinks, etc.). Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
2009-03-19exofs: address_space_operationsBoaz Harrosh
OK Now we start to read and write from osd-objects. We try to collect at most contiguous pages as possible in a single write/read. The first page index is the object's offset. TODO: In 64-bit a single bio can carry at most 128 pages. Add support of chaining multiple bios Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
2009-03-19exofs: symlink_inode and fast_symlink_inode operationsBoaz Harrosh
Generic implementation of symlink ops. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
2009-03-19exofs: file and file_inode operationsBoaz Harrosh
implementation of the file_operations and inode_operations for regular data files. Most file_operations are generic vfs implementations except: - exofs_truncate will truncate the OSD object as well - Generic file_fsync is not good for none_bd devices so open code it - The default for .flush in Linux is todo nothing so call exofs_fsync on the file. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
2009-03-19exofs: Kbuild, Headers and osd utilsBoaz Harrosh
This patch includes osd infrastructure that will be used later by the file system. Also the declarations of constants, on disk structures, and prototypes. And the Kbuild+Kconfig files needed to build the exofs module. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
2009-03-18Inconsistent setattr behaviourSachin S. Prabhu
There is an inconsistency seen in the behaviour of nfs compared to other local filesystems on linux when changing owner or group of a directory. If the directory has SUID/SGID flags set, on changing owner or group on the directory, the flags are stripped off on nfs. These flags are maintained on other filesystems such as ext3. To reproduce on a nfs share or local filesystem, run the following commands mkdir test; chmod +s+g test; chown user1 test; ls -ld test On the nfs share, the flags are stripped and the output seen is drwxr-xr-x 2 user1 root 4096 Feb 23 2009 test On other local filesystems(ex: ext3), the flags are not stripped and the output seen is drwsr-sr-x 2 user1 root 4096 Feb 23 13:57 test chown_common() called from sys_chown() will only strip the flags if the inode is not a directory. static int chown_common(struct dentry * dentry, uid_t user, gid_t group) { .. if (!S_ISDIR(inode->i_mode)) newattrs.ia_valid |= ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV; .. } See: http://www.opengroup.org/onlinepubs/7990989775/xsh/chown.html "If the path argument refers to a regular file, the set-user-ID (S_ISUID) and set-group-ID (S_ISGID) bits of the file mode are cleared upon successful return from chown(), unless the call is made by a process with appropriate privileges, in which case it is implementation-dependent whether these bits are altered. If chown() is successfully invoked on a file that is not a regular file, these bits may be cleared. These bits are defined in <sys/stat.h>." The behaviour as it stands does not appear to violate POSIX. However the actions performed are inconsistent when comparing ext3 and nfs. Sachin Prabhu Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2009-03-18nfsd4: don't check ip address in setclientidJ. Bruce Fields
The spec allows clients to change ip address, so we shouldn't be requiring that setclientid always come from the same address. For example, a client could reboot and get a new dhcpd address, but still present the same clientid to the server. In that case the server should revoke the client's previous state and allow it to continue, instead of (as it currently does) returning a CLID_INUSE error. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2009-03-18knfsd: add file to export stats about nfsd poolsGreg Banks
Add /proc/fs/nfsd/pool_stats to export to userspace various statistics about the operation of rpc server thread pools. This patch is based on a forward-ported version of knfsd-add-pool-thread-stats which has been shipping in the SGI "Enhanced NFS" product since 2006 and which was previously posted: http://article.gmane.org/gmane.linux.nfs/10375 It has also been updated thus: * moved EXPORT_SYMBOL() to near the function it exports * made the new struct struct seq_operations const * used SEQ_START_TOKEN instead of ((void *)1) * merged fix from SGI PV 990526 "sunrpc: use dprintk instead of printk in svc_pool_stats_*()" by Harshula Jayasuriya. * merged fix from SGI PV 964001 "Crash reading pool_stats before nfsds are started". Signed-off-by: Greg Banks <gnb@sgi.com> Signed-off-by: Harshula Jayasuriya <harshula@sgi.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2009-03-18knfsd: remove the nfsd thread busy histogramGreg Banks
Stop gathering the data that feeds the 'th' line in /proc/net/rpc/nfsd because the questionable data provided is not worth the scalability impact of calculating it. Instead, always report zeroes. The current approach suffers from three major issues: 1. update_thread_usage() increments buckets by call service time or call arrival time...in jiffies. On lightly loaded machines, call service times are usually < 1 jiffy; on heavily loaded machines call arrival times will be << 1 jiffy. So a large portion of the updates to the buckets are rounded down to zero, and the histogram is undercounting. 2. As seen previously on the nfs mailing list, the format in which the histogram is presented is cryptic, difficult to explain, and difficult to use. 3. Updating the histogram requires taking a global spinlock and dirtying the global variables nfsd_last_call, nfsd_busy, and nfsdstats *twice* on every RPC call, which is a significant scaling limitation. Testing on a 4 CPU 4 NIC Altix using 4 IRIX clients each doing 1K streaming reads at full line rate, shows the stats update code (inlined into nfsd()) takes about 1.7% of each CPU. This patch drops the contribution from nfsd() into the profile noise. This patch is a forward-ported version of knfsd-remove-nfsd-threadstats which has been shipping in the SGI "Enhanced NFS" product since 2006. In that time, exactly one customer has noticed that the threadstats were missing. It has been previously posted: http://article.gmane.org/gmane.linux.nfs/10376 and more recently requested to be posted again. Signed-off-by: Greg Banks <gnb@sgi.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2009-03-18nfsd4: remove redundant check from nfsd4_openJ. Bruce Fields
Note that we already checked for this invalid case at the top of this function. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>