aboutsummaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAge
* Merge branch 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-blockLinus Torvalds2005-10-28
|\
| * [patch] remove gendisk->stamp_idle fieldChen, Kenneth W2005-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - ->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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Convert unnecessary XDR warning messages into dprintk()Trond Myklebust2005-10-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Add post-op attributes to NFSv4 write and commit callbacks.Trond Myklebust2005-10-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Add post-op attributes to nfs4_proc_remove()Trond Myklebust2005-10-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Add post-op attributes to nfs4_proc_rename()Trond Myklebust2005-10-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Add post-op attributes to nfs4_proc_link()Trond Myklebust2005-10-27
| | | | | | | | | | | | | | 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-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFS: Add optional post-op getattr instruction to the NFSv4 file close.Trond Myklebust2005-10-27
| | | | | | | | | | | | | | | | "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-27
| | | | | | | | | | | | | | 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-27
| | | | | | | | | | | | | | | | 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-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-27
| | | | | | | | | | | | | | | | | | | | | | | | 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-27
| | | | | | | | | | | | | | 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-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFS: Cleanup initialisation of struct nfs_fattrTrond Myklebust2005-10-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | Merge /home/trondmy/scm/kernel/git/torvalds/linux-2.6Trond Myklebust2005-10-27
|\|
| * [PATCH] Fix HFS+ to free up the space when a file is deleted.Peter Wainwright2005-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-23
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-27
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Fix up locking for nfs4_state_ownerTrond Myklebust2005-10-20
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Final tweak to sequence idTrond Myklebust2005-10-20
| | | | | | | | | | | | Sacrifice queueing fairness for performance. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Fix acl buffer sizeJ. Bruce Fields2005-10-19
| | | | | | | | | | | | | | | | | | 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-19
| | | | | | | | | | | | | | | | | | 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-19
| | | | | | | | | | | | | | 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-18
| | | | | | | | | | | | | | | | | | | | 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-18
| | | | | | | | | | | | | | | | 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-18
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-18
| | | | | | | | | | | | 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-18
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Return delegation upon rename or removal of file.Trond Myklebust2005-10-18
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | VFS: Make link_path_walk set LOOKUP_CONTINUE before calling permission().Trond Myklebust2005-10-18
| | | | | | | | | | | | | | | | 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-18
| | | | | | | | | | | | 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-18
| | | | | | | | | | | | | | 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-18
| | | | | | | | | | | | | | | | | | 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>
* | NFS: Fix up a race in the NFS implementation of GETLKTrond Myklebust2005-10-18
| | | | | | | | | | | | | | ...and fix a memory corruption bug due to improper use of memcpy() on a struct file_lock. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Fix up handling of open_to_lock sequence idsTrond Myklebust2005-10-18
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Make NFS clean up byte range locks asynchronouslyTrond Myklebust2005-10-18
| | | | | | | | | | | | Currently we fail to do so if the process was signalled. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Add missing handling of OPEN_CONFIRM requests on CLAIM_DELEGATE_CUR.Trond Myklebust2005-10-18
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Remove nfs4_client->cl_sem from close() pathTrond Myklebust2005-10-18
| | | | | | | | | | | | | | | | | | | | We no longer need to worry about collisions between close() and the state recovery code, since the new close will automatically recheck the file state once it is done waiting on its sequence slot. Ditto for the nfs4_proc_locku() procedure. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Remove obsolete state_owner and lock_owner semaphoresTrond Myklebust2005-10-18
| | | | | | | | | | | | | | OPEN, CLOSE, etc no longer need these semaphores to ensure ordering of requests. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Fix a potential CLOSE raceTrond Myklebust2005-10-18
| | | | | | | | | | | | | | | | | | | | Once the state_owner and lock_owner semaphores get removed, it will be possible for other OPEN requests to reopen the same file if they have lower sequence ids than our CLOSE call. This patch ensures that we recheck the file state once nfs_wait_on_sequence() has completed waiting. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFSv4: Add functions to order RPC callsTrond Myklebust2005-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NFSv4 file state-changing functions such as OPEN, CLOSE, LOCK,... are all labelled with "sequence identifiers" in order to prevent the server from reordering RPC requests, as this could cause its file state to become out of sync with the client. Currently the NFS client code enforces this ordering locally using semaphores to restrict access to structures until the RPC call is done. This, of course, only works with synchronous RPC calls, since the user process must first grab the semaphore. By dropping semaphores, and instead teaching the RPC engine to hold the RPC calls until they are ready to be sent, we can extend this process to work nicely with asynchronous RPC calls too. This patch adds a new list called "rpc_sequence" that defines the order of the RPC calls to be sent. We add one such list for each state_owner. When an RPC call is ready to be sent, it checks if it is top of the rpc_sequence list. If so, it proceeds. If not, it goes back to sleep, and loops until it hits top of the list. Once the RPC call has completed, it can then bump the sequence id counter, and remove itself from the rpc_sequence list, and then wake up the next sleeper. Note that the state_owner sequence ids and lock_owner sequence ids are all indexed to the same rpc_sequence list, so OPEN, LOCK,... requests are all ordered w.r.t. each other. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | Merge /home/trondmy/scm/kernel/git/torvalds/linux-2.6Trond Myklebust2005-10-18
|\|
| * [PATCH] aio: revert lock_kiocb()Zach Brown2005-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lock_kiocb() was introduced to serialize retrying and cancellation. In the process of doing so it tried to sleep waiting for KIF_LOCKED while holding the ctx_lock spinlock. Recent fixes have ensured that multiple concurrent retries won't be attempted for a given iocb. Cancel has other problems and has no significant in-tree users that have been complaining about it. So for the immediate future we'll revert sleeping with the lock held and will address proper cancellation and retry serialization in the future. Signed-off-by: Zach Brown <zach.brown@oracle.com> Acked-by: Benjamin LaHaise <bcrl@kvack.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>