summaryrefslogtreecommitdiffstats
path: root/fs/ntfs
Commit message (Collapse)AuthorAgeFilesLines
* [PATCH] gfp flags annotations - part 1Al Viro2005-10-081-1/+1
| | | | | | | | | | | | - added typedef unsigned int __nocast gfp_t; - replaced __nocast uses for gfp flags with gfp_t - it gives exactly the same warnings as far as sparse is concerned, doesn't change generated code (from gcc point of view we replaced unsigned int with typedef) and documents what's going on far better. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* NTFS: Fix a 64-bitness bug where a left-shift could overflow a 32-bit variableAnton Altaparmakov2005-10-043-3/+4
| | | | | | which we now cast to 64-bit first (fs/ntfs/mft.c::map_mft_record_page(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix a stupid bug in __ntfs_bitmap_set_bits_in_run() which caused theAnton Altaparmakov2005-10-042-2/+6
| | | | | | | count to become negative and hence we had a wild memset() scribbling all over the system's ram. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Re-fix sparse warnings in a more correct way, i.e. don't use an enum withAnton Altaparmakov2005-09-261-8/+5
| | | | | | different types in it but #define the two constants instead. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: More $LogFile handling fixes: when chkdsk has been run, it can leave theAnton Altaparmakov2005-09-263-15/+35
| | | | | | | | restart pages in the journal without multi sector transfer protection fixups (i.e. the update sequence array is empty and in fact does not exist). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix the definition of the CHKD ntfs record magic. It had an off byAnton Altaparmakov2005-09-261-1/+1
| | | | | | two error causing it to be CHKB instead of CHKD. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Change ntfs_cluster_free() to require a write locked runlist on entryAnton Altaparmakov2005-09-235-34/+32
| | | | | | | | since we otherwise get into a lock reversal deadlock if a read locked runlist is passed in. In the process also change it to take an ntfs inode instead of a vfs inode as parameter. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix sparse warnings that have crept in over time.Anton Altaparmakov2005-09-223-4/+9
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: More runlist handling fixes from Richard Russon and myself.Anton Altaparmakov2005-09-201-22/+33
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix ntfs_{read,write}page() to cope with concurrent truncates better.Anton Altaparmakov2005-09-193-41/+80
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix handling of compressed directories that I broke in earlier changeset.Anton Altaparmakov2005-09-191-4/+8
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix various bugs in the runlist merging code. (Based on libntfsAnton Altaparmakov2005-09-192-64/+70
| | | | | | changes by Richard Russon.) Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Mask out __GFP_HIGHMEM when doing kmalloc() in __ntfs_malloc() as itAnton Altaparmakov2005-09-122-4/+1
| | | | | | otherwise causes a BUG(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Change the mount options {u,f,d}mask to always parse the number asAnton Altaparmakov2005-09-122-4/+16
| | | | | | | | an octal number to conform to how chmod(1) works, too. Thanks to Giuseppe Bilotta and Horst von Brand for pointing out the errors of my ways. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* [PATCH] ntfs build fixAndrew Morton2005-09-101-0/+1
| | | | | | | | | *** Warning: "bit_spin_lock" [fs/ntfs/ntfs.ko] undefined! *** Warning: "bit_spin_unlock" [fs/ntfs/ntfs.ko] undefined! Cc: Anton Altaparmakov <aia21@cantab.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* NTFS: 2.1.24 release and some minor final fixes.Anton Altaparmakov2005-09-084-9/+9
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Improve scalability by changing the driver global spin lock inAnton Altaparmakov2005-09-082-6/+12
| | | | | | | fs/ntfs/aops.c::ntfs_end_buffer_async_read() to a bit spin lock in the first buffer head of a page. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix page_has_buffers()/page_buffers() handling in fs/ntfs/aops.c.Anton Altaparmakov2005-09-082-17/+22
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fixup handling of sparse, compressed, and encrypted attributes inAnton Altaparmakov2005-09-082-20/+26
| | | | | | fs/ntfs/aops.c::ntfs_readpage(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix fs/ntfs/aops.c::ntfs_{read,write}_block() to handle the caseAnton Altaparmakov2005-09-082-11/+42
| | | | | | where a concurrent truncate has truncated the runlist under our feet. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Optimize fs/ntfs/aops.c::ntfs_write_block() by extending the pageAnton Altaparmakov2005-09-082-10/+6
| | | | | | | lock protection over the buffer submission for i/o which allows the removal of the get_bh()/put_bh() pairs for each buffer. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fixup handling of sparse, compressed, and encrypted attributes inAnton Altaparmakov2005-09-082-57/+49
| | | | | | fs/ntfs/aops.c::ntfs_writepage(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Make ntfs_write_block() not instantiate sparse blocks if they are zero.Anton Altaparmakov2005-09-082-0/+23
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fixup handling of sparse, compressed, and encrypted attributes inAnton Altaparmakov2005-09-082-101/+116
| | | | | | fs/ntfs/inode.c::ntfs_read_locked_{,attr_,index_}inode(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Truncate {a,c,m}time to the ntfs supported time granularity whenAnton Altaparmakov2005-09-082-5/+9
| | | | | | updating the times in the inode in ntfs_setattr(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix cluster (de)allocators to work when the runlist is NULL and moreAnton Altaparmakov2005-09-084-33/+32
| | | | | | | importantly to take a locked runlist rather than them locking it which leads to lock reversal. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix handling of sparse attributes in ntfs_attr_make_non_resident().Anton Altaparmakov2005-09-082-17/+40
| | | | | | | | Also, add BUG() checks to ntfs_attr_make_non_resident() and ntfs_attr_set() to ensure that these functions are never called for compressed or encrypted attributes. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix several bugs in fs/ntfs/attrib.c.Anton Altaparmakov2005-09-082-1/+37
| | | | | | | | | | | - Fix a bug in ntfs_map_runlist_nolock() where we forgot to protect access to the allocated size in the ntfs inode with the size lock. - Fix ntfs_attr_vcn_to_lcn_nolock() and ntfs_attr_find_vcn_nolock() to return LCN_ENOENT when there is no runlist and the allocated size is zero. - Fix load_attribute_list() to handle the case of a NULL runlist. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Add fs/ntfs/attrib.[hc]::ntfs_resident_attr_value_resize().Anton Altaparmakov2005-09-083-0/+43
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Remove bogus setting of PageError in ntfs_read_compressed_block().Anton Altaparmakov2005-09-083-10/+8
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix a bug in fs/ntfs/index.c::ntfs_index_lookup(). When the returnedAnton Altaparmakov2005-09-082-0/+4
| | | | | | | index entry is in the index root, we forgot to set the @ir pointer in the index context. Thanks for Yura Pakhuchiy for finding this bug. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Add ntfs_rl_punch_nolock() which punches a caller specified hole into ↵Anton Altaparmakov2005-09-083-0/+289
| | | | | | a runlist. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Change ntfs_rl_truncate_nolock() to throw away the runlist if the newAnton Altaparmakov2005-09-082-1/+15
| | | | | | length is zero. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Report unrepresentable inodes during ntfs_readdir() as KERN_WARNINGAnton Altaparmakov2005-09-083-2/+7
| | | | | | | messages and include the inode number. Thanks to Yura Pakhuchiy for pointing this out. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix handling of valid but empty mapping pairs array inAnton Altaparmakov2005-09-082-0/+5
| | | | | | fs/ntfs/runlist.c::ntfs_mapping_pairs_decompress(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Remove two bogus BUG_ON()s from fs/ntfs/mft.c.Anton Altaparmakov2005-09-082-2/+1
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix two nasty runlist merging bugs that had gone unnoticed so far.Anton Altaparmakov2005-09-082-2/+5
| | | | | | Thanks to Stefano Picerno for the bug report. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Use ntfs_malloc_nofs_nofail() in runlist.c::ntfs_runlists_merge()Anton Altaparmakov2005-09-082-18/+53
| | | | | | | in the two critical regions. This means we no longer need to panic() when the allocation fails as it now cannot fail. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Allow highmem kmalloc() in ntfs_malloc_nofs() and add _nofail() version.Anton Altaparmakov2005-09-082-6/+48
| | | | | | | | | | | - Modify fs/ntfs/malloc.h::ntfs_malloc_nofs() to do the kmalloc() based allocations with __GFP_HIGHMEM, analogous to how the vmalloc() based allocations are done. - Add fs/ntfs/malloc.h::ntfs_malloc_nofs_nofail() which is analogous to ntfs_malloc_nofs() but it performs allocations with __GFP_NOFAIL and hence cannot fail. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Support more clean journal ($LogFile) states.Anton Altaparmakov2005-09-085-123/+167
| | | | | | | | | | | | | | | - Support journals ($LogFile) which have been modified by chkdsk. This means users can boot into Windows after we marked the volume dirty. The Windows boot will run chkdsk and then reboot. The user can then immediately boot into Linux rather than having to do a full Windows boot first before rebooting into Linux and we will recognize such a journal and empty it as it is clean by definition. - Support journals ($LogFile) with only one restart page as well as journals with two different restart pages. We sanity check both and either use the only sane one or the more recent one of the two in the case that both are valid. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Complete the previous fix for the unset device when mapping buffersAnton Altaparmakov2005-08-162-1/+2
| | | | | | | for mft record writing. I had missed the writepage based mft record write code path. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix bug in mft record writing where we forgot to set the device inAnton Altaparmakov2005-08-162-0/+5
| | | | | | | the buffers when mapping them after the VM had discarded them. Thanks to Martin MOKREJŠ for the bug report. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* [PATCH] turn many #if $undefined_string into #ifdef $undefined_stringOlaf Hering2005-07-271-1/+1
| | | | | | | | | turn many #if $undefined_string into #ifdef $undefined_string to fix some warnings after -Wno-def was added to global CFLAGS Signed-off-by: Olaf Hering <olh@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* NTFS: Fix a nasty deadlock that appeared in recent kernels.Anton Altaparmakov2005-06-262-10/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The situation: VFS inode X on a mounted ntfs volume is dirty. For same inode X, the ntfs_inode is dirty and thus corresponding on-disk inode, i.e. mft record, which is in a dirty PAGE_CACHE_PAGE belonging to the table of inodes, i.e. $MFT, inode 0. What happens: Process 1: sys_sync()/umount()/whatever... calls __sync_single_inode() for $MFT -> do_writepages() -> write_page for the dirty page containing the on-disk inode X, the page is now locked -> ntfs_write_mst_block() which clears PageUptodate() on the page to prevent anyone else getting hold of it whilst it does the write out. This is necessary as the on-disk inode needs "fixups" applied before the write to disk which are removed again after the write and PageUptodate is then set again. It then analyses the page looking for dirty on-disk inodes and when it finds one it calls ntfs_may_write_mft_record() to see if it is safe to write this on-disk inode. This then calls ilookup5() to check if the corresponding VFS inode is in icache(). This in turn calls ifind() which waits on the inode lock via wait_on_inode whilst holding the global inode_lock. Process 2: pdflush results in a call to __sync_single_inode for the same VFS inode X on the ntfs volume. This locks the inode (I_LOCK) then calls write-inode -> ntfs_write_inode -> map_mft_record() -> read_cache_page() for the page (in page cache of table of inodes $MFT, inode 0) containing the on-disk inode. This page has PageUptodate() clear because of Process 1 (see above) so read_cache_page() blocks when it tries to take the page lock for the page so it can call ntfs_read_page(). Thus Process 1 is holding the page lock on the page containing the on-disk inode X and it is waiting on the inode X to be unlocked in ifind() so it can write the page out and then unlock the page. And Process 2 is holding the inode lock on inode X and is waiting for the page to be unlocked so it can call ntfs_readpage() or discover that Process 1 set PageUptodate() again and use the page. Thus we have a deadlock due to ifind() waiting on the inode lock. The solution: The fix is to use the newly introduced ilookup5_nowait() which does not wait on the inode's lock and hence avoids the deadlock. This is safe as we do not care about the VFS inode and only use the fact that it is in the VFS inode cache and the fact that the vfs and ntfs inodes are one struct in memory to find the ntfs inode in memory if present. Also, the ntfs inode has its own locking so it does not matter if the vfs inode is locked. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Prepare for 2.1.23 release: Update documentation and bump version.Anton Altaparmakov2005-06-253-21/+8
| | | | Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Change ntfs_map_runlist_nolock() to only decompress the mapping pairsAnton Altaparmakov2005-06-252-19/+48
| | | | | | | | | | if the requested vcn is inside it. Otherwise we get into problems when we try to map an out of bounds vcn because we then try to map the already mapped runlist fragment which causes ntfs_mapping_pairs_decompress() to fail and return error. Update ntfs_attr_find_vcn_nolock() accordingly. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Add an extra parameter @last_vcn to ntfs_get_size_for_mapping_pairs()Anton Altaparmakov2005-06-255-60/+132
| | | | | | | | and ntfs_mapping_pairs_build() to allow the runlist encoding to be partial which is desirable when filling holes in sparse attributes. Update all callers. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Change the runlist terminator of the newly allocated cluster(s) toAnton Altaparmakov2005-06-252-0/+11
| | | | | | | LCN_ENOENT in ntfs_attr_make_non_resident(). Otherwise the runlist code gets confused. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Fix several occurences of a bug where we would perform 'var & ~const'Anton Altaparmakov2005-06-255-7/+12
| | | | | | | | with a 64-bit variable and a int, i.e. 32-bit, constant. This causes the higher order 32-bits of the 64-bit variable to be zeroed. To fix this cast the 'const' to the same 64-bit type as 'var'. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
* NTFS: Detect the case when Windows has been suspended to disk on the volumeAnton Altaparmakov2005-06-252-11/+171
| | | | | | | to be mounted and if this is the case do not allow (re)mounting read-write. This is done by parsing hiberfil.sys if present. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
OpenPOWER on IntegriCloud