summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* [PATCH] usb: Patch for USBDEVFS_IOCTL from 32-bit programsPete Zaitcev2005-10-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dell supplied me with the following test: #include<stdio.h> #include<errno.h> #include<sys/ioctl.h> #include<fcntl.h> #include<linux/usbdevice_fs.h> main(int argc,char*argv[]) { struct usbdevfs_hub_portinfo hubPortInfo = {0}; struct usbdevfs_ioctl command = {0}; command.ifno = 0; command.ioctl_code = USBDEVFS_HUB_PORTINFO; command.data = (void*)&hubPortInfo; int fd, ret; if(argc != 2) { fprintf(stderr,"Usage: %s /proc/bus/usb/<BusNo>/<HubID>\n",argv[0]); fprintf(stderr,"Example: %s /proc/bus/usb/001/001\n",argv[0]); exit(1); } errno = 0; fd = open(argv[1],O_RDWR); if(fd < 0) { perror("open failed:"); exit(errno); } errno = 0; ret = ioctl(fd,USBDEVFS_IOCTL,&command); printf("IOCTL return status:%d\n",ret); if(ret<0) { perror("IOCTL failed:"); close(fd); exit(3); } else { printf("IOCTL passed:Num of ports %d\n",hubPortInfo.nports); close(fd); exit(0); } return 0; } I have verified that it breaks if built in 32 bit mode on x86_64 and that the patch below fixes it. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] Fix ext3 warning for unused varPeter Osterlund2005-10-281-10/+16
| | | | | | | Fix compile warning in ext3 quota code. Signed-off-by: Peter Osterlund <petero2@telia.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6Linus Torvalds2005-10-282-3/+28
|\
| * Merge ../bleed-2.6Greg KH2005-10-2841-686/+1379
| |\
| * | [PATCH] Driver Core: fix up all callers of class_device_create()Greg Kroah-Hartman2005-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The previous patch adding the ability to nest struct class_device changed the paramaters to the call class_device_create(). This patch fixes up all in-kernel users of the function. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | [PATCH] add sysfs attr to re-emit device hotplug eventKay Sievers2005-10-281-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A "coldplug + udevstart" can be simple like this: for i in /sys/block/*/*/uevent; do echo 1 > $i; done for i in /sys/class/*/*/uevent; do echo 1 > $i; done for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done Signed-off-by: Kay Sievers <kay.sievers@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | | Merge branch 'for-linus' of ↵Linus Torvalds2005-10-286-19/+38
|\ \ \ | |_|/ |/| | | | | git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6
| * | JFS: make sure right-most xtree pages have header.next set to zeroDave Kleikamp2005-10-281-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | The xtTruncate code was only doing this for leaf pages. When a file is horribly fragmented, we may truncate a file leaving an internal page with an invalid head.next field, which may cause a stale page to be referenced. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
| * | JFS: Corrupted block map should not cause trapDave Kleikamp2005-10-111-5/+14
| | | | | | | | | | | | | | | | | | Replace assert statements with better error handling. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
| * | JFS: make special inodes play nicely with page balancingDave Kleikamp2005-10-035-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes up a few problems with jfs's reserved inodes. 1. There is no need for the jfs code setting the I_DIRTY bits in i_state. I am ashamed that the code ever did this, and surprised it hasn't been noticed until now. 2. Make sure special inodes are on an inode hash list. If the inodes are unhashed, __mark_inode_dirty will fail to put the inode on the superblock's dirty list, and the data will not be flushed under memory pressure. 3. Force writing journal data to disk when metapage_writepage is unable to write a metadata page due to pending journal I/O. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
* | | Merge branch 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-blockLinus Torvalds2005-10-281-1/+1
|\ \ \
| * | | [patch] remove gendisk->stamp_idle fieldChen, Kenneth W2005-10-281-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct gendisk has these two fields: stamp, stamp_idle. Update to stamp_idle is always in sync with stamp and they are always the same. Therefore, it does not add any value in having two fields tracking same timestamp. Suggest to remove it. Also, we should only update gendisk stats with non-zero value. Advantage is that we don't have to needlessly calculate memory address, and then add zero to the content. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Signed-off-by: Jens Axboe <axboe@suse.de>
* | | [PATCH] gfp_t: reiserfs mapping_set_gfp_mask() useAl Viro2005-10-281-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | | [PATCH] gfp_t: fs/*Al Viro2005-10-2819-45/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - ->releasepage() annotated (s/int/gfp_t), instances updated - missing gfp_t in fs/* added - fixed misannotation from the original sweep caught by bitwise checks: XFS used __nocast both for gfp_t and for flags used by XFS allocator. The latter left with unsigned int __nocast; we might want to add a different type for those but for now let's leave them alone. That, BTW, is a case when __nocast use had been actively confusing - it had been used in the same code for two different and similar types, with no way to catch misuses. Switch of gfp_t to bitwise had caught that immediately... One tricky bit is left alone to be dealt with later - mapping->flags is a mix of gfp_t and error indications. Left alone for now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | | [PATCH] gfp_t: infrastructureAl Viro2005-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beginning of gfp_t annotations: - -Wbitwise added to CHECKFLAGS - old __bitwise renamed to __bitwise__ - __bitwise defined to either __bitwise__ or nothing, depending on __CHECK_ENDIAN__ being defined - gfp_t switched from __nocast to __bitwise__ - force cast to gfp_t added to __GFP_... constants - new helper - gfp_zone(); extracts zone bits out of gfp_t value and casts the result to int Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | | NFS: Allow files that are open for write to invalidate cachesTrond Myklebust2005-10-271-4/+0
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Convert unnecessary XDR warning messages into dprintk()Trond Myklebust2005-10-271-11/+6
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Add post-op attributes to NFSv4 write and commit callbacks.Trond Myklebust2005-10-272-7/+34
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Add post-op attributes to nfs4_proc_remove()Trond Myklebust2005-10-272-14/+38
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Add post-op attributes to nfs4_proc_rename()Trond Myklebust2005-10-272-7/+37
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Add post-op attributes to nfs4_proc_link()Trond Myklebust2005-10-272-11/+45
| | | | | | | | | | | | | | | | | | | | | Optimise attribute revalidation when hardlinking. Add post-op attributes for the directory and the original inode. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: Ensure that nfs_link() instantiates the dentry correctlyTrond Myklebust2005-10-271-7/+4
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: Add optional post-op getattr instruction to the NFSv4 file close.Trond Myklebust2005-10-272-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | "Optional" means that the close call will not fail if the getattr at the end of the compound fails. If it does succeed, try to refresh inode attributes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: Optimise attribute revalidation on close().Trond Myklebust2005-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | Only force a getattr in nfs_file_flush() if the attribute cache is stale. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Add directory post-op attributes to the CREATE operations.Trond Myklebust2005-10-272-15/+82
| | | | | | | | | | | | | | | | | | | | | | | | Since the directory attributes change every time we CREATE a file, we might as well pick up the new directory attributes in the same compound. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: nfs_lookup doesn't need to revalidate the parent directory's inodeChuck Lever2005-10-271-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nfs_lookup() used to consult a lookup cache before trying an actual wire lookup operation. The lookup cache would be invalid, of course, if the parent directory's mtime had changed, so nfs_lookup performed an inode revalidation on the parent. Since nfs_lookup() doesn't use a cache anymore, the revalidation is no longer necessary. There are cases where it will generate a lot of unnecessary GETATTR traffic. See http://bugzilla.linux-nfs.org/show_bug.cgi?id=9 Test-plan: Use lndir and "rm -rf" and watch for excess GETATTR traffic or application level errors. Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: Don't let nfs_end_data_update() clobber attribute update informationTrond Myklebust2005-10-274-24/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we almost always call nfs_end_data_update() after we called nfs_refresh_inode(), we now end up marking the inode metadata as needing revalidation immediately after having updated it. This patch rearranges things so that we mark the inode as needing revalidation _before_ we call nfs_refresh_inode() on those operations that need it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: Optimise inode attribute cache updatesTrond Myklebust2005-10-274-19/+41
| | | | | | | | | | | | | | | | | | | | | Allow nfs_refresh_inode() also to update attributes on the inode if the RPC call was sent after the last call to nfs_update_inode(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: Convert cache_change_attribute into a jiffy-based valueTrond Myklebust2005-10-271-4/+4
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: Cleanup initialisation of struct nfs_fattrTrond Myklebust2005-10-276-65/+66
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | Merge /home/trondmy/scm/kernel/git/torvalds/linux-2.6Trond Myklebust2005-10-273-0/+8
|\| |
| * | [PATCH] Fix HFS+ to free up the space when a file is deleted.Peter Wainwright2005-10-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsck_hfs reveals lots of temporary files accumulating in the hidden directory "\000\000\000HFS+ Private Data". According to the HFS+ documentation these are files which are unlinked while in use. However, there may be a bug in the Linux hfsplus implementation which causes this to happen even when the files are not in use. It looks like the "opencnt" field is never initialized as (I think) it should be in hfsplus_read_inode. This means that a file can appear to be still in use when in fact it has been closed. This patch seems to fix it for me. Signed-off-by: Anton Altaparmakov <aia21@cantab.net> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| * | [PATCH] inotify/idr leak fixAndrew Morton2005-10-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug which was reported and diagnosed by Stefan Jones <stefan.jones@churchillrandoms.co.uk> IDR trees include a cache of idr_layer objects. There's no way to destroy this cache, so when we discard an overall idr tree we end up leaking some memory. Add and use idr_destroy() for this. v9fs and infiniband also need to use idr_destroy() to avoid leaks. Or, we make the cache global, like radix_tree_preload(). Which is probably better. Later. Cc: Eric Van Hensbergen <ericvh@ericvh.myip.org> Cc: Roland Dreier <rolandd@cisco.com> Cc: Robert Love <rml@novell.com> Cc: John McCutchan <ttb@tentacle.dhs.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| * | [PATCH] aio syscalls are not checked by lsmKostik Belousov2005-10-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another case of missing call to security_file_permission: aio functions (namely, io_submit) does not check credentials with security modules. Below is the simple patch to the problem. It seems that it is enough to check for rights at the request submission time. Signed-off-by: Kostik Belousov <kostikbel@gmail.com> Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | | NFS: Fix a bad cast in nfs3_read_doneTrond Myklebust2005-10-271-1/+1
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Fix up locking for nfs4_state_ownerTrond Myklebust2005-10-203-5/+18
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Final tweak to sequence idTrond Myklebust2005-10-202-11/+14
| | | | | | | | | | | | | | | | | | Sacrifice queueing fairness for performance. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Fix acl buffer sizeJ. Bruce Fields2005-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | resp_len is passed in as buffer size to decode routine; make sure it's set right in case where userspace provides less than a page's worth of buffer. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: handle no acl attrJ. Bruce Fields2005-10-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Stop handing garbage to userspace in the case where a weird server clears the acl bit in the getattr return (despite the fact that they've already claimed acl support.) Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Fix an oopsable condition in nfs_free_seqidTrond Myklebust2005-10-182-9/+1
| | | | | | | | | | | | | | | | | | | | | Storing a pointer to the struct rpc_task in the nfs_seqid is broken since the nfs_seqid may be freed well after the task has been destroyed. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFS: Fix rename of directory onto empty directoryTrond Myklebust2005-10-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If someone tries to rename a directory onto an empty directory, we currently fail and return EBUSY. This patch ensures that we try the rename if both source and target are directories, and that we fail with a correct error of EISDIR if the source is not a directory. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | Fix Connectathon locking test failureTrond Myklebust2005-10-181-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | We currently fail Connectathon test 6.10 in the case of 32-bit locks due to incorrect error checking. Also add support for l->l_len < 0 to 64-bit locks. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Ensure that we recover from the OPEN + OPEN_CONFIRM BAD_STATEID raceTrond Myklebust2005-10-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the server is in the unconfirmed OPEN state for a given open owner and receives a second OPEN for the same open owner, it will cancel the state of the first request and set up an OPEN_CONFIRM for the second. This can cause a race that is discussed in rfc3530 on page 181. The following patch allows the client to recover by retrying the original open request. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: If a delegated open fails, ensure that we return the delegationTrond Myklebust2005-10-181-0/+2
| | | | | | | | | | | | | | | | | | Unless of course the open fails due to permission issues. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Return delegations in case we're changing ACLsTrond Myklebust2005-10-182-0/+6
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Return delegation upon rename or removal of file.Trond Myklebust2005-10-184-4/+20
| | | | | | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | VFS: Make link_path_walk set LOOKUP_CONTINUE before calling permission().Trond Myklebust2005-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This will allow nfs_permission() to perform additional optimizations when walking the path, by folding the ACCESS(MAY_EXEC) call on the directory into the lookup revalidation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | [NFS]: Check that the server returns a valid regular file to our OPEN requestTrond Myklebust2005-10-182-1/+19
| | | | | | | | | | | | | | | | | | Since it appears that some servers don't... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | NFSv4: Eliminate nfsv4 open race...Trond Myklebust2005-10-185-101/+73
| | | | | | | | | | | | | | | | | | | | | Make NFSv4 return the fully initialized file pointer with the stateid that it created in the lookup w/intent. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | | VFS: Allow the filesystem to return a full file pointer on open intentTrond Myklebust2005-10-183-27/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed by NFSv4 for atomicity reasons: our open command is in fact a lookup+open, so we need to be able to propagate open context information from lookup() into the resulting struct file's private_data field. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>