From f41d5a4d059104e3ece31e7cf7247126910ee59e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 28 Oct 2024 02:13:37 +0100 Subject: [PATCH] drop queue-5.15/udf-refactor-udf_current_aext-to-handle-error.patch breaks the build :( --- queue-5.15/series | 1 - ...nit-value-use-in-udf_get_fileshortad.patch | 9 +- ...tor-udf_current_aext-to-handle-error.patch | 187 ------------------ 3 files changed, 2 insertions(+), 195 deletions(-) delete mode 100644 queue-5.15/udf-refactor-udf_current_aext-to-handle-error.patch diff --git a/queue-5.15/series b/queue-5.15/series index 08d5481f0a7..544c10317b0 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -42,7 +42,6 @@ drm-vboxvideo-replace-fake-vla-at-end-of-vbva_mouse_.patch asoc-codecs-lpass-rx-macro-add-missing-cdc_rx_bcl_vb.patch asoc-fsl_sai-enable-fifo-continue-on-error-fcont-bit.patch arm64-force-position-independent-veneers.patch -udf-refactor-udf_current_aext-to-handle-error.patch udf-fix-uninit-value-use-in-udf_get_fileshortad.patch asoc-qcom-sm8250-add-qrb4210-rb2-sndcard-compatible-.patch platform-x86-dell-sysman-add-support-for-alienware-p.patch diff --git a/queue-5.15/udf-fix-uninit-value-use-in-udf_get_fileshortad.patch b/queue-5.15/udf-fix-uninit-value-use-in-udf_get_fileshortad.patch index 0561c95dfba..42ea9cb831d 100644 --- a/queue-5.15/udf-fix-uninit-value-use-in-udf_get_fileshortad.patch +++ b/queue-5.15/udf-fix-uninit-value-use-in-udf_get_fileshortad.patch @@ -23,14 +23,12 @@ Signed-off-by: Jan Kara Link: https://patch.msgid.link/20240925074613.8475-3-gianf.trad@gmail.com Signed-off-by: Sasha Levin --- - fs/udf/inode.c | 9 ++++++--- + fs/udf/inode.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -diff --git a/fs/udf/inode.c b/fs/udf/inode.c -index 443d747bcec2e..81bd01ea89eb6 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c -@@ -2112,12 +2112,15 @@ int udf_current_aext(struct inode *inode, struct extent_position *epos, +@@ -2100,12 +2100,15 @@ int8_t udf_current_aext(struct inode *in alen = udf_file_entry_alloc_offset(inode) + iinfo->i_lenAlloc; } else { @@ -49,6 +47,3 @@ index 443d747bcec2e..81bd01ea89eb6 100644 } switch (iinfo->i_alloc_type) { --- -2.43.0 - diff --git a/queue-5.15/udf-refactor-udf_current_aext-to-handle-error.patch b/queue-5.15/udf-refactor-udf_current_aext-to-handle-error.patch deleted file mode 100644 index e5341d309ad..00000000000 --- a/queue-5.15/udf-refactor-udf_current_aext-to-handle-error.patch +++ /dev/null @@ -1,187 +0,0 @@ -From 29a1ad6e9d5f6e43b6d735f0c4c6074d789db03b Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 1 Oct 2024 19:54:23 +0800 -Subject: udf: refactor udf_current_aext() to handle error - -From: Zhao Mengmeng - -[ Upstream commit ee703a7068f95764cfb62b57db1d36e465cb9b26 ] - -As Jan suggested in links below, refactor udf_current_aext() to -differentiate between error, hit EOF and success, it now takes pointer to -etype to store the extent type, return 1 when getting etype success, -return 0 when hitting EOF and return -errno when err. - -Link: https://lore.kernel.org/all/20240912111235.6nr3wuqvktecy3vh@quack3/ -Signed-off-by: Zhao Mengmeng -Suggested-by: Jan Kara -Signed-off-by: Jan Kara -Link: https://patch.msgid.link/20241001115425.266556-2-zhaomzhao@126.com -Signed-off-by: Sasha Levin ---- - fs/udf/inode.c | 40 ++++++++++++++++++++++++++-------------- - fs/udf/truncate.c | 10 ++++++++-- - fs/udf/udfdecl.h | 5 +++-- - 3 files changed, 37 insertions(+), 18 deletions(-) - -diff --git a/fs/udf/inode.c b/fs/udf/inode.c -index e68490991f5c6..443d747bcec2e 100644 ---- a/fs/udf/inode.c -+++ b/fs/udf/inode.c -@@ -1843,6 +1843,7 @@ int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block, - struct extent_position nepos; - struct kernel_lb_addr neloc; - int ver, adsize; -+ int err = 0; - - if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT) - adsize = sizeof(struct short_ad); -@@ -1887,10 +1888,12 @@ int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block, - if (epos->offset + adsize > sb->s_blocksize) { - struct kernel_lb_addr cp_loc; - uint32_t cp_len; -- int cp_type; -+ int8_t cp_type; - - epos->offset -= adsize; -- cp_type = udf_current_aext(inode, epos, &cp_loc, &cp_len, 0); -+ err = udf_current_aext(inode, epos, &cp_loc, &cp_len, &cp_type, 0); -+ if (err <= 0) -+ goto err_out; - cp_len |= ((uint32_t)cp_type) << 30; - - __udf_add_aext(inode, &nepos, &cp_loc, cp_len, 1); -@@ -1905,6 +1908,9 @@ int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block, - *epos = nepos; - - return 0; -+err_out: -+ brelse(bh); -+ return err; - } - - /* -@@ -2055,9 +2061,12 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos, - { - int8_t etype; - unsigned int indirections = 0; -+ int ret = 0; - -- while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) == -- (EXT_NEXT_EXTENT_ALLOCDESCS >> 30)) { -+ while ((ret = udf_current_aext(inode, epos, eloc, elen, -+ &etype, inc)) > 0) { -+ if (etype != (EXT_NEXT_EXTENT_ALLOCDESCS >> 30)) -+ break; - udf_pblk_t block; - - if (++indirections > UDF_MAX_INDIR_EXTS) { -@@ -2078,14 +2087,17 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos, - } - } - -- return etype; -+ return ret > 0 ? etype : -1; - } - --int8_t udf_current_aext(struct inode *inode, struct extent_position *epos, -- struct kernel_lb_addr *eloc, uint32_t *elen, int inc) -+/* -+ * Returns 1 on success, -errno on error, 0 on hit EOF. -+ */ -+int udf_current_aext(struct inode *inode, struct extent_position *epos, -+ struct kernel_lb_addr *eloc, uint32_t *elen, int8_t *etype, -+ int inc) - { - int alen; -- int8_t etype; - uint8_t *ptr; - struct short_ad *sad; - struct long_ad *lad; -@@ -2112,8 +2124,8 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos, - case ICBTAG_FLAG_AD_SHORT: - sad = udf_get_fileshortad(ptr, alen, &epos->offset, inc); - if (!sad) -- return -1; -- etype = le32_to_cpu(sad->extLength) >> 30; -+ return 0; -+ *etype = le32_to_cpu(sad->extLength) >> 30; - eloc->logicalBlockNum = le32_to_cpu(sad->extPosition); - eloc->partitionReferenceNum = - iinfo->i_location.partitionReferenceNum; -@@ -2122,17 +2134,17 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos, - case ICBTAG_FLAG_AD_LONG: - lad = udf_get_filelongad(ptr, alen, &epos->offset, inc); - if (!lad) -- return -1; -- etype = le32_to_cpu(lad->extLength) >> 30; -+ return 0; -+ *etype = le32_to_cpu(lad->extLength) >> 30; - *eloc = lelb_to_cpu(lad->extLocation); - *elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK; - break; - default: - udf_debug("alloc_type = %u unsupported\n", iinfo->i_alloc_type); -- return -1; -+ return -EINVAL; - } - -- return etype; -+ return 1; - } - - static int udf_insert_aext(struct inode *inode, struct extent_position epos, -diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c -index 036ebd892b852..f0de6e106ce65 100644 ---- a/fs/udf/truncate.c -+++ b/fs/udf/truncate.c -@@ -192,6 +192,7 @@ int udf_truncate_extents(struct inode *inode) - loff_t byte_offset; - int adsize; - struct udf_inode_info *iinfo = UDF_I(inode); -+ int ret = 0; - - if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) - adsize = sizeof(struct short_ad); -@@ -221,8 +222,8 @@ int udf_truncate_extents(struct inode *inode) - else - lenalloc -= sizeof(struct allocExtDesc); - -- while ((etype = udf_current_aext(inode, &epos, &eloc, -- &elen, 0)) != -1) { -+ while ((ret = udf_current_aext(inode, &epos, &eloc, -+ &elen, &etype, 0)) > 0) { - if (etype == (EXT_NEXT_EXTENT_ALLOCDESCS >> 30)) { - udf_write_aext(inode, &epos, &neloc, nelen, 0); - if (indirect_ext_len) { -@@ -257,6 +258,11 @@ int udf_truncate_extents(struct inode *inode) - } - } - -+ if (ret < 0) { -+ brelse(epos.bh); -+ return ret; -+ } -+ - if (indirect_ext_len) { - BUG_ON(!epos.bh); - udf_free_blocks(sb, NULL, &epos.block, 0, indirect_ext_len); -diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h -index f764b4d15094d..aa0e17d81b06e 100644 ---- a/fs/udf/udfdecl.h -+++ b/fs/udf/udfdecl.h -@@ -174,8 +174,9 @@ extern void udf_write_aext(struct inode *, struct extent_position *, - extern int8_t udf_delete_aext(struct inode *, struct extent_position); - extern int8_t udf_next_aext(struct inode *, struct extent_position *, - struct kernel_lb_addr *, uint32_t *, int); --extern int8_t udf_current_aext(struct inode *, struct extent_position *, -- struct kernel_lb_addr *, uint32_t *, int); -+extern int udf_current_aext(struct inode *inode, struct extent_position *epos, -+ struct kernel_lb_addr *eloc, uint32_t *elen, -+ int8_t *etype, int inc); - extern void udf_update_extra_perms(struct inode *inode, umode_t mode); - - /* misc.c */ --- -2.43.0 - -- 2.47.2