Re: [PATCH] udf: fix dvd mounting error

From: Jan Kara
Date: Mon Nov 19 2018 - 04:25:19 EST


On Fri 16-11-18 14:33:14, Sudip Mukherjee wrote:
> > From e1a7680b960fe25821f2419b4c0b1215f8ab2f9b Mon Sep 17 00:00:00 2001
> > From: Jan Kara <jack@xxxxxxx>
> > Date: Fri, 16 Nov 2018 13:43:17 +0100
> > Subject: [PATCH] udf: Allow mounting volumes with incorrect identification
> > strings
> >
> > Commit c26f6c615788 ("udf: Fix conversion of 'dstring' fields to UTF8")
> > started to be more strict when checking whether converted strings are
> > properly formatted. Sudip reports that there are DVDs where the volume
> > identification string is actually too long - UDF reports:
> >
> > [ 632.309320] UDF-fs: incorrect dstring lengths (32/32)
> >
> > during mount and fails the mount. This is mostly harmless failure as we
> > don't need volume identification (and even less volume set
> > identification) for anything. So just truncate the volume identification
> > string if it is too long and replace it with 'Invalid' if we just cannot
> > convert it for other reasons. This keeps slightly incorrect media still
> > mountable.
> >
> > CC: stable@xxxxxxxxxxxxxxx
> > Fixes: c26f6c615788 ("udf: Fix conversion of 'dstring' fields to UTF8")
> > Reported-by: Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx>
> > Signed-off-by: Jan Kara <jack@xxxxxxx>
> > ---
>
> It works perfectly. Thanks.
>
> Tested-by: Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx>

Thanks for testing!

> > - if (ret < 0)
> > - goto out_bh;
> > -
> > - strncpy(UDF_SB(sb)->s_volume_ident, outstr, ret);
> > + if (ret < 0) {
> > + strcpy(UDF_SB(sb)->s_volume_ident, "Invalid");
>
> Just a suggestion. Even on failed cases, having the volume identification
> as "Invalid" might confuse the users. Since you have a maximum limit as 31
> maybe something more meaningful like "No Name" ?

I agree something long might be better. I think 'InvalidName' might be
better than 'No Name'. Thanks for suggestion.

Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR