Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140007
b: refs/heads/master
c: ba9aadd
h: refs/heads/master
i:
  140005: dd35cb2
  140003: 5491f7e
  139999: 4e33444
v: v3
  • Loading branch information
Marcin Slusarz authored and Jan Kara committed Apr 2, 2009
1 parent edf5bb1 commit 3c5d607
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97e961fdbf32488b7386c9f1effa2bee97d47929
refs/heads/master: ba9aadd80c24775e55a93ebe0c2491b4d2899257
36 changes: 25 additions & 11 deletions trunk/fs/udf/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,14 +902,23 @@ static int udf_find_fileset(struct super_block *sb,
static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
{
struct primaryVolDesc *pvoldesc;
struct ustr instr;
struct ustr outstr;
struct ustr *instr, *outstr;
struct buffer_head *bh;
uint16_t ident;
int ret = 1;

instr = kmalloc(sizeof(struct ustr), GFP_NOFS);
if (!instr)
return 1;

outstr = kmalloc(sizeof(struct ustr), GFP_NOFS);
if (!outstr)
goto out1;

bh = udf_read_tagged(sb, block, block, &ident);
if (!bh)
return 1;
goto out2;

BUG_ON(ident != TAG_IDENT_PVD);

pvoldesc = (struct primaryVolDesc *)bh->b_data;
Expand All @@ -925,20 +934,25 @@ 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);
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->volSetIdent, 128))
if (udf_CS0toUTF8(&outstr, &instr))
udf_debug("volSetIdent[] = '%s'\n", outstr.u_name);
if (!udf_build_ustr(instr, pvoldesc->volSetIdent, 128))
if (udf_CS0toUTF8(outstr, instr))
udf_debug("volSetIdent[] = '%s'\n", outstr->u_name);

brelse(bh);
return 0;
ret = 0;
out2:
kfree(outstr);
out1:
kfree(instr);
return ret;
}

static int udf_load_metadata_files(struct super_block *sb, int partition)
Expand Down

0 comments on commit 3c5d607

Please sign in to comment.