29 Mar, 2012
1 commit
-
Pull squashfs updates from Phillip Lougher:
"Add an extra mount time sanity check, plus some code cleanups and bug
fixes."* tag 'squashfs-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next:
Squashfs: add mount time sanity check for block_size and block_log match
Squashfs: fix f_pos check in get_dir_index_using_offset
Squashfs: get rid of obsolete definitions in header file
Squashfs: remove redundant length initialisation in squashfs_lookup
Squashfs: remove redundant length initialisation in squashfs_readdir
Squashfs: update comment removing reference to zlib only
Squashfs: use define instead of constant
22 Mar, 2012
1 commit
-
Pull vfs pile 1 from Al Viro:
"This is _not_ all; in particular, Miklos' and Jan's stuff is not there
yet."* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits)
ext4: initialization of ext4_li_mtx needs to be done earlier
debugfs-related mode_t whack-a-mole
hfsplus: add an ioctl to bless files
hfsplus: change finder_info to u32
hfsplus: initialise userflags
qnx4: new helper - try_extent()
qnx4: get rid of qnx4_bread/qnx4_getblk
take removal of PF_FORKNOEXEC to flush_old_exec()
trim includes in inode.c
um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it
um: embed ->stub_pages[] into mmu_context
gadgetfs: list_for_each_safe() misuse
ocfs2: fix leaks on failure exits in module_init
ecryptfs: make register_filesystem() the last potential failure exit
ntfs: forgets to unregister sysctls on register_filesystem() failure
logfs: missing cleanup on register_filesystem() failure
jfs: mising cleanup on register_filesystem() failure
make configfs_pin_fs() return root dentry on success
configfs: configfs_create_dir() has parent dentry in dentry->d_parent
configfs: sanitize configfs_create()
...
21 Mar, 2012
1 commit
-
Signed-off-by: Al Viro
20 Mar, 2012
1 commit
-
Signed-off-by: Cong Wang
10 Mar, 2012
7 commits
-
Squashfs currently has a sanity check for block_size less than or
equal to the maximum block_size (1 Mbyte). This catches some
superblock corruption, but obviously with a block_size maximum
of 1 Mbyte there's 7 correct values (4K, 8K, 16K, 32K, ... etc) and
a lot of incorrect values which are not caught by this check.The Squashfs superblock, however, has both a block_size and
a block_log (2^block_log == block_size). Checking that the block_size
matches the block_log is a much more robust check. Corruption of the
superblock is unlikely to produce values which match, and it also
ensures the block_size is an exact power of two.Signed-off-by: Phillip Lougher
-
One off error in the f_pos check. If f_pos is 3 or less don't
bother reading the index because we're at the start of the
directory, and we obviously already know where that is on disk.This eliminates an unnecessary read.
Signed-off-by: Phillip Lougher
-
Most of these were never used by the kernel code, but belong to
the time when the header file was used by both the kernel code
and the user space tools.Signed-off-by: Phillip Lougher
-
Signed-off-by: Phillip Lougher
-
Signed-off-by: Phillip Lougher
-
Comment was written when Squashfs only supported zlib compression.
This comment is now misleading given Squashfs supports other
compression algorithms.Signed-off-by: Phillip Lougher
-
Its better to use defined name instead of constant
Signed-off-by: Ajeet Yadav
Signed-off-by: Phillip Lougher
14 Jan, 2012
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next:
Squashfs: fix i_blocks calculation with extended regular files
Squashfs: fix mount time sanity check for corrupted superblock
Squashfs: optimise squashfs_cache_get entry search
Squashfs: Update documentation to include xattrs
Squashfs: add missing block release on error condition
04 Jan, 2012
1 commit
-
Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
the cost of taking it into inode_init_always() will be negligible for pipes
and sockets and negative for everything else. Not to mention the removal of
boilerplate code from ->destroy_inode() instances...Signed-off-by: Al Viro
03 Jan, 2012
2 commits
-
The le64_to_cpu() forces the calculation to be unsigned, with
the effect that it can underflow leading to an incorrect large
value.This bug only triggers in rare(ish) circumstances, an empty file
encoded as an extended regular file or a completely sparse file.
Normally empty files are encoded as a regular file rather than as
an extended regular file (and the regular file i_blocks calculation
doesn't have this bug). To save space regular file inodes are
optimised to encode the most commonly occurring files. Less
common regular files are encoded using extended regular file inodes
which contain extra information.Empty files with nlinks greater than 1, and or empty files
with extended attributes are encoded using extended regular file
inodes and they will hit this bug.Signed-off-by: Phillip Lougher
-
A Squashfs filesystem containing nothing but an empty directory,
although unusual and ultimately pointless, is still valid.The directory_table >= next_table sanity check rejects these
filesystems as invalid because the directory_table is empty and
equal to next_table.Signed-off-by: Phillip Lougher
30 Dec, 2011
2 commits
-
squashfs_cache_get() iterates over all entries to search for
block its looking for. Often get() / put() are called for
same block.If we cache the current entry index, then we can optimise the
subsequent *_get() calls.Signed-off-by: Ajeet Yadav
Signed-off-by: Phillip Lougher -
squashfs_read_metadata forgets to release the cache block if
an error has occurred.Signed-off-by: Phillip Lougher
05 Nov, 2011
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next:
Squashfs: Add an option to set dev block size to 4K
03 Nov, 2011
1 commit
-
This commit adds an option to set the device block size used to 4K.
By default Squashfs sets the device block size (sb_min_blocksize) to 1K
or the smallest block size supported by the block device (if larger).
This, because blocks are packed together and unaligned in Squashfs,
should reduce latency.This, however, gives poor performance on MTD NAND devices where
the optimal I/O size is 4K (even though the devices can support
smaller block sizes).Using a 4K device block size may also improve overall I/O
performance for some file access patterns (e.g. sequential
accesses of files in filesystem order) on all media.Signed-off-by: Phillip Lougher
02 Nov, 2011
1 commit
-
Replace remaining direct i_nlink updates with a new set_nlink()
updater function.Signed-off-by: Miklos Szeredi
Tested-by: Toshiyuki Okajima
Signed-off-by: Christoph Hellwig
28 Sep, 2011
1 commit
-
There are numerous broken references to Documentation files (in other
Documentation files, in comments, etc.). These broken references are
caused by typo's in the references, and by renames or removals of the
Documentation files. Some broken references are simply odd.Fix these broken references, sometimes by dropping the irrelevant text
they were part of.Signed-off-by: Paul Bolle
Signed-off-by: Jiri Kosina
26 Jul, 2011
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
Squashfs: Make ZLIB compression support optional
Squashfs: Update documentation for XZ and add squashfs-tools devel tree
22 Jul, 2011
1 commit
-
Squashfs now supports XZ and LZO compression in addition to ZLIB.
As such it no longer makes sense to always include ZLIB support.
In particular embedded systems may only use LZO or XZ compression, and
the ability to exclude ZLIB support will reduce kernel size.Signed-off-by: Phillip Lougher
20 Jul, 2011
2 commits
-
... and simplify the living hell out of callers
Signed-off-by: Al Viro
-
d_splice_alias(NULL, dentry) is equivalent to d_add(dentry, NULL), NULL
so no need for that if (inode) ... in there (or ERR_PTR(0), for that
matter)Signed-off-by: Al Viro
30 May, 2011
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
Squashfs: Fix sanity check patches on big-endian systems
29 May, 2011
1 commit
-
le64 values should be swapped when accessing on
big-endian systems.Signed-off-by: Phillip Lougher
27 May, 2011
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
Squashfs: update email address
Squashfs: add extra sanity checks at mount time
Squashfs: add sanity checks to fragment reading at mount time
Squashfs: add sanity checks to lookup table reading at mount time
Squashfs: add sanity checks to id reading at mount time
Squashfs: add sanity checks to xattr reading at mount time
Squashfs: reverse order of filesystem table reading
Squashfs: move table allocation into squashfs_read_table()
26 May, 2011
8 commits
-
My existing email address may stop working in a month or two, so update
email to one that will continue working.Signed-off-by: Phillip Lougher
-
Add some extra sanity checks of the inode and directory structures.
Signed-off-by: Phillip Lougher
-
Fsfuzzer generates corrupted filesystems which throw a warn_on in
kmalloc. One of these is due to a corrupted superblock fragments field.
Fix this by checking that the number of bytes to be read (and allocated)
does not extend into the next filesystem structure.Also add a couple of other sanity checks of the mount-time fragment table
structures.Signed-off-by: Phillip Lougher
-
Fsfuzzer generates corrupted filesystems which throw a warn_on in
kmalloc. One of these is due to a corrupted superblock inodes field.
Fix this by checking that the number of bytes to be read (and allocated)
does not extend into the next filesystem structure.Also add a couple of other sanity checks of the mount-time lookup table
structures.Signed-off-by: Phillip Lougher
-
Fsfuzzer generates corrupted filesystems which throw a warn_on in
kmalloc. One of these is due to a corrupted superblock no_ids field.
Fix this by checking that the number of bytes to be read (and allocated)
does not extend into the next filesystem structure.Also add a couple of other sanity checks of the mount-time id table
structures.Signed-off-by: Phillip Lougher
-
These checks add sanity checking of the mount-time xattr structures.
Signed-off-by: Phillip Lougher
-
Reverse order of table reading from mostly first to last in placement
order, to last to first. This is to enable extra superblock sanity
checks to be added in later patches.Signed-off-by: Phillip Lougher
-
This eliminates a lot of duplicate code.
Signed-off-by: Phillip Lougher
10 May, 2011
1 commit
-
- kenrel -> kernel
- whetehr -> whether
- ttt -> tt
- sss -> ssSigned-off-by: Justin P. Mattock
Signed-off-by: Jiri Kosina
31 Mar, 2011
1 commit
-
Fixes generated by 'codespell' and manually reviewed.
Signed-off-by: Lucas De Marchi
23 Mar, 2011
1 commit
-
Bugzilla bug 31422 reports occasional "page allocation failure. order:4"
at Squashfs mount time. Fix this by making zlib workspace allocation
use vmalloc rather than kmalloc.Reported-by: Mehmet Giritli
Signed-off-by: Phillip Lougher
16 Mar, 2011
1 commit
-
Handle the rare case where a directory metadata block is uncompressed and
corrupted, leading to a kernel oops in directory scanning (memcpy).
Normally corruption is detected at the decompression stage and dealt with
then, however, this will not happen if:- metadata isn't compressed (users can optionally request no metadata
compression), or
- the compressed metadata block was larger than the original, in which
case the uncompressed version was used, or
- the data was corrupt after decompressionThis patch fixes this by adding some sanity checks against known maximum
values.Signed-off-by: Phillip Lougher