Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'zonefs-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs into master

Pull zonefs fixes from Damien Le Moal:
"Two fixes, the first one to remove compilation warnings and the second
to avoid potentially inefficient allocation of BIOs for direct writes
into sequential zones"

* tag 'zonefs-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
zonefs: count pages after truncating the iterator
zonefs: Fix compilation warning

+11 -7
+11 -7
fs/zonefs/super.c
··· 607 607 int nr_pages; 608 608 ssize_t ret; 609 609 610 - nr_pages = iov_iter_npages(from, BIO_MAX_PAGES); 611 - if (!nr_pages) 612 - return 0; 613 - 614 610 max = queue_max_zone_append_sectors(bdev_get_queue(bdev)); 615 611 max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize); 616 612 iov_iter_truncate(from, max); 613 + 614 + nr_pages = iov_iter_npages(from, BIO_MAX_PAGES); 615 + if (!nr_pages) 616 + return 0; 617 617 618 618 bio = bio_alloc_bioset(GFP_NOFS, nr_pages, &fs_bio_set); 619 619 if (!bio) ··· 1119 1119 char *file_name; 1120 1120 struct dentry *dir; 1121 1121 unsigned int n = 0; 1122 - int ret = -ENOMEM; 1122 + int ret; 1123 1123 1124 1124 /* If the group is empty, there is nothing to do */ 1125 1125 if (!zd->nr_zones[type]) ··· 1135 1135 zgroup_name = "seq"; 1136 1136 1137 1137 dir = zonefs_create_inode(sb->s_root, zgroup_name, NULL, type); 1138 - if (!dir) 1138 + if (!dir) { 1139 + ret = -ENOMEM; 1139 1140 goto free; 1141 + } 1140 1142 1141 1143 /* 1142 1144 * The first zone contains the super block: skip it. ··· 1176 1174 * Use the file number within its group as file name. 1177 1175 */ 1178 1176 snprintf(file_name, ZONEFS_NAME_MAX - 1, "%u", n); 1179 - if (!zonefs_create_inode(dir, file_name, zone, type)) 1177 + if (!zonefs_create_inode(dir, file_name, zone, type)) { 1178 + ret = -ENOMEM; 1180 1179 goto free; 1180 + } 1181 1181 1182 1182 n++; 1183 1183 }