arm64: rockchip_linux_defconfig: enable MALI450
[firefly-linux-kernel-4.4.55.git] / fs / udf / super.c
index 32f5297dfbaba1a5f591b6e6f28402ddf24d56ad..81155b9b445b3313cec45c89533bd1ea8027736e 100644 (file)
@@ -48,7 +48,6 @@
 #include <linux/stat.h>
 #include <linux/cdrom.h>
 #include <linux/nls.h>
-#include <linux/buffer_head.h>
 #include <linux/vfs.h>
 #include <linux/vmalloc.h>
 #include <linux/errno.h>
@@ -63,7 +62,7 @@
 #include "udf_i.h"
 
 #include <linux/init.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 #define VDS_POS_PRIMARY_VOL_DESC       0
 #define VDS_POS_UNALLOC_SPACE_DESC     1
@@ -76,6 +75,9 @@
 
 #define UDF_DEFAULT_BLOCKSIZE 2048
 
+#define VSD_FIRST_SECTOR_OFFSET                32768
+#define VSD_MAX_SECTOR_OFFSET          0x800000
+
 enum { UDF_MAX_LINKS = 0xffff };
 
 /* These are the "meat" - everything else is stuffing */
@@ -94,13 +96,25 @@ static unsigned int udf_count_free(struct super_block *);
 static int udf_statfs(struct dentry *, struct kstatfs *);
 static int udf_show_options(struct seq_file *, struct dentry *);
 
-struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi)
+struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct super_block *sb)
 {
-       struct logicalVolIntegrityDesc *lvid =
-               (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data;
-       __u32 number_of_partitions = le32_to_cpu(lvid->numOfPartitions);
-       __u32 offset = number_of_partitions * 2 *
-                               sizeof(uint32_t)/sizeof(uint8_t);
+       struct logicalVolIntegrityDesc *lvid;
+       unsigned int partnum;
+       unsigned int offset;
+
+       if (!UDF_SB(sb)->s_lvid_bh)
+               return NULL;
+       lvid = (struct logicalVolIntegrityDesc *)UDF_SB(sb)->s_lvid_bh->b_data;
+       partnum = le32_to_cpu(lvid->numOfPartitions);
+       if ((sb->s_blocksize - sizeof(struct logicalVolIntegrityDescImpUse) -
+            offsetof(struct logicalVolIntegrityDesc, impUse)) /
+            (2 * sizeof(uint32_t)) < partnum) {
+               udf_err(sb, "Logical volume integrity descriptor corrupted "
+                       "(numOfPartitions = %u)!\n", partnum);
+               return NULL;
+       }
+       /* The offset is to skip freeSpaceTable and sizeTable arrays */
+       offset = partnum * 2 * sizeof(uint32_t);
        return (struct logicalVolIntegrityDescImpUse *)&(lvid->impUse[offset]);
 }
 
@@ -160,7 +174,7 @@ static void init_once(void *foo)
        inode_init_once(&ei->vfs_inode);
 }
 
-static int init_inodecache(void)
+static int __init init_inodecache(void)
 {
        udf_inode_cachep = kmem_cache_create("udf_inode_cache",
                                             sizeof(struct udf_inode_info),
@@ -490,6 +504,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
        while ((p = strsep(&options, ",")) != NULL) {
                substring_t args[MAX_OPT_ARGS];
                int token;
+               unsigned n;
                if (!*p)
                        continue;
 
@@ -501,7 +516,10 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
                case Opt_bs:
                        if (match_int(&args[0], &option))
                                return 0;
-                       uopt->blocksize = option;
+                       n = option;
+                       if (n != 512 && n != 1024 && n != 2048 && n != 4096)
+                               return 0;
+                       uopt->blocksize = n;
                        uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET);
                        break;
                case Opt_unhide:
@@ -629,10 +647,11 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options)
        struct udf_options uopt;
        struct udf_sb_info *sbi = UDF_SB(sb);
        int error = 0;
-       sync_filesystem(sb);
+       struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sb);
 
