Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1527546
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] f2fs: fix 32-bit build |
| Date | 2016-11-22 15:30 +0100 |
| Message-ID | <sGkf7-8lc-15@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
The addition of multiple-device support broke CONFIG_BLK_DEV_ZONED
on 32-bit machines because of a 64-bit division:
fs/f2fs/f2fs.o: In function `__issue_discard_async':
extent_cache.c:(.text.__issue_discard_async+0xd4): undefined reference to `__aeabi_uldivmod'
Unfortunately, the sector number is usually a 64-bit number, and
we probably can't guarantee that bdev_zone_size() returns a
power-of-two number, so we actually have to do the expensive 64-bit
operation to get the remainder.
Fixes: 792b84b74b54 ("f2fs: support multiple devices")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
fs/f2fs/segment.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 634834e5a232..e4c5497aa172 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -685,6 +685,7 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
{
sector_t nr_sects = SECTOR_FROM_BLOCK(blklen);
sector_t sector;
+ u32 rem;
int devi = 0;
if (sbi->s_ndevs) {
@@ -693,7 +694,8 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
}
sector = SECTOR_FROM_BLOCK(blkstart);
- if (sector % bdev_zone_size(bdev) || nr_sects != bdev_zone_size(bdev)) {
+ div_u64_rem(sector, bdev_zone_size(bdev), &rem);
+ if (rem || nr_sects != bdev_zone_size(bdev)) {
f2fs_msg(sbi->sb, KERN_INFO,
"(%d) %s: Unaligned discard attempted (block %x + %x)",
devi, sbi->s_ndevs ? FDEV(devi).path: "",
--
2.9.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] f2fs: fix 32-bit build Arnd Bergmann <arnd@arndb.de> - 2016-11-22 15:30 +0100
Re: [PATCH] f2fs: fix 32-bit build Jaegeuk Kim <jaegeuk@kernel.org> - 2016-11-23 19:50 +0100
Re: [PATCH] f2fs: fix 32-bit build Arnd Bergmann <arnd@arndb.de> - 2016-11-23 22:10 +0100
Re: [PATCH] f2fs: fix 32-bit build Jaegeuk Kim <jaegeuk@kernel.org> - 2016-11-23 22:20 +0100
csiph-web