* [PATCH] UDF: During mount free lvid_bh before rescanning with different blocksize
@ 2012-07-21 11:05 Ashish Sangwan
2012-08-12 4:03 ` Namjae Jeon
2012-08-14 13:25 ` Jan Kara
0 siblings, 2 replies; 4+ messages in thread
From: Ashish Sangwan @ 2012-07-21 11:05 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-kernel, Ashish Sangwan, Namjae Jeon
If s_lvid_bh is not freed and set to NULL before re-scanning partition
with default block size, we might end up using wrong lvid in case
s_lvid_bh is not updated in udf_load_logicalvolint during rescan.
Signed-off-by: Ashish Sangwan <ashish.sangwan2@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
---
fs/udf/super.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index ac8a348..4a95c56 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1961,6 +1961,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
if (!silent)
pr_notice("Rescanning with blocksize %d\n",
UDF_DEFAULT_BLOCKSIZE);
+ brelse(sbi->s_lvid_bh);
+ sbi->s_lvid_bh = NULL;
uopt.blocksize = UDF_DEFAULT_BLOCKSIZE;
ret = udf_load_vrs(sb, &uopt, silent, &fileset);
}
--
1.7.2.3
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] UDF: During mount free lvid_bh before rescanning with different blocksize
2012-07-21 11:05 [PATCH] UDF: During mount free lvid_bh before rescanning with different blocksize Ashish Sangwan
@ 2012-08-12 4:03 ` Namjae Jeon
2012-08-14 13:25 ` Jan Kara
1 sibling, 0 replies; 4+ messages in thread
From: Namjae Jeon @ 2012-08-12 4:03 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-kernel, Ashish Sangwan
Hi. Jan.
Would you check this patch also ?
Thanks.
2012/7/21, Ashish Sangwan <ashishsangwan2@gmail.com>:
> If s_lvid_bh is not freed and set to NULL before re-scanning partition
> with default block size, we might end up using wrong lvid in case
> s_lvid_bh is not updated in udf_load_logicalvolint during rescan.
>
> Signed-off-by: Ashish Sangwan <ashish.sangwan2@gmail.com>
> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
>
> ---
> fs/udf/super.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index ac8a348..4a95c56 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -1961,6 +1961,8 @@ static int udf_fill_super(struct super_block *sb, void
> *options, int silent)
> if (!silent)
> pr_notice("Rescanning with blocksize %d\n",
> UDF_DEFAULT_BLOCKSIZE);
> + brelse(sbi->s_lvid_bh);
> + sbi->s_lvid_bh = NULL;
> uopt.blocksize = UDF_DEFAULT_BLOCKSIZE;
> ret = udf_load_vrs(sb, &uopt, silent, &fileset);
> }
> --
> 1.7.2.3
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] UDF: During mount free lvid_bh before rescanning with different blocksize
2012-07-21 11:05 [PATCH] UDF: During mount free lvid_bh before rescanning with different blocksize Ashish Sangwan
2012-08-12 4:03 ` Namjae Jeon
@ 2012-08-14 13:25 ` Jan Kara
2012-08-15 4:44 ` Ashish Sangwan
1 sibling, 1 reply; 4+ messages in thread
From: Jan Kara @ 2012-08-14 13:25 UTC (permalink / raw)
To: Ashish Sangwan; +Cc: Jan Kara, linux-kernel, Ashish Sangwan, Namjae Jeon
On Sat 21-07-12 16:35:17, Ashish Sangwan wrote:
> If s_lvid_bh is not freed and set to NULL before re-scanning partition
> with default block size, we might end up using wrong lvid in case
> s_lvid_bh is not updated in udf_load_logicalvolint during rescan.
>
> Signed-off-by: Ashish Sangwan <ashish.sangwan2@gmail.com>
> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Yeah, I don't think this happens in practice but in theory it could. BTW,
did you check whether we don't need to free other information (like VAT
inode etc.) when rescanning the filesystem? I think we do but currently I'm
catching up after a long vacation and this doesn't have high priority.
Anyway, I've added your patch to my tree. Thanks.
Honza
>
> ---
> fs/udf/super.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index ac8a348..4a95c56 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -1961,6 +1961,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
> if (!silent)
> pr_notice("Rescanning with blocksize %d\n",
> UDF_DEFAULT_BLOCKSIZE);
> + brelse(sbi->s_lvid_bh);
> + sbi->s_lvid_bh = NULL;
> uopt.blocksize = UDF_DEFAULT_BLOCKSIZE;
> ret = udf_load_vrs(sb, &uopt, silent, &fileset);
> }
> --
> 1.7.2.3
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] UDF: During mount free lvid_bh before rescanning with different blocksize
2012-08-14 13:25 ` Jan Kara
@ 2012-08-15 4:44 ` Ashish Sangwan
0 siblings, 0 replies; 4+ messages in thread
From: Ashish Sangwan @ 2012-08-15 4:44 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-kernel, Ashish Sangwan, Namjae Jeon
Hi Jan,
> Yeah, I don't think this happens in practice but in theory it could. BTW,
> did you check whether we don't need to free other information (like VAT
> inode etc.) when rescanning the filesystem? I think we do but currently I'm
> catching up after a long vacation and this doesn't have high priority.
>
Actually, it did happen in practice. That's how we discovered it.
Currently, it seems a bug.
We formatted a usb stick, sector size 512bytes, using mkudffs with
default block size 2KB.
While writing to this media we unplug the USB which left lvid in
corrupted state.
On remounting, first UDF tries to mount the media with sector size and
somehow it managed to fill lvid bh
but failed to load metadata/mirror fe because of wrong block size.
While rescanning with 2KB block size it failed to load the correct
lvid as it was corrupted earlier
and ended up using the wrong one.
After noticing this problem, we did check other info too. Everything
else seems to be correct.
> Anyway, I've added your patch to my tree. Thanks.
>
Thanks for looking into the patch.
Ashish
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-15 4:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21 11:05 [PATCH] UDF: During mount free lvid_bh before rescanning with different blocksize Ashish Sangwan
2012-08-12 4:03 ` Namjae Jeon
2012-08-14 13:25 ` Jan Kara
2012-08-15 4:44 ` Ashish Sangwan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®