aboutsummaryrefslogtreecommitdiffstats
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2004-08-22[PATCH] aio.c: rename 'struct timeout' to 'struct aio_timeout'Iñaky Pérez-González1-6/+6
This patch renames fs/aio.c:'struct timeout' to 'struct aio_timeout'. The rationale behind this decision is this type is used only inside the aforementioned aio.c file and being the type name very generic, it is likely to cause namespace conflicts in the future. I actually found it while working on an extended schedule_timeout()- like API used by robust mutexes but usable by anyone. There I declared a 'struct timeout' and aio.c complained about it. I could have also renamed the struct for the schedule_timeout() like API, but being the aio.c one specific to the file, I thought it might make more sense to rename the later. Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] IS_ERR() unlikeliness cleanupAndrew Morton7-20/+20
Remove now-unneeded open-coded unlikelies around IS_ERR(). Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] DIO pages-in-io accounting fixBadari Pulavarty1-1/+5
I found one more accounting inconsistency with dio_pages_in_io. This is a day-one bug and I started hitting it on latest -mm due to the recent changes to dio_pages_in_io calculations to be exact. If the file is badly fragmented (no contiguous blocks at all), and the user buffer is not page aligned - we need to create IO for each disk block with 2 pages. (bio with 2 vecs). dio_bio_add_page() should not decrement dio_pages_in_io for every add page. It should only decrement, it only if its done with that page and moving on to next page. (since dio_pages_in_io represent how many actual pages we are operating on). Here is the patch to fix this accounting. Without this patch, we will hit BUG() in dio_new_bio() with O_DIRECT on filesystems. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] direct-io: size the BIOs more accuratelyBadari Pulavarty1-2/+6
We're being lazy when calculating the size of the needed BIO, allocating two extra pages to cope with funny alignments. Change that to be exact, thus allocating smaller BIOs someties. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] kill UDF registration/unregistration messagesSean Neakums1-2/+0
This patch kills two printks from UDF that announce its registration and unregistration. Since one can determine which filesystems are present by examining /proc/filesystems, these messages strike me as noise. Signed-off-by: Sean Neakums <sneakums@zork.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] knfsd: fix server permission handlingNeil Brown1-3/+4
Fix a problem wherein device nodes on a ro-exported mount cannot be opened read/write. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] kNFSd: fix two xdr-encode bugs for readdirplus replyNeil Brown2-4/+18
More fall-out from the change to allow multi-page replies to readdir requests. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] kNFSd: get rid of open_private_fileNeil Brown9-144/+83
This is only used by nfsd to save one kmalloc, and the code is not always kept up-to-date with dentry_open, so just get rid of it. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] kNFSd: fix brokenness with fsid= export optionBruce Allan1-7/+10
Bruce Allan says: The user-specified fsid= export option still doesn't work after the changes made 5 months ago. Below is a patch against 2.6.7 through the recent 2.6.8-rc2-bk13. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] nfsd: ACL support for the NFSv4 serverNeil Brown3-13/+305
Server-side support for the limited portion of the NFSv4 ACL protocol necessary to support POSIX ACLs. Will return an error on an attempt to set any ACL that doesn't map to a POSIX ACL. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] nfsd: POSIX<->NFSv4 acl translation for nfsdNeil Brown2-1/+772
Code to translate between Linux's POSIX ACLs and NFSv4 ACLs. Since NFSv4 ACLs are fundamentally richer, we are able to translate any POSIX ACL to NFSv4, but can only map NFSv4 ACLs that follow a certain format; see http://www.citi.umich.edu/u/marius/draft-eriksen-nfsv4-acl-02.txt for details of the mapping. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] nfsd: basic v4 ACL definitionsNeil Brown2-1/+205
Basic v4 acl definitions, to be used by server ACL implementation Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] nfsd: force server-side TCP when NFSv4 enabledNeil Brown1-0/+1
NFSv4 should really run over TCP, and clients will expect that; so there's no point letting people build kernels that support NFSv4 without also supporting server-side TCP. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] mpage writepages range limit fixSuparna Bhattacharya1-1/+2
Safeguard to make sure we break out of pagevec_lookup_tag loop if we are beyond the specified range. Signed-off-by: Suparna Bhattacharya <suparna@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] Writeback page range hintAndrew Morton1-3/+24
Modify mpage_writepages to optionally only write back dirty pages within a specified range in a file (as in the case of O_SYNC). Cheat a little to avoid changes to prototypes of aops - just put the <start, end> hint into the writeback_control struct instead. If <start, end> are not set, then default to writing back all the mapping's dirty pages. Signed-off-by: Suparna Bhattacharya <suparna@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] rcu: abstracted RCU dereferencingDipankar Sarma1-6/+4
Use abstracted RCU API to dereference RCU protected data. Hides barrier details. Patch from Paul McKenney. This patch introduced an rcu_dereference() macro that replaces most uses of smp_read_barrier_depends(). The new macro has the advantage of explicitly documenting which pointers are protected by RCU -- in contrast, it is sometimes difficult to figure out which pointer is being protected by a given smp_read_barrier_depends() call. Signed-off-by: Paul McKenney <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] prio_tree: iterator + vma_prio_tree_next cleanupRajesh Venkatasubramanian1-3/+2
Currently we have: while ((vma = vma_prio_tree_next(vma, root, &iter, begin, end)) != NULL) do_something_with(vma); Then iter,root,begin,end are all transfered unchanged to various functions. This patch hides them in struct iter instead. It slightly lessens source, code size, and stack usage. Patch compiles and tested lightly. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Rajesh Venkatasubramanian <vrajesh@umich.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] vprintk for ext3 errorsMatt Mackall1-28/+25
Kill error_buf madness in ext3 Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] vprintk for ext2 errorsMatt Mackall1-22/+23
Kill error_buf madness in ext2 Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] proc_pid_cmdline() race fixRoger Luethi1-0/+2
If you win the race with a starting process, you can read its environment. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] ext2_readdir() filp->f_pos fixJan Blunck1-3/+8
If the whole directory is read, ext2_readdir() sets the f_pos to a multiple of the page size (because of the conditions of the outer for loop). This sets the wrong f_pos for directory inodes on ext2 partitions with a block size differing from the page size. Signed-off-by: Jan Blunck <j.blunck@tu-harburg.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] make shrinker_sem an rwsemNick Piggin1-2/+3
Use an rwsem to protect the shrinker list instead of a regular semaphore. Modifications to the list are now done under the write lock, shrink_slab takes the read lock, and access to shrinker->nr becomes racy (which is no different to how the page lru scanner is implemented). The shrinker functions become concurrent. Previously, having the slab scanner get preempted or scheduling while holding the semaphore would cause other tasks to skip putting pressure on the slab. Also, make shrink_icache_memory return -1 if it can't do anything in order to hold pressure on this cache and prevent useless looping in shrink_slab. Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] remove dead prototypesCarl Spalletta15-25/+0
Remove a whole bunch of prototypes which declare no-longer-present functions. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] memory-backed inodes fixAndrew Morton1-2/+8
If an inode is backed by a memory-backed backing_dev, and it is not a blockdev inode, we can skip the entire superblock duwing writeback scanning. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] ext3 barrier supportJens Axboe3-9/+66
Mount with "mount -o barrier=1" to enable barriers. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] reiserfs v3 barrier supportChris Mason3-14/+107
Add reiserfs support for flush barriers, mount with -o barrier=flush to enable them. Barriers are triggered on fsync and for log commits. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] add BH_Eopnotsupp for testing async barrier failuresChris Mason1-2/+8
In order for filesystems to detect asynchronous ordered write failures for buffers sent via submit_bh, they need a bit they can test for in the buffer head. This adds BH_Eopnotsupp and the related buffer operations end_buffer_write_sync is changed to avoid a printk for BH_Eoptnotsupp related failures, since the FS is responsible for a retry. sync_dirty_buffer is changed to test for BH_Eopnotsupp and return -EOPNOTSUPP to the caller Some of this came from Jens Axboe Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] make sync_dirty_buffer() return something usefulAndrew Morton1-3/+9
Make sync_dirty_buffer() return the result of its syncing. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] disk barriers: coreJens Axboe1-3/+20
IDE disk barrier core. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] proc fs task name locking fixMike Kravetz2-6/+28
Races have been observed between excec-time overwriting of task->comm and /proc accesses to the same data. This causes environment string information to appear in /proc. Fix that up by taking task_lock() around updates to and accesses to task->comm. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22Merge http://xfs.org:8090/xfs-linux-2.6Linus Torvalds55-396/+775
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2004-08-22[PATCH] minix block usage counting fixAndries E. Brouwer1-1/+1
In 2.5.18 some minix-specific stuff was moved to the minix subdirectory where it belonged. However, a typo crept in, causing inode disk usage to be incorrectly reported. A few people have complained, but so far not sufficiently loudly. Signed-off-by: Andries Brouwer <Andries.Brouwer@cwi.nl> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-20[XFS] Fix up handling of SB versionnum when filesystem on disk hasTimothy Shimmin1-3/+3
newer bit features than the kernel. SGI Modid: xfs-linux:xfs-kern:177392a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] avoid using pid_t in ioctl ABIChristoph Hellwig1-1/+1
SGI Modid: xfs-linux:xfs-kern:177165a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Add 32bit ioctl translationNathan Scott6-8/+220
SGI Modid: xfs-linux:xfs-kern:177164a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Add a realtime inheritance bit for directory inodes so newNathan Scott4-20/+43
files can be automatically created as realtime files. SGI Modid: xfs-linux:xfs-kern:177129a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Use sparse whitespace approach that Al took to be more consistent. ↵Nathan Scott13-83/+87
Couple more sparse fixes. SGI Modid: xfs-linux:xfs-kern:177030a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Remove several macros which are no longer used anywhere.Nathan Scott4-34/+0
SGI Modid: xfs-linux:xfs-kern:177029a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Add support for unsetting realtime flag on realtime file whichHerry Wiputra1-2/+5
has no extents allocated. SGI Modid: xfs-linux:xfs-kern:18776a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Fix lock leak in xfs_free_file_spaceDean Roehrich1-2/+6
SGI Modid: xfs-linux:xfs-kern:176905a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Fix a blocksize-smaller-than-pagesize hang when writing buffersNathan Scott1-2/+6
with a shared page. SGI Modid: xfs-linux:xfs-kern:176412a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Fix accidental reverting of sync write preallocations.Nathan Scott3-21/+6
SGI Modid: xfs-linux:xfs-kern:176195a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Code checks to trap access to fsb zero.Eric Sandeen5-18/+101
SGI Modid: xfs-linux:xfs-kern:176159a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Add filesystem size limit even when XFS_BIG_BLKNOS isEric Sandeen1-6/+11
in effect; limited by page cache index size (16T on ia32) SGI Modid: xfs-linux:xfs-kern:175103a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Fix signed/unsigned issues in xfs_reserve_blocks routine.Nathan Scott1-5/+4
SGI Modid: xfs-linux:xfs-kern:174873a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Restored xfs_iflush_all, which is still used to finish reclaims.Felix Blyakher3-0/+105
SGI Modid: xfs-linux:xfs-kern:174868a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: fix remaining NULL vs zero uses.Nathan Scott1-2/+2
SGI Modid: xfs-linux:xfs-kern:174857a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: fix uses of NULL in place of zero and vice versa.Nathan Scott14-31/+31
From Chris Wedgwood. SGI Modid: xfs-linux:xfs-kern:174819a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: fix warnings in IO path tracing code. From Chris Wedgwood.Nathan Scott1-4/+4
SGI Modid: xfs-linux:xfs-kern:174818a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: rework previous mods to fix warnings in DMAPI code.Nathan Scott4-5/+5
From Chris Wedgwood. SGI Modid: xfs-linux:xfs-kern:174817a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: fix header include order to get cpp macros definedNathan Scott2-15/+2
correctly. From Chris Wedgwood. SGI Modid: xfs-linux:xfs-kern:174816a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] xfs_Gqm_init cannot fail, dont check return value.Nathan Scott1-5/+2
Removes a bit of dead code and a false positive from the Stanford lock checker to boot. SGI Modid: xfs-linux:xfs-kern:174815a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Fix xfs_off_t to be signed, not unsigned; valid warnings emittedNathan Scott1-1/+1
after stricter compilation options used by some OSDL folks. SGI Modid: xfs-linux:xfs-kern:174814a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Fix a possible data loss issue after an unaligned unwrittenNathan Scott1-1/+2
extent write. SGI Modid: xfs-linux:xfs-kern:174810a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Removed xfs_iflush_all and all usages of vn_purge, except oneFelix Blyakher4-115/+1
in clear_inode path. SGI Modid: xfs-linux:xfs-kern:174683a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: fix warnings in debug/tracing code. From Chris Wedgwood.Nathan Scott2-5/+5
SGI Modid: xfs-linux:xfs-kern:174341a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: annotate vfs interfaces for user pointers. From Chris Wedgwood.Nathan Scott8-39/+39
SGI Modid: xfs-linux:xfs-kern:174339a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: annotate quota source for user pointers. From Chris Wedgwood.Nathan Scott2-2/+2
SGI Modid: xfs-linux:xfs-kern:174338a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: annotate source for user pointers. From Chris Wedgwood.Nathan Scott8-27/+27
SGI Modid: xfs-linux:xfs-kern:174337a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] sparse: remove unneeded casts for user buffers. From Chris Wedgwood.Nathan Scott1-34/+31
SGI Modid: xfs-linux:xfs-kern:174335a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Remove unneeded escape from printed string. From Chris Wedgwood.Nathan Scott1-1/+1
SGI Modid: xfs-linux:xfs-kern:174336a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Revert to using a separate inode for metadata buffers once more.Nathan Scott3-38/+90
SGI Modid: xfs-linux:xfs-kern:174253a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Sync up with the 2.4 fix for updating i_size under i_sem.Nathan Scott2-26/+41
SGI Modid: xfs-linux:xfs-kern:174249a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-20[XFS] Permit buffered writes to the real-time subvolume.Glen Overby3-5/+56
SGI Modid: xfs-linux:xfs-kern:174094a Signed-off-by: Nathan Scott <nathans@sgi.com>
2004-08-13Fix stupid thinkos in the fcntl f_op removal code.Linus Torvalds1-2/+2
Tssk.
2004-08-12[PATCH] Remove fcntl f_opMatthew Wilcox6-93/+24
The newly introduced ->fcntl file_operation is badly thought out, not to mention undocumented. This patch replaces it with two better defined operations -- check_flags and dir_notify. Any other fcntl()s that filesystems are interested in can have their own properly typed f_op method when they need it. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-11[PATCH] Fix unsigned underflow in xdr decoding.Neil Brown2-2/+2
With 'len' being unsigned now, we must make sure it never tries to go negative... Thanks: griffon26@kfk4ever.com (Maurice van der Pot) Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-09read/write: pass down a copy of f_pos, not f_pos itself.Linus Torvalds1-4/+22
This allows the VFS layer to the update rather than the low-level drivers.
2004-08-09Revert FAT NLS changes.Linus Torvalds2-74/+103
It's causing massive user confusion, and breaks installers by mounting the filesystem read-only. Cset exclude: hirofumi@mail.parknet.co.jp[torvalds]|ChangeSet|20040802210150|02337
2004-08-09[PATCH] knfsd: fix some signed ints that should be unsignedNeil Brown2-9/+12
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-08Remove ESPIPE logic from drivers, letting the VFS layer handle it instead.Linus Torvalds1-6/+2
This cleans up and simplifies drivers, and also allows us future simplification in the VFS layer, since it removes knowledge about internal VFS layer handling of "f_pos".
2004-08-07Make sysctl pass the pos pointer around properly.Linus Torvalds2-6/+7
Nobody ever fixed the big FIXME in sysctl - but we really need to pass around the proper "loff_t *" to all the sysctl functions if we want them to be well-behaved wrt the file pointer position. This is all preparation for making direct f_pos accesses go away.
2004-08-07Teach sendfile() to honour non-seekable source files.Linus Torvalds1-0/+4
Remove the test from the socket code, now that it's no longer necessary.
2004-08-07Add "nonseekable_open()" helper functions for nonseekableLinus Torvalds1-0/+12
file descriptors.
2004-08-07Add pread/pwrite support bits to match the lseek bit.Linus Torvalds7-20/+13
This also removes the ESPIPE logic from pipes and seq_files, since the VFS layer now supports it.
2004-08-07[PATCH] jbd: journal_head unmapping race fixAndrew Morton1-7/+8
Fix a race identified by Chris Mason <mason@suse.com> journal_unmap_buffer -> __dispose_buffers has the j_list_lock and the jbd_lock_bh_state held. journal_get_write_access calls journal_put_journal_head, which takes jbd_lock_bh_journal_head(bh) and doesn't seem to have any other locks held. Since journal_unmap_buffers trusts the buffer_jbd bit to see if we need to call __dispose_buffer, and nobody seems to test buffer_jbd after taking jbd_lock_bh_journal_head. The kernel dereferences a null jh pointer in __journal_remove_journal_head. The patch fixes this by using journal_grab_journal_head() in journal_unmap_buffer(). It ensures that we either grab and pin the journal_head if the bh has one, or we bale out if the bh doesn't have a journal_head. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-06Add infrastructure for the VFS layer to mark files seekable.Linus Torvalds6-11/+19
We use a FMODE_LSEEK flag to match the existing read/write bits. This allows us to check for seekability on a VFS level for lseek/pread/pwrite, and cleans things up. Update some sites that used the numeric constants to use the symbolic values instead.
2004-08-05Make the new simple_read_from_buffer() take a const srcLinus Torvalds1-1/+1
buffer without complaints.
2004-08-05Fix shrink_dcache_anon() LRU list accesses.Linus Torvalds1-1/+1
It would potentially remove dentries from the LRU list without re-initializing the d_lru fields, causing later accesses to that dentry to do bad things to the LRU list.
2004-08-05Merge bk://linux-mtd.bkbits.net/mtd-2.6Linus Torvalds2-0/+19
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2004-08-05[PATCH] fix /proc printing of TASK_DEAD stateRoland McGrath1-0/+1
I just stumbled across this patch that's been sitting in my tree for ages. I thought I'd sent this in before. It's a trivial fix for the printing of task state in /proc and sysrq dumps and such, so that TASK_DEAD shows up correctly. This state is pretty much only ever there to be seen when there are exit/reaping bugs, but it's not like that hasn't come up. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-05[PATCH] simple_read_buffer() helper functionAlexander Viro1-0/+18
A number of drivers or special virtual devices really just want their "read()" function to populate user space from some internal buffer. This adds such a helper function - "simple_read_from_buffer()" - and converts several ->read() instances to use it. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-05Merge shinybook.infradead.org:/home/dwmw2/bk/linus-2.5David Woodhouse1-12/+8
into shinybook.infradead.org:/home/dwmw2/bk/mtd-2.6
2004-08-02[PATCH] bio_copy_user() cleanups and fixesJens Axboe1-26/+140
blk_rq_map_user() is a bit of a hack currently, since it drops back to kmalloc() if bio_map_user() fails. This is unfortunate since it means we do no real segment or size checking (and the request segment counts contain crap, already found one bug in a scsi lld). It's also pretty nasty for > PAGE_SIZE requests, as we attempt to do higher order page allocations. Even worse still, ide-cd will drop back to PIO for non-sg/bio requests. All in all, very suboptimal. This patch adds bio_copy_user() which simply sets up a bio with kernel pages and copies data as needed for reads and writes. It also changes bio_map_user() to return an error pointer like bio_copy_user(), so we can return something sane to the user instead of always -ENOMEM. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-02[PATCH] FAT: kill nls defaultHirofumi Ogawa2-103/+74
Previously, fatfs was using NLS_DEFAULT if users didn't specify the codepage or iocharset option. This became cause of trouble (filename access). This patch removes the complicated default config in kernel. Instead of it, by default, fatfs uses builtin nls ("default"), also reports it and mounts as read-only. This default will limit the access more or less. Note: If peoples want to write on this default, it still can switch by remount. Therefore, basically users will need to specify mount options always. ("codepage" for msdos, and "codepage" and "iocharset" for vfat) However, it can be done simply by script or shell alias or something else in userland. Thanks to Andries Brouwer for your many advice. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-01[PATCH] nsf4 oops fixesSteve Dickson1-5/+6
Here are some oops I found in error paths in the mounting pathes while debugging something else... I sent it out a while ago, but it didn't seem to get any traction.... The nfs_fill_super() fix is obvious and in nfs4_fill_super(), the server->client ptr needs to be set before the cl_idmap check, since rpc_shutdown_client() needs it when the check fails. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-01[PATCH] Canonically reference files in Documentation/ code comments partAdrian Bunk1-1/+1
Below is a patch by Hans Ulrich Niedermann <linux-kernel@n-dimensional.de> to change all references in comments to files in Documentation/ to start with Documentation/ Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-31[CIFS] Update readme and todo lists for cifs vfsSteve French2-30/+51
Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-30Merge bk://linux.bkbits.net/linux-2.5Steve French1-1/+1
into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
2004-07-30[CIFS] remove sparse pointer warningSteve French1-1/+1
Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-30[PATCH] sparse: misc cleanupsAlexander Viro1-2/+2
all sorts of minor stuff - basically, all chunks are independent here, but IMO that one is not worth splitting. Contains: * pmac_cpufreq.c: declaration in the middle of a block. * sys_ia32.c: couple of trivial annotations. * ipmi_si_intf.c: should be using asm/irq.h instead of linux/irq.h * synclink_cs.c: assignment-in-conditional with nobody ever looking at the variable we are assigning to afterwards; variable removed. * sbni.c: s/__volatile/__volatile__ * matroxfb_base.h: got rid of ((u32 *)p)++ * asm-ppc/checksum.h and asm-sparc64/floppy.h: NULL noise removal * amd64 compat.h: missing L in long constant. * mtd-abi.h: annotated ioctl structure * sysctl.c: corrected annotations in extern Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-29Merge bk://cifs.bkbits.net/linux-2.5cifsLinus Torvalds16-80/+733
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2004-07-29[PATCH] cmap annotationsAlexander Viro1-1/+1
fb_set_cmap() and fb_copy_cmap() split into kernel and userland versions. fb_cmap, fb_image and fb_cursor split and annotated. fixed bug in sbuslib.c that used to call "userland" version of fb_set_cmap() when kernel one was need (RGB data was already copied into kernel space). Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-29[CIFS] fix smb return codeSteve French1-1/+2
Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-28Merge bk://linux.bkbits.net/linux-2.5Steve French15-79/+731
into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
2004-07-28[CIFS] Resize cifs request buffer mempools as tcp sessions are added to ↵Steve French3-3/+26
avoid potential deadlocks. Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-28[PATCH] writepages drops bh on not uptodate pageAndrea Arcangeli1-1/+6
I think I understood why some ext2 fs corruption still happens even after the last i_size fix. what happened I believe is that the writepages layer got a not a fully uptodate page (in turn with bh mapped on top of it), and then right before unlocking the page and entering the writeback mode, it freed all the bh. Without bh a not uptodate page will trigger a full readpage from disk, that overwrites the pagecache before the multi-bio gets submitted, generating fs corruption. I believe the below patch should fix it (untested) against kernel CVS. The testcases developed by Kurt showed the pagecache being overwritten with on-disk data at block offsets, and Chris as well was wondering about races between wait_on_page_writeback and readpage. the below fix just explains everything we've seen since not-fully-uptodate pages must have always bh on them and the below patch enforces just that invariant, and it should fix our pagecache-overwritten-by-disk-data problem. Signed-off-by: Andrea Arcangeli <andrea@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-28[PATCH] lost error code in rescan_partitionsMartin Pool1-2/+2
This fixes a path where an error from reloading the partition table could be lost. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-28[PATCH] ncpfs: setattr return value fixAndrew Morton1-1/+1
Arjan's new warning found a bug! fs/ncpfs/inode.c: In function `ncp_notify_change': fs/ncpfs/inode.c:960: warning: ignoring return value of `inode_setattr', declared with attribute warn_unused_result Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-28[PATCH] ext2_readdir() return value fixJan Blunck1-4/+6
ext2_readdir() is ignoring the set error return values and always returns 0. Signed-off-by: Jan Blunck <j.blunck@tu-harburg.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-28[PATCH] hugetlbfs vm_pgoff bugsOleg Nesterov1-3/+6
1. hugetlbfs_file_mmap() must check that vm_pgoff is hugepage aligned. 2. hugetlb_vmtruncate_list() confuses << with >> while converting vm_pgoff to huge page offset, and zaps wrong area. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-28[PATCH] BIO page refcounting fixJens Axboe1-1/+0
Hopefully fixes the free-of-a-freed-page BUG caused during CDRW writing. This also fixes a problem in the bouncing for io errors (it needs to free the pages and clear the BIO_UPTODATE flag, not set it. it's already set. passing -EIO to bio_endio() takes care of that). Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-28[CIFS] xattr support for cifs filesystem part 5 of 5, add removexattr capabilitySteve French4-2/+66
Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-26Merge bk://linux.bkbits.net/linux-2.5Steve French13-75/+640
into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
2004-07-26[CIFS] xattr support part 4 add set EA supportSteve French4-12/+140
Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-26[PATCH] more NULL noise removal in fs/*Alexander Viro2-7/+7
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-26[PATCH] openpromfs annotationAlexander Viro1-10/+10
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-26[PATCH] size_t portability fixesAlexander Viro5-5/+5
A lot of places assumed that size_t == unsigned; on 64bit boxen that is not true. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-26[CIFS] xattr support part 3 add query EA support to retrieve individual ↵Steve French3-6/+255
xattr values Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-24Merge bk://linux.bkbits.net/linux-2.5Steve French1-2/+2
into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
2004-07-24ppc64: fix more 0/NULL confusionLinus Torvalds1-2/+2
2004-07-23Merge bk://linux.bkbits.net/linux-2.5Steve French2-16/+17
into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
2004-07-23[CIFS] xattr suport part 2: add listxattr supportSteve French4-13/+154
Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-23Merge shinybook.infradead.org:/home/dwmw2/bk/linus-2.5David Woodhouse1-12/+8
into shinybook.infradead.org:/home/dwmw2/bk/mtd-2.6
2004-07-22[PATCH] NX: allow architectures to select legacy mode dynamicallyDavid Mosberger1-5/+4
On some platforms, you'll want to support READ_IMPLIES_EXEC differently depending on personality (e.g, native binary vs. x86 binary). This supports that (and makes the code more readable while at it) by replacing the old architecture-specific fixed LEGACY_BINARIES macro define with a architecture-specific "elf_read_implies_exec_binary()" helper function. For now, x86 is the only user, and sets the "read implies exec" bit for legacy apps. ia64 and x86-64 are likely to want to do their own thing. Acked by Ingo. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-22[PATCH] Missing mnt_namespace update in copy_namespace()Alexander Viro1-11/+13
copy_namespace() forgets to switch the new 'mnt_namespace' field in the vfsmounts of the new namespace.
2004-07-20NAND support in JFFS2 isn't experimental any more.David Woodhouse1-13/+8
2004-07-20Fix JFFS2_COMPRESSION_OPTIONS in KconfigLuca Tettamanti1-0/+1
Hi, It seems to me that JFFS2_COMPRESSION_OPTIONS depends on JFFS2_FS: Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2004-07-18[CIFS] remove unneeded, unused prototypes. Suggested by Carl SpallettaSteve French3-31/+0
Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-18Merge bk://linux.bkbits.net/linux-2.5Steve French7-18/+96
into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
2004-07-18CIFS: Add missing mount option for optionally cifs perm checks when uids on ↵Steve French7-18/+96
server and client do not match and for optionally overriding server setting default uid/gid of new cifs files and directories. Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-17[PATCH] NX: clean up legacy binary supportIngo Molnar2-3/+9
This cleans up legacy x86 binary support by introducing a new personality bit: READ_IMPLIES_EXEC, and implements Linus' suggestion to add the PROT_EXEC bit on the two affected syscall entry places, sys_mprotect() and sys_mmap(). If this bit is set then PROT_READ will also add the PROT_EXEC bit - as expected by legacy x86 binaries. The ELF loader will automatically set this bit when it encounters a legacy binary. This approach avoids the problems the previous ->def_flags solution caused. In particular this patch fixes the PROT_NONE problem in a cleaner way (http://lkml.org/lkml/2004/7/12/227), and it should fix the ia64 PROT_EXEC problem reported by David Mosberger. Also, mprotect(PROT_READ) done by legacy binaries will do the right thing as well. the details: - the personality bit is added to the personality mask upon exec(), within the ELF loader, but is not cleared (see the exceptions below). This means that if an environment that already has the bit exec()s a new-style binary it will still get the old behavior. - one exception are setuid/setgid binaries: these will reset the bit - thus local attackers cannot manually set the bit and circumvent NX protection. Legacy setuid binaries will still get the bit through the ELF loader. This gives us maximum flexibility in shaping compatibility environments. - selinux also clears the bit when switching SIDs via exec(). - x86 is the only arch making use of READ_IMPLIES_EXEC currently. Other arches will have the pre-NX-patch protection setup they always had. I have booted an old distro [RH 7.2] and two new PT_GNU_STACK distros [SuSE 9.2 and FC2] on an NX-capable CPU - they work just fine and all the mapping details are right. I've checked the PROT_NONE test-utility as well and it works as expected. I have checked various setuid scenarios as well involving legacy and new-style binaries. an improved setarch utility can be used to set the personality bit manually: http://redhat.com/~mingo/nx-patches/setarch-1.4-3.tar.gz the new '-X' flag does it, e.g.: ./setarch -X linux /bin/cat /proc/self/maps will trigger the old protection layout even on a new distro. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-16[PATCH] fix inode state incoherencyMiklos Szeredi1-1/+2
This patch fixes a hard-to-trigger condition, where the inode is on the inode_in_use list while it's state is dirty. In this state dirty pages are not written back in sync() or from kupdate, only from direct page reclaim. And this causes a livelock in balance_dirty_pages after a while. The actual sequence of events required to get into this state is: thread function inode state inode list ---------------------------------------------------------------------------- 1 __sync_single_inode (background) I_DIRTY sb->s_io 1 do_writepages ... I_LOCKED 2 __writeback_single_inode (sync) sleeps I_LOCKED 1 __sync_single_inode (background) finish 0 inode_in_use 2 __writeback_single_inode (sync) wakeup 0 2 __sync_single_inode (sync) 0 2 do_writepages ... I_LOCKED 3 __mark_inode_dirty I_LOCKED | I_DIRTY 2 __sync_single_inode (sync) finish I_DIRTY left on inode_in_use Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-15[PATCH] pointer-to-number cast in binfmt_elf.c done rightAlexander Viro1-1/+1
2004-07-15[PATCH] more annotations in binfmt_aout.cAlexander Viro1-3/+5
2004-07-15[PATCH] hfs and hfsplus switched to use of ffs(3) instead of homegrown versionsAlexander Viro2-9/+4
2004-07-15[PATCH] sparse: iovec cleanups - sunrpc, nfs and nfsdAlexander Viro7-23/+23
sunrpc, nfs and nfsd switched to use of kvec and kernel_...msg()
2004-07-15[PATCH] sparse: iovec cleanups - cifsAlexander Viro2-26/+19
cifs switched to kvec and kernel_...msg()
2004-07-15[PATCH] sparse: iovec cleanups - ncpfsAlexander Viro1-129/+89
ncpfs switched to kvec and kernel_...msg()
2004-07-15[PATCH] sparse: iovec cleanups - smbfsAlexander Viro2-74/+33
smbfs switched to kvec and kernel_...msg()
2004-07-16Remove /proc/fs/jffs2 support.David Woodhouse5-247/+3
It wants reimplementing sanely, preferably in sysfs instead.
2004-07-15JFFS2 file system updateDavid Woodhouse28-895/+2015
- Improved support for NAND flash - More generic compression support, allowing for extra compressors - Fix potential deadlock with kupdated
2004-07-13Merge bk://linux.bkbits.net/linux-2.5Dave Kleikamp9-22/+141
into hostme.bitkeeper.com:/repos/j/jfs/linux-2.5
2004-07-13[PATCH] sparse: read_descriptor_t annotationAlexander Viro3-4/+4
We have a fun situation with read_descriptor_t - all its instances end up passed to some actor; these actors use desc->buf as their private data; there are 5 of them and they expect resp: struct lo_read_data * struct svc_rqst * struct file * struct rpc_xprt * char __user * IOW, there is no type safety whatsoever; the field is essentially untyped, we rely on the fact that actor is chosen by the same code that sets ->buf and expect it to put something of the right type there. Right now desc->buf is declared as char __user *. Moreover, the last argument of ->sendfile() (what should be stored in ->buf) is void __user *, even though it's actually _never_ a userland pointer. If nothing else, ->sendfile() should take void * instead; that alone removes a bunch of bogus warnings. I went further and replaced desc->buf with a union of void * and char __user *.
2004-07-13[PATCH] autoselect FAT_FS in configHirofumi Ogawa1-3/+3
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-13[PATCH] remove struct_cpy()Andrew Morton2-3/+3
Only two architectures implement it, so afs broke the build. Remove struct_cpy() altogether, and use structure assignments. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-13[PATCH] small style fixups for the new automount codeChristoph Hellwig1-9/+4
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-12[PATCH] compat_fillonedir() warning fixAlexander Viro1-1/+1
access_ok() expects a pointer, not unsigned long. It's not a problem on platforms that have this guy done as a macro (or ones that do not use fs/compat.c at all), but that's still wrong and on some platforms that care we actually have access_ok() as inlined function. Bogus cast removed.
2004-07-12[PATCH] __vfs_follow_link() made inline againAlexander Viro1-55/+55
__vfs_follow_link() really should be inline; that's a special case since we are in the middle of recursion and really want to conserve stack space. Moved before the first use, made inline again.
2004-07-12[PATCH] sparse: more fs/* NULL noise removalAlexander Viro5-27/+28
(partially based on patch from Mika Kukkonen)
2004-07-12[PATCH] sparse: usb ioctl cleanupsAlexander Viro1-91/+18
usb ioctls in compat_ioctl.c switched to compat_alloc_user_space() and cleaned up; ioctl structures annotated.
2004-07-12[PATCH] sparse: VIDIOCSWIN compat_ioctl fixesAlexander Viro1-69/+61
In handling of VIDIOCSWIN for 32bit on 64bit platforms: * switched to compat_alloc_user_space() * fixed memory corruption in copying arguments from userland * fixed arithmetic overflows * added missing checks for get_user() results and corresponding returns with -EFAULT.
2004-07-12[PATCH] sparse: switching afs to kvecAlexander Viro3-11/+11
- afs and rxrpc switched to kvec; definition of kvec moved to uio.h (duh). - afs/mntpt.c got missing cast added. at that point afs is sparse-clean and rxrpc has only one remaining warning (setsockopt from local variable, protected by set_fs()).
2004-07-12Set DevMajor/DevMinor when querying info on remote char/block devicesSteve French3-1/+10
Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-12Set Type field when creating block/char/pipe e.g. via mknod. Steve French5-7/+29
Fixing problem mentioned by Jeremy Allison remove spurious warning message logged on mount with credentials file (pointed out by Richard Hughes) Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-12fix the null pointer sparse warning al viros way (resolving potential merge ↵Steve French25-85/+85
conflict) Signed-off-by: Steve French (sfrench@us.ibm.com)
2004-07-12Merge bk://linux.bkbits.net/linux-2.5Steve French26-86/+86
into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
2004-07-12JFS: Add d_hash and d_compare operations for case-insensitive namesDave Kleikamp2-2/+60
JFS supports OS/2-compatibility with case-insensitive file names. To avoid multiple dentries for these names, jfs needs to provide the d_hash and d_compare dentry_operations. The operations are only used when the volume was created in OS/2 or with the -O flag.
2004-07-11[PATCH] sparse: misc NULL noise in fs/*Alexander Viro13-18/+18
2004-07-11[PATCH] sparse: NULL noise in fs/reiserfsAlexander Viro13-68/+68
2004-07-11Merge bk://linux.bkbits.net/linux-2.5Dave Kleikamp8-20/+81
into hostme.bitkeeper.com:/repos/j/jfs/linux-2.5
2004-07-11clean up NULL vs. 0 warnings generated by sparse toolSteve French7-27/+27
2004-07-10Merge bk://linux.bkbits.net/linux-2.5Steve French34-292/+458
into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
2004-07-10[PATCH] sparse: NULL noise in jfsAlexander Viro10-56/+56
2004-07-10[PATCH] sparse: NULL noise in jffsAlexander Viro3-70/+70
2004-07-10[PATCH] sparse: removal of iovec use in mtdAlexander Viro5-12/+13
mtd, jffs and jffs2 switched from iovec to kvec
2004-07-10[PATCH] remove outdated ext2 help text partsAdrian Bunk1-37/+4
The patch below solves Bugzilla #3014 by removing much outdated information from the ext2 help text. The help text is now very short, but few correct information is better than outdated information - and if you think it's too short, feel free to send a patch that adds more current information. Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] fix (UDF_FS=y && NLS=m) compile errorAdrian Bunk2-4/+9
The patch below fixes Bugzilla #3030 ((UDF_FS=y && NLS=m) results in a compile error). Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] mpage_writepages() i_size reading fixAndrea Arcangeli1-5/+13
I believe reading the i_size from memory multiple times can generate fs corruption. The "offset" and the "end_index" were not coherent. this is writepages and it runs w/o the i_sem, so the i_size can change from under us anytime. If a parallel write happens while writepages run, the i_size could advance from 4095 to 4100. With the current 2.6 code that could translate in end_index = 0 and offset = 4. That's broken because end_index and offset could be not coherent. Either end_index=1 and offset =4, or end_index = 0 and offset = 4095. When they lose coherency the memset can zeroout actual data. The below patch fixes that (it's at least a theoretical bug). I don't really expect this tiny race to fix the bug in practice after the more serious bugs we covered yesterday didn't fix it (more likely the compiler will get involved into the equation soon ;). This is also an optimization for 32bit archs that needs special locking to read 64bit i_size coherenty. This patch also arranges for mpage_writepages() to always zero out the file's final page between i_size and the end of the file's final block. This is a best-effort correctness thing to deal with errant applications which write into the mmapped page beyond the underlying file's EOF. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] __block_write_full_page() comment fixupsAndrea Arcangeli1-14/+17
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] writepage fs corruption fixAndrea Arcangeli1-6/+11
Fix a data loss bug in mpage_writepages(), triggerable under extreme memory pressure on ext2, JFS, hfs and hfsplus: The bug is the marking of the bh clean despite we could still run into the "confused" path. After that the confused path really becomes confused and it writes nothing and fs corruption triggers silenty (the reugular writepage only writes bh that are marked dirty, it never attempts to submit_bh anything marked clean). The mpage-writepage code must never mark the bh clean as far as it wants to still fallback in the regular writepage which depends on the bh to be dirty (i.e. the "goto confused" path). This could only triggers with memory pressure (it also needs buffer_heads_over_limit == 0, and that is frequent under mm pressure). Thanks a lot to Chris for his fine debugging that localized the problem in the writepage code. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] Correct return type of hashfn() in fs/dquot.cMika Kukkonen1-2/+5
CC fs/dquot.o fs/dquot.c:208: warning: type qualifiers ignored on function return type Once again with extra gcc warnings enabled. Every user of the function is expecting unsigned value, not int in first place, and I think the const is just misplaced. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] smbfs compilation warning fixRandy Dunlap1-1/+1
Use %Zd to eliminate a compiler warning in printk. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] int return to unsigned in smb_proc_readdir_long() in fs/smbfs/proc.cMika Kukkonen1-8/+4
CC [M] fs/smbfs/proc.o fs/smbfs/proc.c: In function `smb_proc_readdir_long': fs/smbfs/proc.c:2313: warning: comparison of unsigned expression < 0 is always false fs/smbfs/proc.c:2467: warning: comparison of unsigned expression < 0 is always false The first one is pretty dangerous looking, as smb_proc_readdir_long() can return several negative error values and all those are converted to unsigned and then erronously pass the test on line 2313. Chris Wright gave it a quick look and we did not see immediately if this can be remotely exploited, but it looks pretty scary. The second warning on line 2467 is just extra so I just removed it. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] Use llseek instead of f_pos= for directory seekingNeil Brown2-10/+10
nfsd currently just sets f_pos when seeking in a directory. This bypasses any checking and other handling that a filesystem might want to do. So instead, we define "vfs_llseek" to be an exported "llseek", and use that, both to seek at the start, and the find the new position at the end. Thanks to "Derrick Schommer" <dschommer@acopia.com> "Trond Myklebust" <trond.myklebust@fys.uio.no> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] kAFS automount supportDavid Howells4-18/+2
Here's a patch to allow the kAFS filesystem to use the automount facility patch presented in a previous email. It allows me to mount an AFS root volume on /afs and then just walk through the directory structure causing referenced volumes to be automounted and autoumounted. For instance, if I do: [root@andromeda root]# mount -t afs \#root.afs. /afs [root@andromeda root]# ls /afs asd cambridge cambridge.redhat.com grand.central.org [root@andromeda root]# ls /afs/cambridge afsdoc [root@andromeda root]# ls /afs/cambridge/afsdoc/ ChangeLog html LICENSE pdf RELNOTES-1.2.2 And then look in the mountpoint catalogue, I see: [root@andromeda root]# cat /proc/mounts ... #root.afs. /afs afs rw 0 0 #root.cell. /afs/cambridge.redhat.com afs rw 0 0 #afsdoc. /afs/cambridge.redhat.com/afsdoc afs rw 0 0 Then after waiting a few minutes: [root@andromeda root]# cat /proc/mounts ... #root.afs. /afs afs rw 0 0 Is all that remains. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] intrinsic automount and mountpoint degradation supportDavid Howells3-19/+209
Here's a patch that I worked out with Al Viro that adds support for a filesystem (such as kAFS) to perform automounting intrinsically without the need for a userspace daemon. It also adds support for such mountpoints to be degraded at the filesystem's behest until they've been untouched long enough that they'll be removed. I've a patch (to follow) that removes some #ifdef's from fs/afs/* thus allowing it to make use of this facility. There are five pieces to this: (1) Any interested filesystem needs to have at least one list to which expirable mountpoints can be added. Access to this list is governed by the vfsmount_lock. (2) When a filesystem wants to create an expirable mount, it calls do_kern_mount() to get a handle on the filesystem it wants mounting, and then calls do_add_mount() to mount that filesystem on the designated mountpoint, supplying the list mentioned in (1) to which the vfsmount will be added. In kAFS's case, the mountpoint is a directory with a follow_link() method defined (fs/afs/mntpt.c). This uses the struct nameidata supplied as an argument as a determination of where the new filesystem should be mounted. (3) When something using a vfsmount finishes dealing with it, it calls mntput(). This unmarks the vfsmount for immediate expiry. There are two criteria for determining if a vfsmount may be expired - it mustn't be marked as in use for anything other than being a child of another vfsmount, and it must have an expiry mark against it already. (4) The filesystem then determines the policy on expiring the mounts created in (2). When it feels the need to, it passes the list mentioned in (1) to mark_mounts_for_expiry() to request everything on the list be expired. This function examines each mount listed. If the vfsmount meets the criteria mentioned in (3), then the vfsmount is deleted from the namespace and disposed of as for unmounting; otherwise the vfsmount is left untouched apart from now bearing an expiration mark if it didn't before. kAFS's expiration policy is simply to invoke this process at regular intervals for all the mounts on its list. (5) An expiration facility is also provided to userspace: by calling umount() with a MNT_EXPIRE flag, it can make a request to unmount only if the mountpoint hasn't been used since the last request and isn't in use now. This allows expiration to be driven by userspace instead of by the kernel if that is desirable. This also means that do_umount() has to use a different version of path_release() to everyone else... it can't call mntput() as that clears the expiration flag, thus rendering this unachievable; so it's version of path_release() calls _mntput(), which doesn't do the clear. My original idea was to give the kernel more knowledge of automounted things. This avoids a certain problem with stat() on a mountpoint causing it to mount (for example, do "ls -l /afs" on a machine with kAFS), but Al wanted it done this way. > Why is autofs unsuitable? Because: (1) Autofs is flat; AFS requires a tree - mounts on mounts on mounts on mounts... (2) AFS holds the data as to what the mountpoints are and where they go, and these may be cross-links to subtrees beyond your control. It's also not trivial to extract a list of mountpoints as is required for autofs. (3) Autofs is not namespace safe. (4) Ducking back to userspace to get that to do the mount is pretty tricky if namespaces are involved. In fact, autofs may well want to make use of this facility. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-10[PATCH] quota: inode->i_flags locking fixesJan Kara2-30/+34
The patch fixes locking of i_flags. It removes S_QUOTA flag from i_flags because it was almost unused and updating it on some places correctly (under i_sem) would be tricky. Note that accessing of S_NOQUOTA flag is serialized by dqptr_sem and so we can reliably tested without i_sem. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-08JFS: jfs_dmap build fixDave Kleikamp1-1/+2
fs/jfs/jfs_dmap.c: In function `dbAllocNear': fs/jfs/jfs_dmap.c:1343: parse error before `*' fs/jfs/jfs_dmap.c:1357: `leaf' undeclared (first use in this function) fs/jfs/jfs_dmap.c:1357: (Each undeclared identifier is reported only once fs/jfs/jfs_dmap.c:1357: for each function it appears in.) Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
2004-07-07Merge jfs@jfs.bkbits.net:linux-2.5Dave Kleikamp8-19/+79
into austin.ibm.com:/shaggy/bk/jfs-2.5
2004-07-07JFS: Check for dmap corruption before using leafidxDave Kleikamp1-0/+34
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
2004-07-07JFS: prevent concurrent calls to txCommit on the imap inodeDave Kleikamp1-0/+6
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
2004-07-07JFS: Protect active_ag with a spinlockDave Kleikamp4-0/+11
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
2004-07-06fix oops in build_wildcard_path_from_dentrySteve French3-11/+50
2004-07-06[PATCH] Fix memory leak in epollJerzy Szczepkowski1-1/+1
There was a memory leak in epoll. The reference count (d_count) of the struct dentry of a new epoll-fd was set to TWO. (new_inode() assigned ONE, than ep_getfd() incremented it by dget()). There was only ONE reference to this dentry, so struct dentry and struct inode were never freed. Signed-off-by: Davide Libenzi <davidel@xmailserver.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-06[PATCH] sparse: fix remaining three non-ANSI warningsMika Kukkonen1-1/+1
CHECK fs/smbfs/smbiod.c fs/smbfs/smbiod.c:68:25: warning: non-ANSI parameter list CHECK drivers/isdn/tpam/tpam_crcpc.c drivers/isdn/tpam/tpam_crcpc.c:57:15: warning: non-ANSI parameter list CHECK drivers/scsi/aic7xxx/aic79xx_reg_print.c drivers/scsi/aic7xxx/aic79xx_osm.h:791:19: warning: non-ANSI parameter list Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-05JFS: Updated field isn't always written to disk during truncateDave Kleikamp1-1/+11
There is a possibility that a change to header.next is not logged or written to disk if it is the only change to an xtree leaf page. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
2004-07-05Merge jfs@jfs.bkbits.net:linux-2.5Dave Kleikamp2-18/+17
into austin.ibm.com:/shaggy/bk/jfs-2.5
2004-07-05Merge http://linux-mh.bkbits.net/bluetooth-2.6David S. Miller1-0/+5
into nuts.davemloft.net:/disk1/BK/net-2.6
2004-07-04[PATCH] __bdevname leak fixChristoph Hellwig1-15/+4
The __bdevname library function is leaking module references due to __bdevname ->get_gendisk ->kobj_lookup ->ata_probe ->get_disk ->try_module_get What we're trying to do in there is too ambitious. Change it to just print the major and minor. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-04[PATCH] gcc 3.5 fixesAnton Blanchard1-2/+0
gcc 3.5 is warning about static vs non static function declarations. The following patch removes function prototypes in .h files where possible and changes prototypes to be static elsewhere. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-04[PATCH] Fix sparse warnings in fs/udf/*Mika Kukkonen2-15/+17
CHECK fs/udf/dir.c fs/udf/dir.c:240:13: warning: expected lvalue for member dereference [...] CHECK fs/udf/namei.c fs/udf/namei.c:872:6: warning: expected lvalue for member dereference fs/udf/namei.c:916:6: warning: expected lvalue for member dereference fs/udf/namei.c:1189:14: warning: expected lvalue for member dereference fs/udf/namei.c:1234:7: warning: expected lvalue for member dereference Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-04[Bluetooth] Add HID protocol supportMarcel Holtmann1-0/+5
This patch adds support for the Bluetooth HID protocol to the Bluetooth subsystem. Currently only the boot mode is supported. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2004-07-02[PATCH] err2-29: ufs_new_fragments() locking fixAndrew Morton1-0/+1
Found by the Stanford locking checker Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-02[PATCH] err1-40: sysvfs locking fixAndrew Morton1-3/+5
Found by the new Stanford locking checker. Minimal fix for a deadlock in sysvfs: get_branch() can take read_lock(&pointers_lock), but one caller already has a write_lock. Perhaps some of the "oh we raced, drop everything and try again" logic in there can go away now, but this is enugh to fix the obvious deadlock. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-02[PATCH] Fix minor quota raceJan Kara2-6/+9
It fixes a possible race between quotaoff and prune_icache. The race could lead to some forgotten pointers to quotas in inodes leading later to BUG when invalidating quota structures. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-02[PATCH] ntfs build fixAndrew Morton1-1/+1
gcc-2.95 chokes on this. Cc: Anton Altaparmakov <aia21@cantab.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-02[PATCH] chown permission check fix for ATTR_GIDChris Wright1-1/+2
SuSE discovered this problem with chown and ATTR_GID. Make sure user is authorized to change the group, CAN-2004-0497.
2004-07-02[PATCH] fat/inode.cAndries E. Brouwer1-12/+6
Two years ago, OGAWA Hirofumi removed some ugly code and added a few simple tests to the FAT filesystem code, intended to avoid recognizing non-FAT as FAT (for people who fail to specify rootfstype=, forcing the kernel to guess). That worked fairly well, until this year. I have now seen a thread in Czech and a report from Holland that involved the "FAT: bogus sectors-per-track value" error message. The patch below removes this test again. The advantage is that some real-life FAT filesystems can be mounted again. The disadvantage that more non-FAT fss will be accepted as FAT. Ferry van Steen <freaky@bananateam.nl> reports "the patch Andries Brouwer gave me seems to work". Signed-off-by: Andries Brouwer <aeb@cwi.nl> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-02Merge bk://linux-ntfs.bkbits.net/ntfs-2.6Linus Torvalds2-8/+16
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2004-07-02NTFS: 2.1.15 - Implement fs/ntfs/aops.c::ntfs_write_mst_block() whichAnton Altaparmakov3-20/+202
enables the writing of page cache pages belonging to mst protected attributes like the index allocation attribute in directory indices and other indices like $Quota/$Q, etc. This means that the quota is now marked out of date on all volumes rather than only on ones where the quota defaults entry is in the index root attribute of the $Quota/$Q index. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2004-07-02NTFS: Update __ntfs_index_entry_mark_dirty() so it makes sure that theAnton Altaparmakov1-20/+15
page has buffers. Otherwise we could end up with a dirty page without buffers and our set_page_dirty() would not mark the buffers dirty when they are created and thus they would not be written out and the dirty records would be lost. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2004-07-02[PATCH] check attr updates in /procChris Wright1-7/+14
Any proc entry with default proc_file_inode_operations allow unauthorized attribute updates. This is very dangerous for proc entries that rely solely on file permissions for open/read/write. Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-02NTFS: Add fs/ntfs/index.c::__ntfs_index_entry_mark_dirty() which sets allAnton Altaparmakov3-17/+76
buffers that are inside the ntfs record in the page dirty after which it sets the page dirty. This allows ->writepage to only write the dirty index records rather than having to write all the records in the page. Modify fs/ntfs/index.h::ntfs_index_entry_mark_dirty() to use this rather than __set_page_dirty_nobuffers(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2004-07-02NTFS: Add a set_page_dirty address space operation for ntfs_m[fs]t_aops.Anton Altaparmakov3-1/+11
It is simply set to __set_page_dirty_nobuffers() to make sure that running set_page_dirty() on a page containing mft/ntfs records will not affect the dirty state of the page buffers. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2004-07-01[PATCH] [err1-10] journal_extend() locking fixAndrew Morton1-1/+2
From the new Stanford locking checker Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-01Merge cantab.net:/home/src/ntfs-2.6Anton Altaparmakov44-192/+188
into cantab.net:/home/src/ntfs-2.6-devel
2004-07-01Merge cantab.net:/home/src/bklinux-2.6Anton Altaparmakov19-59/+63
into cantab.net:/home/src/ntfs-2.6
2004-06-30Merge http://xfs.org:8090/xfs-linux-2.6Linus Torvalds1-1/+5
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2004-07-02[XFS] Don't dereference buffer after pagebuf_iostrategy()Christoph Hellwig1-1/+5
SGI Modid: xfs-linux:xfs-kern:174326a Signed-off-by: Nathan Scott <nathans@sgi.com>