Unverified Commit 635dad6d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15402 nilfs2: fix possible int overflows in nilfs_fiemap()

parents 9e19c33d e3fa2ef7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1267,7 +1267,7 @@ int nilfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
			if (size) {
				if (phys && blkphy << blkbits == phys + size) {
					/* The current extent goes on */
					size += n << blkbits;
					size += (u64)n << blkbits;
				} else {
					/* Terminate the current extent */
					ret = fiemap_fill_next_extent(
@@ -1280,14 +1280,14 @@ int nilfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
					flags = FIEMAP_EXTENT_MERGED;
					logical = blkoff << blkbits;
					phys = blkphy << blkbits;
					size = n << blkbits;
					size = (u64)n << blkbits;
				}
			} else {
				/* Start a new extent */
				flags = FIEMAP_EXTENT_MERGED;
				logical = blkoff << blkbits;
				phys = blkphy << blkbits;
				size = n << blkbits;
				size = (u64)n << blkbits;
			}
			blkoff += n;
		}