- 14 Dec, 2009 3 commits
-
-
Jan Kara authored
It is not very good to do IO in udf_clear_inode. First, VFS does not really expect inode to become dirty there and thus we have to write it ourselves, second, memory reclaim gets blocked waiting for IO when it does not really expect it, third, the IO pattern (e.g. on umount) resulting from writes in udf_clear_inode is bad and it slows down writing a lot. The reason why UDF needed to do IO in udf_clear_inode is that UDF standard mandates extent length to exactly match inode size. But when we allocate extents to a file or directory, we don't really know what exactly the final file size will be and thus temporarily set it to block boundary and later truncate it to exact length in udf_clear_inode. Now, this is changed to truncate to final file size in udf_release_file for regular files. For directories and symlinks, we do the truncation at the moment when learn what the final file size will be. Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Some disks do not contain VAT inode in the last recorded block as required by the standard but a few blocks earlier (or the number of recorded blocks is wrong). So look for the VAT inode a bit before the end of the media. Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 14 Sep, 2009 4 commits
-
-
Jan Kara authored
When we close a file, we remove preallocated blocks from it. But this truncation was not protected by i_mutex and thus it could have raced with a write through a different fd and cause crashes or even filesystem corruption. Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
So far we preallocated blocks also for directories but that brings a problem, when to get rid of preallocated blocks we don't need. So far we removed them in udf_clear_inode() which has a disadvantage that 1) blocks are unavailable long after writing to a directory finished and thus one can get out of space unnecessarily early 2) releasing blocks from udf_clear_inode is problematic because VFS does not expect us to redirty inode there and it also slows down memory reclaim. So preallocate blocks only for regular files where we can drop preallocation in udf_release_file. Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Recomputation of the pointer was wrong (it should have been just increment). Luckily, we never use the computed value. Remove it. Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Remove code that gets never used. Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 30 Jul, 2009 1 commit
-
-
Jan Kara authored
VAT inode is located in the last block recorded block of the medium. When the drive errorneously reports number of recorded blocks, we failed to load the VAT inode and thus mount the medium. This patch makes kernel try to read VAT inode from the last block of the device if it is different from the last recorded block. Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 24 Jun, 2009 1 commit
-
-
Roel Kluin authored
first_block and goal are unsigned. When negative they are wrapped and caught by the other test. Signed-off-by:
Roel Kluin <roel.kluin@gmail.com> Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 18 Jun, 2009 1 commit
-
-
Jan Kara authored
Some drives report 0 as the number of written blocks when there are some blocks recorded. Use device size in such case so that we can automagically mount such media. Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 11 Jun, 2009 3 commits
-
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Alessio Igor Bogani authored
[xfs, btrfs, capifs, shmem don't need BKL, exempt] Signed-off-by:
Alessio Igor Bogani <abogani@texware.it> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Christoph Hellwig authored
Move BKL into ->put_super from the only caller. A couple of filesystems had trivial enough ->put_super (only kfree and NULLing of s_fs_info + stuff in there) to not get any locking: coda, cramfs, efs, hugetlbfs, omfs, qnx4, shmem, all others got the full treatment. Most of them probably don't need it, but I'd rather sort that out individually. Preferably after all the other BKL pushdowns in that area. [AV: original used to move lock_super() down as well; these changes are removed since we don't do lock_super() at all in generic_shutdown_super() now] [AV: fuse, btrfs and xfs are known to need no damn BKL, exempt] Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 22 May, 2009 1 commit
-
-
Martin K. Petersen authored
Until now we have had a 1:1 mapping between storage device physical block size and the logical block sized used when addressing the device. With SATA 4KB drives coming out that will no longer be the case. The sector size will be 4KB but the logical block size will remain 512-bytes. Hence we need to distinguish between the physical block size and the logical ditto. This patch renames hardsect_size to logical_block_size. Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
Jens Axboe <jens.axboe@oracle.com>
-
- 02 Apr, 2009 16 commits
-
-
Jan Kara authored
We update information in logical volume integrity descriptor after each allocation (as LVID contains free space, number of directories and files on disk etc.). If the filesystem is on some phase change media, this leads to its quick degradation as such media is able to handle only 10000 overwrites or so. We solve the problem by writing new information into LVID only on umount, remount-ro and sync. This solves the problem at the price of longer media inconsistency (previously media became consistent after pdflush flushed dirty LVID buffer) but that should be acceptable. Report by and patch written in cooperation with Rich Coe <Richard.Coe@med.ge.com>. Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Anchor block can be located at several places on the medium. Two of the locations are relative to media end which is problematic to detect. Also some drives report some block as last but are not able to read it or any block nearby before it. So let's first try block 256 and if it is all fine, don't look at other possible locations of anchor blocks to avoid IO errors. This change required a larger reorganization of code but the new code is hopefully more readable and definitely shorter. Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Make udf_check_valid() return 1 if the validity check passed and 0 otherwise. So far it was the other way around which was a bit confusing. Also make udf_vrs() return loff_t which is really the type it should return (not int). Signed-off-by:
Jan Kara <jack@suse.cz>
-
Clemens Ladisch authored
This patch makes the UDF FS driver use the hardware sector size as the default logical block size, which is required by the UDF specifications. While the previous default of 2048 bytes was correct for optical disks, it was not for hard disks or USB storage devices, and made it impossible to use such a device with the default mount options. (The Linux mkudffs tool uses a default block size of 2048 bytes even on devices with smaller hardware sectors, so this bug is unlikely to be noticed unless UDF-formatted USB storage devices are exchanged with other OSs.) To avoid regressions for people who use loopback optical disk images or who used the (sometimes wrong) defaults of mkudffs, we also try with a block size of 2048 bytes if no anchor was found with the hardware sector size. Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Clemens Ladisch authored
The novrs mount option was broken due to a missing break. Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Functions udf_CS0toNLS() and udf_NLStoCS0() didn't count with the fact that NLS can return negative length when invalid character is given to it for conversion. Thus interesting things could happen (such as overwriting random memory with the rest of filename). Add appropriate checks. Signed-off-by:
Jan Kara <jack@suse.cz>
-
Coly Li authored
This patch makes udf return f_fsid info for statfs(2). Signed-off-by:
Coly Li <coly.li@suse.de> Cc: Jan Kara <jack@suse.cz> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Signed-off-by:
Jan Kara <jack@suse.cz>
-
Marcin Slusarz authored
On x86 (and several other archs) mode_t is defined as "unsigned short" and comparing unsigned shorts to negative ints is broken (because short is promoted to int and then compared). Fix it. Reported-and-tested-by:
Laurent Riffard <laurent.riffard@free.fr> Signed-off-by:
Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
Fix sparse warnings: fs/udf/balloc.c:843:3: warning: returning void-valued expression fs/udf/balloc.c:847:3: warning: returning void-valued expression fs/udf/balloc.c:851:3: warning: returning void-valued expression fs/udf/balloc.c:855:3: warning: returning void-valued expression Reported-by:
Hannes Eder <hannes@hanneseder.net> Signed-off-by:
Jan Kara <jack@suse.cz>
-
roel kluin authored
unsigned last[i] cannot be less than 0 Signed-off-by:
Roel Kluin <roel.kluin@gmail.com> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Marcin Slusarz authored
"dmode" allows overriding permissions of directories and "mode" allows overriding permissions of files. Signed-off-by:
Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Jan Kara <jack@suse.cz> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Marcin Slusarz authored
Allocate strings with kmalloc. Checkstack output: Before: udf_get_filename: 600 After: udf_get_filename: 136 Signed-off-by:
Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Jan Kara <jack@suse.cz> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Marcin Slusarz authored
Allocate strings with kmalloc. Checkstack output: Before: udf_process_sequence: 712 After: udf_process_sequence: 200 Signed-off-by:
Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 25 Mar, 2009 1 commit
-
-
Jan Kara authored
Use lowercase names of quota functions instead of old uppercase ones. Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 22 Jan, 2009 1 commit
-
-
Alexey Dobriyan authored
Signed-off-by:
Alexey Dobriyan <adobriyan@gmail.com>
-
- 27 Nov, 2008 1 commit
-
-
Jan Kara authored
udf_clear_inode() can leave behind buffers on mapping's i_private list (when we truncated preallocation). Call invalidate_inode_buffers() so that the list is properly cleaned-up before we return from udf_clear_inode(). This is ugly and suggest that we should cleanup preallocation earlier than in clear_inode() but currently there's no such call available since drop_inode() is called under inode lock and thus is unusable for disk operations. Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 13 Nov, 2008 1 commit
-
-
David Howells authored
Wrap access to task credentials so that they can be separated more easily from the task_struct during the introduction of COW creds. Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id(). Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more sense to use RCU directly rather than a convenient wrapper; these will be addressed by later patches. Signed-off-by:
David Howells <dhowells@redhat.com> Reviewed-by:
James Morris <jmorris@namei.org> Acked-by:
Serge Hallyn <serue@us.ibm.com> Acked-by:
Jan Kara <jack@suse.cz> Signed-off-by:
James Morris <jmorris@namei.org>
-
- 23 Oct, 2008 2 commits
-
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Christoph Hellwig authored
Switch all users of d_alloc_anon to d_obtain_alias. Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 13 Oct, 2008 1 commit
-
-
Steven Whitehouse authored
This is a much better version of a previous patch to make the parser tables constant. Rather than changing the typedef, we put the "const" in all the various places where its required, allowing the __initconst exception for nfsroot which was the cause of the previous trouble. This was posted for review some time ago and I believe its been in -mm since then. Signed-off-by:
Steven Whitehouse <swhiteho@redhat.com> Cc: Alexander Viro <aviro@redhat.com> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 08 Sep, 2008 1 commit
-
-
Christoph Hellwig authored
UDF currently doesn't set a llseek method for regular files, which means it will fall back to default_llseek. This means no one can seek beyond 2 Gigabytes on udf, and that there's not protection vs the i_size updates from writers. Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Jan Kara <jack@suse.cz>
-
- 19 Aug, 2008 2 commits
-
-
Jan Kara authored
I case we failed to allocate memory for inode when creating it, we did not properly free block already allocated for this inode. Move memory allocation before the block allocation which fixes this issue (thanks for the idea go to Ingo Oeser <ioe-lkml@rameria.de>). Also remove a few superfluous initializations already done in udf_alloc_inode(). Reviewed-by:
Ingo Oeser <ioe-lkml@rameria.de> Signed-off-by:
Jan Kara <jack@suse.cz>
-
Jan Kara authored
A memory allocation inside alloc_mutex must not recurse back into the filesystem itself because that leads to lock inversion between iprune_mutex and alloc_mutex (and thus to deadlocks - see traces below). alloc_mutex is actually needed only to update allocation statistics in the superblock so we can drop it before we start allocating memory for the inode. tar D ffff81015b9c8c90 0 6614 6612 ffff8100d5a21a20 0000000000000086 0000000000000000 00000000ffff0000 ffff81015b9c8c90 ffff81015b8f0cd0 ffff81015b9c8ee0 0000000000000000 0000000000000003 0000000000000000 0000000000000000 0000000000000000 Call Trace: [<ffffffff803c1d8a>] __mutex_lock_slowpath+0x64/0x9b [<ffffffff803c1bef>] mutex_lock+0xa/0xb [<ffffffff8027f8c2>] shrink_icache_memory+0x38/0x200 [<ffffffff80257742>] shrink_slab+0xe3/0x15b [<ffffffff802579db>] try_to_free_pages+0x221/0x30d [<ffffffff8025657e>] isolate_pages_global+0x0/0x31 [<ffffffff8025324b>] __alloc_pages_internal+0x252/0x3ab [<ffffffff8026b08b>] cache_alloc_refill+0x22e/0x47b [<ffffffff8026ae37>] kmem_cache_alloc+0x3b/0x61 [<ffffffff8026b15b>] cache_alloc_refill+0x2fe/0x47b [<ffffffff8026b34e>] __kmalloc+0x76/0x9c [<ffffffffa00751f2>] :udf:udf_new_inode+0x202/0x2e2 [<ffffffffa007ae5e>] :udf:udf_create+0x2f/0x16d [<ffffffffa0078f27>] :udf:udf_lookup+0xa6/0xad ... kswapd0 D ffff81015b9d9270 0 125 2 ffff81015b903c28 0000000000000046 ffffffff8028cbb0 00000000fffffffb ffff81015b9d9270 ffff81015b8f0cd0 ffff81015b9d94c0 000000000271b490 ffffe2000271b458 ffffe2000271b420 ffffe20002728dc8 ffffe20002728d90 Call Trace: [<ffffffff8028cbb0>] __set_page_dirty+0xeb/0xf5 [<ffffffff8025403a>] get_dirty_limits+0x1d/0x22f [<ffffffff803c1d8a>] __mutex_lock_slowpath+0x64/0x9b [<ffffffff803c1bef>] mutex_lock+0xa/0xb [<ffffffffa0073f58>] :udf:udf_bitmap_free_blocks+0x47/0x1eb [<ffffffffa007df31>] :udf:udf_discard_prealloc+0xc6/0x172 [<ffffffffa007875a>] :udf:udf_clear_inode+0x1e/0x48 [<ffffffff8027f121>] clear_inode+0x6d/0xc4 [<ffffffff8027f7f2>] dispose_list+0x56/0xee [<ffffffff8027fa5a>] shrink_icache_memory+0x1d0/0x200 [<ffffffff80257742>] shrink_slab+0xe3/0x15b [<ffffffff80257e93>] kswapd+0x346/0x447 ... Reported-by:
Tibor Tajti <tibor.tajti@gmail.com> Reviewed-by:
Ingo Oeser <ioe-lkml@rameria.de> Signed-off-by:
Jan Kara <jack@suse.cz>
-