aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-05-17 02:17:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-17 02:17:59 -0400
commit0e0162bb8c008fa7742f69d4d4982c8a37b88f95 (patch)
tree4b230ab63b5698a44d2948e70a6cc22405c351e9 /fs/udf
parentae05327a00fd47c34dfe25294b359a3f3fef96e8 (diff)
parent38b78a5f18584db6fa7441e0f4531b283b0e6725 (diff)
Merge branch 'ovl-fixes' into for-linus
Backmerge to resolve a conflict in ovl_lookup_real(); "ovl_lookup_real(): use lookup_one_len_unlocked()" instead, but it was too late in the cycle to rebase.
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/super.c4
-rw-r--r--fs/udf/udfdecl.h2
-rw-r--r--fs/udf/unicode.c16
3 files changed, 17 insertions, 5 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index fa92fe839fda..36661acaf33b 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -919,14 +919,14 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
919#endif 919#endif
920 } 920 }
921 921
922 ret = udf_CS0toUTF8(outstr, 31, pvoldesc->volIdent, 32); 922 ret = udf_dstrCS0toUTF8(outstr, 31, pvoldesc->volIdent, 32);
923 if (ret < 0) 923 if (ret < 0)
924 goto out_bh; 924 goto out_bh;
925 925
926 strncpy(UDF_SB(sb)->s_volume_ident, outstr, ret); 926 strncpy(UDF_SB(sb)->s_volume_ident, outstr, ret);
927 udf_debug("volIdent[] = '%s'\n", UDF_SB(sb)->s_volume_ident); 927 udf_debug("volIdent[] = '%s'\n", UDF_SB(sb)->s_volume_ident);
928 928
929 ret = udf_CS0toUTF8(outstr, 127, pvoldesc->volSetIdent, 128); 929 ret = udf_dstrCS0toUTF8(outstr, 127, pvoldesc->volSetIdent, 128);
930 if (ret < 0) 930 if (ret < 0)
931 goto out_bh; 931 goto out_bh;
932 932
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index 972b70625614..263829ef1873 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -212,7 +212,7 @@ extern int udf_get_filename(struct super_block *, const uint8_t *, int,
212 uint8_t *, int); 212 uint8_t *, int);
213extern int udf_put_filename(struct super_block *, const uint8_t *, int, 213extern int udf_put_filename(struct super_block *, const uint8_t *, int,
214 uint8_t *, int); 214 uint8_t *, int);
215extern int udf_CS0toUTF8(uint8_t *, int, const uint8_t *, int); 215extern int udf_dstrCS0toUTF8(uint8_t *, int, const uint8_t *, int);
216 216
217/* ialloc.c */ 217/* ialloc.c */
218extern void udf_free_inode(struct inode *); 218extern void udf_free_inode(struct inode *);
diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c
index 3ff42f4437f3..695389a4fc23 100644
--- a/fs/udf/unicode.c
+++ b/fs/udf/unicode.c
@@ -335,9 +335,21 @@ try_again:
335 return u_len; 335 return u_len;
336} 336}
337 337
338int udf_CS0toUTF8(uint8_t *utf_o, int o_len, const uint8_t *ocu_i, int i_len) 338int udf_dstrCS0toUTF8(uint8_t *utf_o, int o_len,
339 const uint8_t *ocu_i, int i_len)
339{ 340{
340 return udf_name_from_CS0(utf_o, o_len, ocu_i, i_len, 341 int s_len = 0;
342
343 if (i_len > 0) {
344 s_len = ocu_i[i_len - 1];
345 if (s_len >= i_len) {
346 pr_err("incorrect dstring lengths (%d/%d)\n",
347 s_len, i_len);
348 return -EINVAL;
349 }
350 }
351
352 return udf_name_from_CS0(utf_o, o_len, ocu_i, s_len,
341 udf_uni2char_utf8, 0); 353 udf_uni2char_utf8, 0);
342} 354}
343 355