-       if (sbi->s_lvid_bh) {
-               int write_rev = le16_to_cpu(udf_sb_lvidiu(sbi)->minUDFWriteRev);
+       sync_filesystem(sb);
+       if (lvidiu) {
+               int write_rev = le16_to_cpu(lvidiu->minUDFWriteRev);
                if (write_rev > UDF_MAX_WRITE_VERSION && !(*flags & MS_RDONLY))
                        return -EACCES;
        }
@@ -673,7 +692,7 @@ out_unlock:
 static loff_t udf_check_vsd(struct super_block *sb)
 {
        struct volStructDesc *vsd = NULL;
-       loff_t sector = 32768;
+       loff_t sector = VSD_FIRST_SECTOR_OFFSET;
        int sectorsize;
        struct buffer_head *bh = NULL;
        int nsr02 = 0;
@@ -691,8 +710,18 @@ static loff_t udf_check_vsd(struct super_block *sb)
        udf_debug("Starting at sector %u (%ld byte sectors)\n",
                  (unsigned int)(sector >> sb->s_blocksize_bits),
                  sb->s_blocksize);
-       /* Process the sequence (if applicable) */
-       for (; !nsr02 && !nsr03; sector += sectorsize) {
+       /* Process the sequence (if applicable). The hard limit on the sector
+        * offset is arbitrary, hopefully large enough so that all valid UDF
+        * filesystems will be recognised. There is no mention of an upper
+        * bound to the size of the volume recognition area in the standard.
+        *  The limit will prevent the code to read all the sectors of a
+        * specially crafted image (like a bluray disc full of CD001 sectors),
+        * potentially causing minutes or even hours of uninterruptible I/O
+        * activity. This actually happened with uninitialised SSD partitions
+        * (all 0xFF) before the check for the limit and all valid IDs were
+        * added */
+       for (; !nsr02 && !nsr03 && sector < VSD_MAX_SECTOR_OFFSET;
+            sector += sectorsize) {
                /* Read a block */
                bh = udf_tread(sb, sector >> sb->s_blocksize_bits);
                if (!bh)
@@ -702,10 +731,7 @@ static loff_t udf_check_vsd(struct super_block *sb)
                vsd = (struct volStructDesc *)(bh->b_data +
                                              (sector & (sb->s_blocksize - 1)));
 
-               if (vsd->stdIdent[0] == 0) {
-                       brelse(bh);
-                       break;
-               } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_CD001,
+               if (!strncmp(vsd->stdIdent, VSD_STD_ID_CD001,
                                    VSD_STD_ID_LEN)) {
                        switch (vsd->structType) {
                        case 0:
@@ -741,6 +767,17 @@ static loff_t udf_check_vsd(struct super_block *sb)
                else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR03,
                                    VSD_STD_ID_LEN))
                        nsr03 = sector;
+               else if (!strncmp(vsd->stdIdent, VSD_STD_ID_BOOT2,
+                                   VSD_STD_ID_LEN))
+                       ; /* nothing */
+               else if (!strncmp(vsd->stdIdent, VSD_STD_ID_CDW02,
+                                   VSD_STD_ID_LEN))
+                       ; /* nothing */
+               else {
+                       /* invalid id : end of volume recognition area */
+                       brelse(bh);
+                       break;
+               }
                brelse(bh);
        }
 
@@ -748,7 +785,8 @@ static loff_t udf_check_vsd(struct super_block *sb)
                return nsr03;
        else if (nsr02)
                return nsr02;
-       else if (sector - (sbi->s_session << sb->s_blocksize_bits) == 32768)
+       else if (!bh && sector - (sbi->s_session << sb->s_blocksize_bits) ==
+                       VSD_FIRST_SECTOR_OFFSET)
                return -1;
        else
                return 0;
@@ -889,17 +927,23 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
 #endif
        }
 
-       if (!udf_build_ustr(instr, pvoldesc->volIdent, 32))
-               if (udf_CS0toUTF8(outstr, instr)) {
-                       strncpy(UDF_SB(sb)->s_volume_ident, outstr->u_name,
-                               outstr->u_len > 31 ? 31 : outstr->u_len);
-                       udf_debug("volIdent[] = '%s'\n",
-                                 UDF_SB(sb)->s_volume_ident);
-               }
+       if (!udf_build_ustr(instr, pvoldesc->volIdent, 32)) {
+               ret = udf_CS0toUTF8(outstr, instr);
+               if (ret < 0)
+                       goto out_bh;
 
-       if (!udf_build_ustr(instr, pvoldesc->volSetIdent, 128))
-               if (udf_CS0toUTF8(outstr, instr))
-                       udf_debug("volSetIdent[] = '%s'\n", outstr->u_name);
+               strncpy(UDF_SB(sb)->s_volume_ident, outstr->u_name,
+                       outstr->u_len > 31 ? 31 : outstr->u_len);
+               udf_debug("volIdent[] = '%s'\n", UDF_SB(sb)->s_volume_ident);
+       }
+
+       if (!udf_build_ustr(instr, pvoldesc->volSetIdent, 128)) {
+               ret = udf_CS0toUTF8(outstr, instr);
+               if (ret < 0)
+                       goto out_bh;
+
+               udf_debug("volSetIdent[] = '%s'\n", outstr->u_name);
+       }
 
        ret = 0;
 out_bh:
@@ -920,14 +964,16 @@ struct inode *udf_find_metadata_inode_efe(struct super_block *sb,
        addr.logicalBlockNum = meta_file_loc;
        addr.partitionReferenceNum = partition_num;
 
-       metadata_fe = udf_iget(sb, &addr);
+       metadata_fe = udf_iget_special(sb, &addr);
 
-       if (metadata_fe == NULL)
+       if (IS_ERR(metadata_fe)) {
                udf_warn(sb, "metadata inode efe not found\n");
-       else if (UDF_I(metadata_fe)->i_alloc_type != ICBTAG_FLAG_AD_SHORT) {
+               return metadata_fe;
+       }
+       if (UDF_I(metadata_fe)->i_alloc_type != ICBTAG_FLAG_AD_SHORT) {
                udf_warn(sb, "metadata inode efe does not have short allocation descriptors!\n");
                iput(metadata_fe);
-               metadata_fe = NULL;
+               return ERR_PTR(-EIO);
        }
 
        return metadata_fe;
@@ -939,6 +985,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
        struct udf_part_map *map;
        struct udf_meta_data *mdata;
        struct kernel_lb_addr addr;
+       struct inode *fe;
 
        map = &sbi->s_partmaps[partition];
        mdata = &map->s_type_specific.s_metadata;
@@ -947,22 +994,24 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
        udf_debug("Metadata file location: block = %d part = %d\n",
                  mdata->s_meta_file_loc, map->s_partition_num);
 
-       mdata->s_metadata_fe = udf_find_metadata_inode_efe(sb,
-               mdata->s_meta_file_loc, map->s_partition_num);
-
-       if (mdata->s_metadata_fe == NULL) {
+       fe = udf_find_metadata_inode_efe(sb, mdata->s_meta_file_loc,
+                                        map->s_partition_num);
+       if (IS_ERR(fe)) {
                /* mirror file entry */
                udf_debug("Mirror metadata file location: block = %d part = %d\n",
                          mdata->s_mirror_file_loc, map->s_partition_num);
 
-               mdata->s_mirror_fe = udf_find_metadata_inode_efe(sb,
-                       mdata->s_mirror_file_loc, map->s_partition_num);
+               fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc,
+                                                map->s_partition_num);
 
-               if (mdata->s_mirror_fe == NULL) {
+               if (IS_ERR(fe)) {
                        udf_err(sb, "Both metadata and mirror metadata inode efe can not found\n");
-                       return -EIO;
+                       return PTR_ERR(fe);
                }
-       }
+               mdata->s_mirror_fe = fe;
+       } else
+               mdata->s_metadata_fe = fe;
+
 
        /*
         * bitmap file entry
@@ -976,15 +1025,16 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
                udf_debug("Bitmap file location: block = %d part = %d\n",
                          addr.logicalBlockNum, addr.partitionReferenceNum);
 
-               mdata->s_bitmap_fe = udf_iget(sb, &addr);
-               if (mdata->s_bitmap_fe == NULL) {
+               fe = udf_iget_special(sb, &addr);
+               if (IS_ERR(fe)) {
                        if (sb->s_flags & MS_RDONLY)
                                udf_warn(sb, "bitmap inode efe not found but it's ok since the disc is mounted read-only\n");
                        else {
                                udf_err(sb, "bitmap inode efe not found and attempted read-write mount\n");
-                               return -EIO;
+                               return PTR_ERR(fe);
                        }
-               }
+               } else
+                       mdata->s_bitmap_fe = fe;
        }
 
        udf_debug("udf_load_metadata_files Ok\n");
@@ -1072,13 +1122,15 @@ static int udf_fill_partdesc_info(struct super_block *sb,
                                phd->unallocSpaceTable.extPosition),
                        .partitionReferenceNum = p_index,
                };
+               struct inode *inode;
 
-               map->s_uspace.s_table = udf_iget(sb, &loc);
-               if (!map->s_uspace.s_table) {
+               inode = udf_iget_special(sb, &loc);
+               if (IS_ERR(inode)) {
                        udf_debug("cannot load unallocSpaceTable (part %d)\n",
                                  p_index);
-                       return -EIO;
+                       return PTR_ERR(inode);
                }
+               map->s_uspace.s_table = inode;
                map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE;
                udf_debug("unallocSpaceTable (part %d) @ %ld\n",
                          p_index, map->s_uspace.s_table->i_ino);
@@ -1105,14 +1157,15 @@ static int udf_fill_partdesc_info(struct super_block *sb,
                                phd->freedSpaceTable.extPosition),
                        .partitionReferenceNum = p_index,
                };
+               struct inode *inode;
 
-               map->s_fspace.s_table = udf_iget(sb, &loc);
-               if (!map->s_fspace.s_table) {
+               inode = udf_iget_special(sb, &loc);
+               if (IS_ERR(inode)) {
                        udf_debug("cannot load freedSpaceTable (part %d)\n",
                                  p_index);
-                       return -EIO;
+                       return PTR_ERR(inode);
                }
-
+               map->s_fspace.s_table = inode;
                map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE;
                udf_debug("freedSpaceTable (part %d) @ %ld\n",
                          p_index, map->s_fspace.s_table->i_ino);
@@ -1139,6 +1192,7 @@ static void udf_find_vat_block(struct super_block *sb, int p_index,
        struct udf_part_map *map = &sbi->s_partmaps[p_index];
        sector_t vat_block;
        struct kernel_lb_addr ino;
+       struct inode *inode;
 
        /*
         * VAT file entry is in the last recorded block. Some broken disks have
@@ -1147,10 +1201,13 @@ static void udf_find_vat_block(struct super_block *sb, int p_index,
        ino.partitionReferenceNum = type1_index;
        for (vat_block = start_block;
             vat_block >= map->s_partition_root &&
-            vat_block >= start_block - 3 &&
-            !sbi->s_vat_inode; vat_block--) {
+            vat_block >= start_block - 3; vat_block--) {
                ino.logicalBlockNum = vat_block - map->s_partition_root;
-               sbi->s_vat_inode = udf_iget(sb, &ino);
+               inode = udf_iget_special(sb, &ino);
+               if (!IS_ERR(inode)) {
+                       sbi->s_vat_inode = inode;
+                       break;
+               }
        }
 }
 
@@ -1258,6 +1315,9 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
         * PHYSICAL partitions are already set up
         */
        type1_idx = i;
+#ifdef UDFFS_DEBUG
+       map = NULL; /* supress 'maybe used uninitialized' warning */
+#endif
        for (i = 0; i < sbi->s_partitions; i++) {
                map = &sbi->s_partmaps[i];
 
@@ -1544,7 +1604,7 @@ static noinline int udf_process_sequence(
        struct udf_vds_record *curr;
        struct generic_desc *gd;
        struct volDescPtr *vdp;
-       int done = 0;
+       bool done = false;
        uint32_t vdsn;
        uint16_t ident;
        long next_s = 0, next_e = 0;
@@ -1625,7 +1685,7 @@ static noinline int udf_process_sequence(
                                lastblock = next_e;
                                next_s = next_e = 0;
                        } else
-                               done = 1;
+                               done = true;
                        break;
                }
                brelse(bh);
@@ -1879,7 +1939,9 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
                        return 0;
                }
                if (nsr_off == -1)
-                       udf_debug("Failed to read byte 32768. Assuming open disc. Skipping validity check\n");
+                       udf_debug("Failed to read sector at offset %d. "
+                                 "Assuming open disc. Skipping validity "
+                                 "check\n", VSD_FIRST_SECTOR_OFFSET);
                if (!sbi->s_last_block)
                        sbi->s_last_block = udf_get_last_block(sb);
        } else {
@@ -1906,11 +1968,12 @@ static void udf_open_lvid(struct super_block *sb)
 
        if (!bh)
                return;
-
-       mutex_lock(&sbi->s_alloc_mutex);
        lvid = (struct logicalVolIntegrityDesc *)bh->b_data;
-       lvidiu = udf_sb_lvidiu(sbi);
+       lvidiu = udf_sb_lvidiu(sb);
+       if (!lvidiu)
+               return;
 
+       mutex_lock(&sbi->s_alloc_mutex);
        lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
        lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
        udf_time_to_disk_stamp(&lvid->recordingDateAndTime,
@@ -1938,10 +2001,12 @@ static void udf_close_lvid(struct super_block *sb)
 
        if (!bh)
                return;
+       lvid = (struct logicalVolIntegrityDesc *)bh->b_data;
+       lvidiu = udf_sb_lvidiu(sb);
+       if (!lvidiu)
+               return;
 
        mutex_lock(&sbi->s_alloc_mutex);
-       lvid = (struct logicalVolIntegrityDesc *)bh->b_data;
-       lvidiu = udf_sb_lvidiu(sbi);
        lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
        lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
        udf_time_to_disk_stamp(&lvid->recordingDateAndTime, CURRENT_TIME);
@@ -2005,6 +2070,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
        struct udf_options uopt;
        struct kernel_lb_addr rootdir, fileset;
        struct udf_sb_info *sbi;
+       bool lvid_open = false;
 
        uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT);
        uopt.uid = INVALID_UID;
@@ -2022,12 +2088,12 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
        mutex_init(&sbi->s_alloc_mutex);
 
        if (!udf_parse_options((char *)options, &uopt, false))
-               goto error_out;
+               goto parse_options_failure;
 
        if (uopt.flags & (1 << UDF_FLAG_UTF8) &&
            uopt.flags & (1 << UDF_FLAG_NLS_MAP)) {
                udf_err(sb, "utf8 cannot be combined with iocharset\n");
-               goto error_out;
+               goto parse_options_failure;
        }
 #ifdef CONFIG_UDF_NLS
        if ((uopt.flags & (1 << UDF_FLAG_NLS_MAP)) && !uopt.nls_map) {
@@ -2094,15 +2160,19 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
 
        if (sbi->s_lvid_bh) {
                struct logicalVolIntegrityDescImpUse *lvidiu =
-                                                       udf_sb_lvidiu(sbi);
-               uint16_t minUDFReadRev = le16_to_cpu(lvidiu->minUDFReadRev);
-               uint16_t minUDFWriteRev = le16_to_cpu(lvidiu->minUDFWriteRev);
-               /* uint16_t maxUDFWriteRev =
-                               le16_to_cpu(lvidiu->maxUDFWriteRev); */
+                                                       udf_sb_lvidiu(sb);
+               uint16_t minUDFReadRev;
+               uint16_t minUDFWriteRev;
 
+               if (!lvidiu) {
+                       ret = -EINVAL;
+                       goto error_out;
+               }
+               minUDFReadRev = le16_to_cpu(lvidiu->minUDFReadRev);
+               minUDFWriteRev = le16_to_cpu(lvidiu->minUDFWriteRev);
                if (minUDFReadRev > UDF_MAX_READ_VERSION) {
                        udf_err(sb, "minUDFReadRev=%x (max is %x)\n",
-                               le16_to_cpu(lvidiu->minUDFReadRev),
+                               minUDFReadRev,
                                UDF_MAX_READ_VERSION);
                        ret = -EINVAL;
                        goto error_out;
@@ -2147,17 +2217,19 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
                         le16_to_cpu(ts.year), ts.month, ts.day,
                         ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone));
        }
-       if (!(sb->s_flags & MS_RDONLY))
+       if (!(sb->s_flags & MS_RDONLY)) {
                udf_open_lvid(sb);
+               lvid_open = true;
+       }
 
        /* Assign the root inode */
        /* assign inodes by physical block number */
        /* perhaps it's not extensible enough, but for now ... */
        inode = udf_iget(sb, &rootdir);
-       if (!inode) {
+       if (IS_ERR(inode)) {
                udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n",
                       rootdir.logicalBlockNum, rootdir.partitionReferenceNum);
-               ret = -EIO;
+               ret = PTR_ERR(inode);
                goto error_out;
        }
 
@@ -2173,13 +2245,13 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
        return 0;
 
 error_out:
-       if (sbi->s_vat_inode)
-               iput(sbi->s_vat_inode);
+       iput(sbi->s_vat_inode);
+parse_options_failure:
 #ifdef CONFIG_UDF_NLS
        if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
                unload_nls(sbi->s_nls_map);
 #endif
-       if (!(sb->s_flags & MS_RDONLY))
+       if (lvid_open)
                udf_close_lvid(sb);
        brelse(sbi->s_lvid_bh);
        udf_sb_free_partitions(sb);
@@ -2227,8 +2299,7 @@ static void udf_put_super(struct super_block *sb)
 
        sbi = UDF_SB(sb);
 
-       if (sbi->s_vat_inode)
-               iput(sbi->s_vat_inode);
+       iput(sbi->s_vat_inode);
 #ifdef CONFIG_UDF_NLS
        if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
                unload_nls(sbi->s_nls_map);
@@ -2237,6 +2308,7 @@ static void udf_put_super(struct super_block *sb)
                udf_close_lvid(sb);
        brelse(sbi->s_lvid_bh);
        udf_sb_free_partitions(sb);
+       mutex_destroy(&sbi->s_alloc_mutex);
        kfree(sb->s_fs_info);
        sb->s_fs_info = NULL;
 }
@@ -2266,11 +2338,7 @@ static int udf_statfs(struct dentry *dentry, struct kstatfs *buf)
        struct logicalVolIntegrityDescImpUse *lvidiu;
        u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
 
-       if (sbi->s_lvid_bh != NULL)
-               lvidiu = udf_sb_lvidiu(sbi);
-       else
-               lvidiu = NULL;
-
+       lvidiu = udf_sb_lvidiu(sb);
        buf->f_type = UDF_SUPER_MAGIC;
        buf->f_bsize = sb->s_blocksize;
        buf->f_blocks = sbi->s_partmaps[sbi->s_partition].s_partition_len;