summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* [PATCH] fuse: fix handling of moved directoryMiklos Szeredi2006-10-173-27/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | Fuse considered it an error (EIO) if lookup returned a directory inode, to which a dentry already refered. This is because directory aliases are not allowed. But in a network filesystem this could happen legitimately, if a directory is moved on a remote client. This patch attempts to relax the restriction by trying to first evict the offending alias from the cache. If this fails, it still returns an error (EBUSY). A rarer situation is if an mkdir races with an indenpendent lookup, which finds the newly created directory already moved. In this situation the mkdir should return success, but that would be incorrect, since the dentry cannot be instantiated, so return EBUSY. Previously checking for a directory alias and instantiation of the dentry weren't done atomically in lookup/mkdir, hence two such calls racing with each other could create aliased directories. To prevent this introduce a new per-connection mutex: fuse_conn->inst_mutex, which is taken for instantiations with a directory inode. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] fuse: fix spurious BUGMiklos Szeredi2006-10-171-3/+0
| | | | | | | | | | | | | Fix a spurious BUG in an unlikely race, where at least three parallel lookups return the same inode, but with different file type. This has not yet been observed in real life. Allowing unlimited retries could delay fuse_iget() indefinitely, but this is really for the broken userspace filesystem to worry about. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] fuse: locking fix for nlookupMiklos Szeredi2006-10-172-0/+4
| | | | | | | | | | An inode could be returned by independent parallel lookups, in this case an update of the lookup counter could be lost resulting in a memory leak in userspace. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] fuse: fix hang on SMPMiklos Szeredi2006-10-173-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | Fuse didn't always call i_size_write() with i_mutex held which caused rare hangs on SMP/32bit. This bug has been present since fuse-2.2, well before being merged into mainline. The simplest solution is to protect i_size_write() with the per-connection spinlock. Using i_mutex for this purpose would require some restructuring of the code and I'm not even sure it's always safe to acquire i_mutex in all places i_size needs to be set. Since most of vmtruncate is already duplicated for other reasons, duplicate the remaining part as well, making all i_size_write() calls internal to fuse. Using i_size_write() was unnecessary in fuse_init_inode(), since this function is only called on a newly created locked inode. Reported by a few people over the years, but special thanks to Dana Henriksen who was persistent enough in helping me debug it. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] PROC_NUMBUF is wrongAndrew Morton2006-10-171-1/+1
| | | | | | | | | | Actually, the decimal representation of a 32-bit signed number can take 12 bytes, including the \0. And then some code adds a \n as well, so let's give it 13 bytes. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] null dereference in fs/jbd2/journal.cDave Kleikamp2006-10-171-1/+2
| | | | | | | | | | | | | | | | This is Eric Sesterhenn's jbd patch applied to jbd2. Commit: 41716c7c21b15e7ecf14f0caf1eef3980707fb74 His words: Since commit d1807793e1e7e502e3dc047115e9dbc3b50e4534 we dereference a NULL pointer. Coverity id #1432. We set journal to NULL, and use it directly afterwards. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Cc: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] Fix core files so they make sense to gdb...Petr Vandrovec2006-10-151-5/+3
| | | | | | | | | | | | It is silly to use non-static variable for writting zeroes to the file. And more seriously, foffset in core dump file dump function was incremented too much, so some parts of core dump were shifted by size of few phdrs and notes down, so although gdb was able to load that file, it did not make lot of sense - in my test case data pages were shifted down by about 900 bytes. Signed-off-by: Petr Vandrovec <petr@vandrovec.name> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] new cifs endianness bugsAl Viro2006-10-151-5/+7
| | | | | | | | | | * missing cpu_to_le64() for ChangeTime (introduced by [CIFS] Legacy time handling for Win9x and OS/2 part 1) * missing le16_to_cpu() for DialectIndex (introduced by [CIFS] Do not send newer QFSInfo to legacy servers which can not support it) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixesLinus Torvalds2006-10-136-14/+15
|\ | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes: [GFS2] Update git tree name/location [DLM] fix iovec length in recvmsg [GFS2] Pass the correct value to kunmap_atomic [GFS2] Fix bug where lock not held [DLM] Kconfig: don't show an empty DLM menu [GFS2] Fix uninitialised variable [GFS2] Fix a size calculation error
| * [DLM] fix iovec length in recvmsgPatrick Caulfield2006-10-121-1/+1
| | | | | | | | | | | | | | | | The DLM always passes the iovec length as 1, this is wrong when the circular buffer wraps round. Signed-Off-By: Patrick Caulfield <pcaulfie@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
| * [GFS2] Pass the correct value to kunmap_atomicRussell Cattelan2006-10-122-5/+5
| | | | | | | | | | | | | | Pass kaddr rather than (incorrect) struct page to kunmap_atomic. Signed-off-by: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
| * [GFS2] Fix bug where lock not heldSteven Whitehouse2006-10-121-3/+2
| | | | | | | | | | | | | | The log lock needs to be held when manipulating the counter for the number of free journal blocks. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
| * [DLM] Kconfig: don't show an empty DLM menuAdrian Bunk2006-10-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | Don't show an empty "Distributed Lock Manager" menu if IP_SCTP=n. Reported by Dmytro Bagrii in kernel Bugzilla #7268. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Patrick Caulfield <pcaulfie@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
| * [GFS2] Fix uninitialised variableSteven Whitehouse2006-10-122-1/+2
| | | | | | | | | | | | | | | | This fixes a bug where, in certain cases an uninitialised variable could cause a dereference of a NULL pointer in gfs2_commit_write(). Also a typo in a comment is fixed at the same time. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
| * [GFS2] Fix a size calculation errorRussell Cattelan2006-10-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a size calculation error. The size was incorrect being computed as a negative length and then being passed to an unsigned parameter. This in turn would cause the allocator to think it needed enough meta data to store a gigabyte file for every file created. Signed-off-by: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* | [PATCH] Get core dump code to work...Petr Vandrovec2006-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file based core dump code was broken by pipe changes - a relative llseek returns the absolute file position on success, not the relative one, so dump_seek() always failed when invoked with non-zero current position. Only success/failure can be tested with relative lseek, we have to trust kernel that on success we've got right file offset. With this fix in place I have finally real core files instead of 1KB fragments... Signed-off-by: Petr Vandrovec <petr@vandrovec.name> [ Cleaned it up a bit while here - use SEEK_CUR instead of hardcoding 1 ] Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6Linus Torvalds2006-10-1320-98/+312
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (27 commits) [CIFS] Missing flags2 for DFS [CIFS] Workaround incomplete byte length returned by some [CIFS] cifs Kconfig: don't select CONNECTOR [CIFS] Level 1 QPathInfo needed for proper OS2 support [CIFS] fix typo in previous patch [CIFS] Fix old DOS time conversion to handle timezone [CIFS] Do not need to adjust for Jan/Feb for leap day [CIFS] Fix leaps year calculation for years after 2100 [CIFS] readdir (ffirst) enablement of accurate timestamps from legacy servers [CIFS] Fix compiler warning with previous patch [CIFS] Fix typo [CIFS] Allow for 15 minute TZs (e.g. Nepal) and be more explicit about [CIFS] Fix readdir of large directories for backlevel servers [CIFS] Allow LANMAN21 support even in both POSIX non-POSIX path [CIFS] Make use of newer QFSInfo dependent on capability bit instead of [CIFS] Do not send newer QFSInfo to legacy servers which can not support it [CIFS] Fix typo in name of new cifs_show_stats [CIFS] Rename server time zone field [CIFS] Handle legacy servers which return undefined time zone [CIFS] CIFS support for /proc/<pid>/mountstats part 1 ... Manual conflict resolution in fs/cifs/connect.c
| * | [CIFS] Missing flags2 for DFSSteve French2006-10-122-1/+11
| | | | | | | | | | | | | | | | | | Partly suggested by Igor Mammedov Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Workaround incomplete byte length returned by someSteve French2006-10-122-14/+30
| | | | | | | | | | | | | | | | | | servers on small SMB responses Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] cifs Kconfig: don't select CONNECTORAndrew Morton2006-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `select' is a bit obnoxious: the option keeps on coming back and it's hard to work out what to do to make it go away again. The use of `depends on' is preferred (although it has usability problems too..) Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Level 1 QPathInfo needed for proper OS2 supportSteve French2006-10-123-4/+23
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] fix typo in previous patchSteve French2006-10-121-3/+3
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Fix old DOS time conversion to handle timezoneSteve French2006-10-122-2/+13
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Do not need to adjust for Jan/Feb for leap daySteve French2006-10-111-1/+2
| | | | | | | | | | | | | | | | | | | | | calculation in 2100 (year divisible by 100) Signed-off-by: Yehuda Sadeh Weinraub <Yehuda.Sadeh@expand.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Fix leaps year calculation for years after 2100Steve French2006-10-111-0/+9
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] readdir (ffirst) enablement of accurate timestamps from legacy serversSteve French2006-10-062-30/+27
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Fix compiler warning with previous patchSteve French2006-10-021-1/+1
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Fix typoSteve French2006-10-021-1/+1
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Allow for 15 minute TZs (e.g. Nepal) and be more explicit aboutSteve French2006-10-022-14/+25
| | | | | | | | | | | | | | | | | | | | | not setting time on close Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Fix readdir of large directories for backlevel serversSteve French2006-10-011-0/+1
| | | | | | | | | | | | | | | | | | (were not setting all of resume key) Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Allow LANMAN21 support even in both POSIX non-POSIX pathSteve French2006-10-011-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Make use of newer QFSInfo dependent on capability bit instead ofSteve French2006-09-302-2/+2
| | | | | | | | | | | | | | | | | | | | | whether we negotiated legacy lanman dialect so we do not keep retrying for mount to WindowsME Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Do not send newer QFSInfo to legacy servers which can not support itSteve French2006-09-306-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix dialect negotiation to save off when we have negotiated lanman. This allows us to avoid sending some somewhat newer requests that the server can not handle and go directly to the older version (infolevel) of the same call. Make sure we try to negotiate a level which allows us to get the server OS (which we check so we can detect Win9x vs. other legacy servers and eventually work around the Win9x DOS time bug (they reverse date/time fields). Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Fix typo in name of new cifs_show_statsSteve French2006-09-301-1/+1
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Rename server time zone fieldSteve French2006-09-305-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | Server time zone is not really a time zone, rather a time adjustement in seconds. CC: Guenter Kukkukk <linux@kukkukk.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Handle legacy servers which return undefined time zoneSteve French2006-09-301-1/+27
| | | | | | | | | | | | | | | Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] CIFS support for /proc/<pid>/mountstats part 1Steve French2006-09-281-0/+11
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Fix build break ifdef in wrong placeSteve French2006-09-281-1/+1
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] More removing of unused functionsSteve French2006-09-283-1/+9
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Remove unused prototypesSteve French2006-09-281-3/+0
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Fix build breakSteve French2006-09-281-0/+1
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Remove static and unused symbolsSteve French2006-09-2813-34/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | Most cases of the ones found by Shaggy by "make namespacecheck" could be removed or made static Ack: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | [CIFS] Legacy time handling for Win9x and OS/2 part 1Steve French2006-09-286-4/+80
| | | | | | | | | | | | Signed-off-by: Steve French <sfrench@us.ibm.com>
| * | CIFS: Use SEEK_END instead of hardcoded valueSteve French2006-09-231-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Signed-off-by: Steve French <sfrench@us.ibm.com>
* | | [PATCH] block layer: ioprio_best function fixVasily Tarasov2006-10-121-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently ioprio_best function first checks wethere aioprio or bioprio equals IOPRIO_CLASS_NONE (ioprio_valid() macros does that) and if it is so it returns bioprio/aioprio appropriately. Thus the next four lines, that set aclass/bclass to IOPRIO_CLASS_BE, if aclass/bclass == IOPRIO_CLASS_NONE, are never executed. The second problem: if aioprio from class IOPRIO_CLASS_NONE and bioprio from class IOPRIO_CLASS_IDLE are passed to ioprio_best function, it will return IOPRIO_CLASS_IDLE. It means that during __make_request we can merge two requests and set the priority of merged request to IDLE, while one of the initial requests originates from a process with NONE (default) priority. So we can get a situation when a process with default ioprio will experience IO starvation, while there is no process from real-time class in the system. Just removing ioprio_valid check should correct situation. Signed-off-by: Vasily Tarasov <vtaras@openvz.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* | | [PATCH] splice: fix pipe_to_file() ->prepare_write() error pathJens Axboe2006-10-121-3/+3
| |/ |/| | | | | | | | | Don't jump to the unlock+release path, we already did that. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* | [PATCH] misuse of strstrAl Viro2006-10-111-1/+1
| | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [PATCH] fs/bio.c: tweaksAndreas Mohr2006-10-111-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Calculate a variable in bvec_alloc_bs() only once needed, not earlier (bio.o down from 18408 to 18376 Bytes, 32 Bytes saved, probably due to data locality improvements). - Init variable idx to silence a gcc warning which already existed in the unmodified original base file (bvec_alloc_bs() handles idx correctly, so there's no need for the warning): fs/bio.c: In function `bio_alloc_bioset': fs/bio.c:169: warning: `idx' may be used uninitialized in this function Signed-off-by: Andreas Mohr <andi@lisas.de> Acked-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [PATCH] VFS: Destroy the dentries contributed by a superblock on unmountingDavid Howells2006-10-112-6/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attached patch destroys all the dentries attached to a superblock in one go by: (1) Destroying the tree rooted at s_root. (2) Destroying every entry in the anon list, one at a time. (3) Each entry in the anon list has its subtree consumed from the leaves inwards. This reduces the amount of work generic_shutdown_super() does, and avoids iterating through the dentry_unused list. Note that locking is almost entirely absent in the shrink_dcache_for_umount*() functions added by this patch. This is because: (1) at the point the filesystem calls generic_shutdown_super(), it is not permitted to further touch the superblock's set of dentries, and nor may it remove aliases from inodes; (2) the dcache memory shrinker now skips dentries that are being unmounted; and (3) the superblock no longer has any external references through which the VFS can reach it. Given these points, the only locking we need to do is when we remove dentries from the unused list and the name hashes, which we do a directory's worth at a time. We also don't need to guard against reference counts going to zero unexpectedly and removing bits of the tree we're working on as nothing else can call dput(). A cut down version of dentry_iput() has been folded into shrink_dcache_for_umount_subtree() function. Apart from not needing to unlock things, it also doesn't need to check for inotify watches. In this version of the patch, the complaint about a dentry still being in use has been expanded from a single BUG_ON() and now gives much more information. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: NeilBrown <neilb@suse.de> Acked-by: Ian Kent <raven@themaw.net> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [PATCH] AUTOFS: Make sure all dentries refs are released before calling ↵David Howells2006-10-114-22/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kill_anon_super() Make sure all dentries refs are released before calling kill_anon_super() so that the assumption that generic_shutdown_super() can completely destroy the dentry tree for there will be no external references holds true. What was being done in the put_super() superblock op, is now done in the kill_sb() filesystem op instead, prior to calling kill_anon_super(). This makes the struct autofs_sb_info::root member variable redundant (since sb->s_root is still available), and so that is removed. The calls to shrink_dcache_sb() are also removed since they're also redundant as shrink_dcache_for_umount() will now be called after the cleanup routine. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Ian Kent <raven@themaw.net> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
OpenPOWER on IntegriCloud