summaryrefslogtreecommitdiff
path: root/fs/udf/super.c
AgeCommit message (Collapse)AuthorFilesLines
2010-08-10switch udf to ->evict_inode()Al Viro1-2/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-02udf: super.c Fix warning: variable 'sbi' set but not usedJustin P. Mattock1-2/+0
This fixes this warning when building the kernel: CC fs/udf/super.o fs/udf/super.c: In function 'udf_load_sequence': fs/udf/super.c:1582:22: warning: variable 'sbi' set but not used Please have a look, when you have time and let me know. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-24udf: Remove dead quota codeJan Kara1-16/+2
Quota on UDF is non-functional at least since 2.6.16 (I'm too lazy to do more archeology) because it does not provide .quota_write and .quota_read functions and thus quotaon(8) just returns EINVAL. Since nobody complained for all those years and quota support is not even in UDF standard just nuke it. Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-24quota: rename default quotactl methods to dquot_Christoph Hellwig1-1/+1
Follow the dquot_* style used elsewhere in dquot.c. [Jan Kara: Fixed up missing conversion of ext2] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-24quota: explicitly set ->dq_op and ->s_qcopChristoph Hellwig1-1/+5
Only set the quota operation vectors if the filesystem actually supports quota instead of doing it for all filesystems in alloc_super(). [Jan Kara: Export dquot_operations and vfs_quotactl_ops] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-24quota: move unmount handling into the filesystemChristoph Hellwig1-0/+2
Currently the VFS calls into the quotactl interface for unmounting filesystems. This means filesystems with their own quota handling can't easily distinguish between user-space originating quotaoff and an unount. Instead move the responsibily of the unmount handling into the filesystem to be consistent with all other dquot handling. Note that we do call dquot_disable a lot later now, e.g. after a sync_filesystem. But this is fine as the quota code does all its writes via blockdev's mapping and that is synced even later. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-24quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappersChristoph Hellwig1-4/+2
Instead of having wrappers in the VFS namespace export the dquot_suspend and dquot_resume helpers directly. Also rename vfs_quota_disable to dquot_disable while we're at it. [Jan Kara: Moved dquot_suspend to quotaops.h and made it inline] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-24quota: move remount handling into the filesystemChristoph Hellwig1-7/+18
Currently do_remount_sb calls into the dquot code to tell it about going from rw to ro and ro to rw. Move this code into the filesystem to not depend on the dquot code in the VFS - note ocfs2 already ignores these calls and handles remount by itself. This gets rid of overloading the quotactl calls and allows to unify the VFS and XFS codepaths in that area later. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
2009-12-14udf: Try harder when looking for VAT inodeJan Kara1-8/+24
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>
2009-07-30udf: Fix loading of VAT inode when drive wrongly reports number of recorded ↵Jan Kara1-0/+12
blocks 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>
2009-06-12Push BKL down into ->remount_fs()Alessio Igor Bogani1-1/+5
[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>
2009-06-12push BKL down into ->put_superChristoph Hellwig1-0/+5
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>
2009-05-23block: Do away with the notion of hardsect_sizeMartin K. Petersen1-1/+1
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>
2009-04-02udf: Don't write integrity descriptor too oftenJan Kara1-19/+25
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>
2009-04-02udf: Try anchor in block 256 firstJan Kara1-247/+185
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>
2009-04-02udf: Some type fixes and cleanupsJan Kara1-6/+4
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>
2009-04-02udf: use hardware sector sizeClemens Ladisch1-21/+49
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>
2009-04-02udf: fix novrs mount optionClemens Ladisch1-0/+1
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>
2009-04-02udf: return f_fsid for statfs(2)Coly Li1-1/+3
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>
2009-04-02udf: Add checks to not underflow sector_tJan Kara1-8/+13
Signed-off-by: Jan Kara <jack@suse.cz>
2009-04-02udf: fix default mode and dmode options handlingMarcin Slusarz1-4/+4
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>
2009-04-02udf: unsigned last[i] cannot be less than 0roel kluin1-2/+0
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>
2009-04-02udf: implement mode and dmode mounting optionsMarcin Slusarz1-1/+30
"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>
2009-04-02udf: reduce stack usage of udf_load_pvoldescMarcin Slusarz1-11/+25
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>
2009-04-02Fix the udf code not to pass structs on stack where possible.Pekka Enberg1-11/+11
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Jan Kara <jack@suse.cz>
2009-04-02Remove struct typedefs from fs/udf/ecma_167.h et al.Pekka Enberg1-24/+24
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Jan Kara <jack@suse.cz>
2008-10-13vfs: Use const for kernel parser tableSteven Whitehouse1-1/+1
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>
2008-07-26SL*B: drop kmem cache argument from constructorAlexey Dobriyan1-1/+1
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.c This is flag day, yes. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Acked-by: Christoph Lameter <cl@linux-foundation.org> Cc: Jon Tollefson <kniht@linux.vnet.ibm.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Matt Mackall <mpm@selenic.com> [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 <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-06-24udf: Fix regression in UDF anchor block detectionTomas Janousek1-34/+23
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 <tomi@nomi.cz> Signed-off-by: Jan Kara <jack@suse.cz>
2008-05-08Merge branch 'for_linus' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6 * '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
2008-05-07udf: Make udf exportableRasmus Rohde1-0/+1
Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Rasmus Rohde <rohde@duff.dk> Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-30fs: replace remaining __FUNCTION__ occurrencesHarvey Harrison1-2/+2
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-17udf: use crc_itu_t from lib instead of udf_crcBob Copeland1-5/+5
As pointed out by Sergey Vlasov, UDF implements its own version of the CRC ITU-T V.41. Convert it to use the one in the library. Signed-off-by: Bob Copeland <me@bobcopeland.com> Cc: Sergey Vlasov <vsu@altlinux.ru> Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Fix compilation warnings when UDF debug is onSebastian Manciulea1-3/+4
Fix two compilation warnings (and actual bugs in message formatting) when UDF debugging is turned on. Signed-off-by: Sebastian Manciulea <manciuleas@yahoo.com> Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Fix bug in VAT mapping codeSebastian Manciulea1-4/+2
Fix mapping of blocks using VAT when it is stored in an inode. UDF_I(inode)->i_data already points to the beginning of VAT header so there's no need to add udf_ext0_offset(inode). Signed-off-by: Sebastian Manciulea <manciuleas@yahoo.com> Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Add read-only support for 2.50 UDF mediaJan Kara1-13/+177
This patch implements parsing of metadata partitions and reading of Metadata File thus allowing to read UDF 2.50 media. Error resilience is implemented through accessing the Metadata Mirror File in case the data the Metadata File cannot be read. The patch is based on the original patch by Sebastian Manciulea <manciuleas@yahoo.com> and Mircea Fedoreanu <mirceaf_spl@yahoo.com>. Signed-off-by: Sebastian Manciulea <manciuleas@yahoo.com> Signed-off-by: Mircea Fedoreanu <mirceaf_spl@yahoo.com> Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Fix handling of multisession mediaSebastian Manciulea1-1/+1
According to OSTA UDF specification, only anchor blocks and primary volume descriptors are placed on media relative to the last session. All other block numbers are absolute (in the partition or the whole media). This seems to be confirmed by multisession media created by other systems. Signed-off-by: Sebastian Manciulea <manciuleas@yahoo.com> Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Mount filesystem read-only if it has pseudooverwrite partitionJan Kara1-0/+8
As we don't properly support writing to pseudooverwrite partition (we should add entries to VAT and relocate blocks instead of just writing them), mount filesystems with such partition as read-only. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Handle VAT packed inside inode properlyJan Kara1-9/+15
We didn't handle VAT packed inside the inode - we tried to call udf_block_map() on such file which lead to strange results at best. Add proper handling of packed VAT as we do it with other packed files. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Fix detection of VAT versionJan Kara1-2/+2
We incorrectly (way to strictly) checked version of VAT on loading and thus refuse to mount correct media. There are just two format versions - below 2.0 and above 2.0 and we understand both. So update the version check accordingly. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Silence warning about accesses beyond end of deviceJan Kara1-1/+5
Some of the computed positions of anchor block could be beyond the end of device. Skip reading such blocks. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Improve anchor block detectionJan Kara1-4/+9
Add <last block>+1 and <last block>-1 to a list of blocks which can be the real last recorded block on a UDF media. Sebastian Manciulea <manciuleas@yahoo.com> claims this helps some drive + media combinations he is able to test. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Cleanup anchor block detection.Jan Kara1-141/+98
UDF anchor block detection is complicated by several things - there are several places where the anchor point can be, some of them relative to the last recorded block which some devices report wrongly. Moreover some devices on some media seem to have 7 spare blocks sectors for every 32 blocks (at least as far as I understand the old code) so we have to count also with that possibility. This patch splits anchor block detection into several functions so that it is clearer what we actually try to do. We fix several bugs of the type "for such and such media, we fail to check block blah" as a result of the cleanup. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Move processing of virtual partitionsJan Kara1-80/+85
This patch move processing of UDF virtual partitions close to the place where other partition types are processed. As a result we now also properly fill in partition access type. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Move filling of partition descriptor info into a separate functionJan Kara1-56/+62
Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Improve error recovery on mountJan Kara1-44/+42
Report error when we fail to allocate memory for a bitmap and properly release allocated memory and inodes for all the partitions in case of mount failure and umount. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Cleanup volume descriptor sequence processingJan Kara1-54/+81
Cleanup processing of volume descriptor sequence so that it is more readable, make code handle errors (e.g. media problems) better. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: fix anchor point detectionPavel Emelyanov1-9/+6
According to ECMA 167 rev. 3 (see 3/8.4.2.1), Anchor Volume Descriptor Pointer should be recorded at two or more anchor points located at sectors 256, N, N - 256, where N - is a largest logical sector number at volume space. So we should always try to detect N on UDF volume before trying to find Anchor Volume Descriptor (i.e. calling to udf_find_anchor()). That said, all this patch does is updates the s_last_block even if the udf_vrs() returns positive value. Originally written and tested by Yuri Per, ported on latest mainline by me. Signed-off-by: Yuri Per <Yuri.Per@acronis.com> Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: Max Lyadvinsky <Max.Lyadvinsky@acronis.com> Cc: Vladimir Simonov <Vladimir.Simonov@acronis.com> Cc: Andrew Neporada <Andrew.Neporada@acronis.com> Cc: Kirill Korotaev <dev@openvz.org> Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: Mark udf_process_sequence() as noinlineJan Kara1-1/+1
Mark udf_process_sequence() as noinline since stack usage is terrible otherwise. Signed-off-by: Jan Kara <jack@suse.cz>
2008-04-17udf: super.c reorganizationMarcin Slusarz1-282/+270
reorganize few code blocks in super.c which were needlessly indented (and hard to read): so change from: rettype fun() { init; if (sth) { long block of code; } } to: rettype fun() { init; if (!sth) return; long block of code; } or from: rettype fun2() { init; while (sth) { init2(); if (sth2) { long block of code; } } } to: rettype fun2() { init; while (sth) { init2(); if (!sth2) continue; long block of code; } } Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>