Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1403295 > unrolled thread
| Started by | Alden Tondettar <alden.tondettar@gmail.com> |
|---|---|
| First post | 2016-05-18 23:20 +0200 |
| Last post | 2016-05-19 12:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/3] udf: Use IS_ERR when loading metadata mirror file entry Alden Tondettar <alden.tondettar@gmail.com> - 2016-05-18 23:20 +0200
Re: [PATCH 2/3] udf: Use IS_ERR when loading metadata mirror file entry Jan Kara <jack@suse.cz> - 2016-05-19 12:30 +0200
| From | Alden Tondettar <alden.tondettar@gmail.com> |
|---|---|
| Date | 2016-05-18 23:20 +0200 |
| Subject | [PATCH 2/3] udf: Use IS_ERR when loading metadata mirror file entry |
| Message-ID | <rAh2N-7md-5@gated-at.bofh.it> |
Currently when udf_get_pblock_meta25() fails to map a block using the
primary metadata file, it will attempt to load the mirror file entry by
calling udf_find_metadata_inode_efe(). That function will return a ERR_PTR
if it fails, but the return value is only checked against NULL. Test the
return value using IS_ERR() and change it to NULL if needed.
Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
---
fs/udf/partition.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/udf/partition.c b/fs/udf/partition.c
index e4e9e70..ca3cde3 100644
--- a/fs/udf/partition.c
+++ b/fs/udf/partition.c
@@ -326,6 +326,8 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block,
if (!(mdata->s_flags & MF_MIRROR_FE_LOADED)) {
mdata->s_mirror_fe = udf_find_metadata_inode_efe(sb,
mdata->s_mirror_file_loc, map->s_partition_num);
+ if (IS_ERR(mdata->s_mirror_fe))
+ mdata->s_mirror_fe = NULL;
mdata->s_flags |= MF_MIRROR_FE_LOADED;
}
--
2.1.4
[toc] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2016-05-19 12:30 +0200 |
| Subject | Re: [PATCH 2/3] udf: Use IS_ERR when loading metadata mirror file entry |
| Message-ID | <rAtnk-6Tf-19@gated-at.bofh.it> |
| In reply to | #1403295 |
On Wed 18-05-16 14:09:18, Alden Tondettar wrote:
> Currently when udf_get_pblock_meta25() fails to map a block using the
> primary metadata file, it will attempt to load the mirror file entry by
> calling udf_find_metadata_inode_efe(). That function will return a ERR_PTR
> if it fails, but the return value is only checked against NULL. Test the
> return value using IS_ERR() and change it to NULL if needed.
>
> Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
Thanks. I have added this patch to my tree.
Honza
> ---
> fs/udf/partition.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/udf/partition.c b/fs/udf/partition.c
> index e4e9e70..ca3cde3 100644
> --- a/fs/udf/partition.c
> +++ b/fs/udf/partition.c
> @@ -326,6 +326,8 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block,
> if (!(mdata->s_flags & MF_MIRROR_FE_LOADED)) {
> mdata->s_mirror_fe = udf_find_metadata_inode_efe(sb,
> mdata->s_mirror_file_loc, map->s_partition_num);
> + if (IS_ERR(mdata->s_mirror_fe))
> + mdata->s_mirror_fe = NULL;
> mdata->s_flags |= MF_MIRROR_FE_LOADED;
> }
>
> --
> 2.1.4
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web