mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
udf: Limit file size to 4TB
commit c2efd13a2e upstream.
UDF disk format supports in principle file sizes up to 1<<64-1. However
the file space (including holes) is described by a linked list of
extents, each of which can have at most 1GB. Thus the creation and
handling of extents gets unusably slow beyond certain point. Limit the
file size to 4TB to avoid locking up the kernel too easily.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
63673a49d7
commit
6ac60f68b2
@@ -86,6 +86,13 @@ enum {
|
|||||||
#define UDF_MAX_LVID_NESTING 1000
|
#define UDF_MAX_LVID_NESTING 1000
|
||||||
|
|
||||||
enum { UDF_MAX_LINKS = 0xffff };
|
enum { UDF_MAX_LINKS = 0xffff };
|
||||||
|
/*
|
||||||
|
* We limit filesize to 4TB. This is arbitrary as the on-disk format supports
|
||||||
|
* more but because the file space is described by a linked list of extents,
|
||||||
|
* each of which can have at most 1GB, the creation and handling of extents
|
||||||
|
* gets unusably slow beyond certain point...
|
||||||
|
*/
|
||||||
|
#define UDF_MAX_FILESIZE (1ULL << 42)
|
||||||
|
|
||||||
/* These are the "meat" - everything else is stuffing */
|
/* These are the "meat" - everything else is stuffing */
|
||||||
static int udf_fill_super(struct super_block *, void *, int);
|
static int udf_fill_super(struct super_block *, void *, int);
|
||||||
@@ -2299,7 +2306,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
|
|||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
sb->s_maxbytes = MAX_LFS_FILESIZE;
|
sb->s_maxbytes = UDF_MAX_FILESIZE;
|
||||||
sb->s_max_links = UDF_MAX_LINKS;
|
sb->s_max_links = UDF_MAX_LINKS;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user