24 Jun, 2009
1 commit
-
first_block and goal are unsigned. When negative they are wrapped and caught by
the other test.Signed-off-by: Roel Kluin
Signed-off-by: Jan Kara
18 Jun, 2009
1 commit
-
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
12 Jun, 2009
3 commits
-
Signed-off-by: Al Viro
-
[xfs, btrfs, capifs, shmem don't need BKL, exempt]
Signed-off-by: Alessio Igor Bogani
Signed-off-by: Al Viro -
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
Signed-off-by: Al Viro
23 May, 2009
1 commit
-
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
Signed-off-by: Jens Axboe
02 Apr, 2009
16 commits
-
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 .Signed-off-by: Jan Kara
-
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
-
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
-
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
Signed-off-by: Jan Kara -
The novrs mount option was broken due to a missing break.
Signed-off-by: Clemens Ladisch
Signed-off-by: Jan Kara -
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
-
This patch makes udf return f_fsid info for statfs(2).
Signed-off-by: Coly Li
Cc: Jan Kara
Signed-off-by: Jan Kara -
Signed-off-by: Jan Kara
-
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
Signed-off-by: Marcin Slusarz
Signed-off-by: Jan Kara -
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 expressionReported-by: Hannes Eder
Signed-off-by: Jan Kara -
unsigned last[i] cannot be less than 0
Signed-off-by: Roel Kluin
Signed-off-by: Jan Kara -
"dmode" allows overriding permissions of directories and
"mode" allows overriding permissions of files.Signed-off-by: Marcin Slusarz
Cc: Jan Kara
Signed-off-by: Jan Kara -
Allocate strings with kmalloc.
Checkstack output:
Before: udf_get_filename: 600
After: udf_get_filename: 136Signed-off-by: Marcin Slusarz
Cc: Jan Kara
Signed-off-by: Jan Kara -
Allocate strings with kmalloc.
Checkstack output:
Before: udf_process_sequence: 712
After: udf_process_sequence: 200Signed-off-by: Marcin Slusarz
Signed-off-by: Jan Kara -
Signed-off-by: Pekka Enberg
Signed-off-by: Jan Kara -
Signed-off-by: Pekka Enberg
Signed-off-by: Jan Kara
26 Mar, 2009
1 commit
-
Use lowercase names of quota functions instead of old uppercase ones.
Signed-off-by: Jan Kara
22 Jan, 2009
1 commit
-
Signed-off-by: Alexey Dobriyan
04 Dec, 2008
1 commit
-
Conflicts:
fs/nfsd/nfs4recover.cManually fixed above to use new creds API functions, e.g.
nfs4_save_creds().Signed-off-by: James Morris
28 Nov, 2008
1 commit
-
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
14 Nov, 2008
1 commit
-
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
Reviewed-by: James Morris
Acked-by: Serge Hallyn
Acked-by: Jan Kara
Signed-off-by: James Morris
23 Oct, 2008
2 commits
-
Signed-off-by: Al Viro
-
Switch all users of d_alloc_anon to d_obtain_alias.
Signed-off-by: Christoph Hellwig
Signed-off-by: Al Viro
14 Oct, 2008
1 commit
-
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
Cc: Alexander Viro
Signed-off-by: Linus Torvalds
09 Sep, 2008
1 commit
-
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
Signed-off-by: Jan Kara
19 Aug, 2008
2 commits
-
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 ). Also remove a few superfluous
initializations already done in udf_alloc_inode().Reviewed-by: Ingo Oeser
Signed-off-by: Jan Kara -
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:
[] __mutex_lock_slowpath+0x64/0x9b
[] mutex_lock+0xa/0xb
[] shrink_icache_memory+0x38/0x200
[] shrink_slab+0xe3/0x15b
[] try_to_free_pages+0x221/0x30d
[] isolate_pages_global+0x0/0x31
[] __alloc_pages_internal+0x252/0x3ab
[] cache_alloc_refill+0x22e/0x47b
[] kmem_cache_alloc+0x3b/0x61
[] cache_alloc_refill+0x2fe/0x47b
[] __kmalloc+0x76/0x9c
[] :udf:udf_new_inode+0x202/0x2e2
[] :udf:udf_create+0x2f/0x16d
[] :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:
[] __set_page_dirty+0xeb/0xf5
[] get_dirty_limits+0x1d/0x22f
[] __mutex_lock_slowpath+0x64/0x9b
[] mutex_lock+0xa/0xb
[] :udf:udf_bitmap_free_blocks+0x47/0x1eb
[] :udf:udf_discard_prealloc+0xc6/0x172
[] :udf:udf_clear_inode+0x1e/0x48
[] clear_inode+0x6d/0xc4
[] dispose_list+0x56/0xee
[] shrink_icache_memory+0x1d0/0x200
[] shrink_slab+0xe3/0x15b
[] kswapd+0x346/0x447
...Reported-by: Tibor Tajti
Reviewed-by: Ingo Oeser
Signed-off-by: Jan Kara
27 Jul, 2008
1 commit
-
Kmem cache passed to constructor is only needed for constructors that are
themselves multiplexeres. Nobody uses this "feature", nor does anybody uses
passed kmem cache in non-trivial way, so pass only pointer to object.Non-trivial places are:
arch/powerpc/mm/init_64.c
arch/powerpc/mm/hugetlbpage.cThis is flag day, yes.
Signed-off-by: Alexey Dobriyan
Acked-by: Pekka Enberg
Acked-by: Christoph Lameter
Cc: Jon Tollefson
Cc: Nick Piggin
Cc: Matt Mackall
[akpm@linux-foundation.org: fix arch/powerpc/mm/hugetlbpage.c]
[akpm@linux-foundation.org: fix mm/slab.c]
[akpm@linux-foundation.org: fix ubifs]
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 Jun, 2008
1 commit
-
In some cases it could happen that some block passed test in
udf_check_anchor_block() even though udf_read_tagged() refused to read it later
(e.g. because checksum was not correct). This patch makes
udf_check_anchor_block() use udf_read_tagged() so that the checking is
stricter.This fixes the regression (certain disks unmountable) caused by commit
423cf6dc04eb79d441bfda2b127bc4b57134b41d.Signed-off-by: Tomas Janousek
Signed-off-by: Jan Kara
16 Jun, 2008
1 commit
-
Commit 706047a79725b585cf272fdefc234b31b6545c72, "udf: Fix compilation
warnings when UDF debug is on" inadvertently (I assume) enabled
debugging messages by default for UDF. This patch disables them again.Signed-off-by: Paul Collins
Signed-off-by: Jan Kara
09 May, 2008
1 commit
-
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
udf: Fix memory corruption when fs mounted with noadinicb option
udf: Make udf exportable
udf: fs/udf/partition.c:udf_get_pblock() mustn't be inline
07 May, 2008
2 commits
-
When UDF filesystem is mounted with noadinicb mount option, it
happens that we extend an empty directory with a block. A code in
udf_add_entry() didn't count with this possibility and used
uninitialized data leading to memory and filesystem corruption.
Add a check whether file already has some extents before operating
on them.Signed-off-by: Jan Kara
-
Cc: Christoph Hellwig
Signed-off-by: Rasmus Rohde
Signed-off-by: Jan Kara
30 Apr, 2008
1 commit
-
__FUNCTION__ is gcc-specific, use __func__
Signed-off-by: Harvey Harrison
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds