Skip to content

Commit 97eeb4d

Browse files
committed
Merge tag 'xfs-5.5-merge-16' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull XFS updates from Darrick Wong: "For this release, we changed quite a few things. Highlights: - Fixed some long tail latency problems in the block allocator - Removed some long deprecated (and for the past several years no-op) mount options and ioctls - Strengthened the extended attribute and directory verifiers - Audited and fixed all the places where we could return EFSCORRUPTED without logging anything - Refactored the old SGI space allocation ioctls to make the equivalent fallocate calls - Fixed a race between fallocate and directio - Fixed an integer overflow when files have more than a few billion(!) extents - Fixed a longstanding bug where quota accounting could be incorrect when performing unwritten extent conversion on a freshly mounted fs - Fixed various complaints in scrub about soft lockups and unresponsiveness to signals - De-vtable'd the directory handling code, which should make it faster - Converted to the new mount api, for better or for worse - Cleaned up some memory leaks and quite a lot of other smaller fixes and cleanups. A more detailed summary: - Fill out the build string - Prevent inode fork extent count overflows - Refactor the allocator to reduce long tail latency - Rework incore log locking a little to reduce spinning - Break up the xfs_iomap_begin functions into smaller more cohesive parts - Fix allocation alignment being dropped too early when the allocation request is for more blocks than an AG is large - Other small cleanups - Clean up file buftarg retrieval helpers - Hoist the resvsp and unresvsp ioctls to the vfs - Remove the undocumented biosize mount option, since it has never been mentioned as existing or supported on linux - Clean up some of the mount option printing and parsing - Enhance attr leaf verifier to check block structure - Check dirent and attr names for invalid characters before passing them to the vfs - Refactor open-coded bmbt walking - Fix a few places where we return EIO instead of EFSCORRUPTED after failing metadata sanity checks - Fix a synchronization problem between fallocate and aio dio corrupting the file length - Clean up various loose ends in the iomap and bmap code - Convert to the new mount api - Make sure we always log something when returning EFSCORRUPTED - Fix some problems where long running scrub loops could trigger soft lockup warnings and/or fail to exit due to fatal signals pending - Fix various Coverity complaints - Remove most of the function pointers from the directory code to reduce indirection penalties - Ensure that dquots are attached to the inode when performing unwritten extent conversion after io - Deuglify incore projid and crtime types - Fix another AGI/AGF locking order deadlock when renaming - Clean up some quota typedefs - Remove the FSSETDM ioctls which haven't done anything in 20 years - Fix some memory leaks when mounting the log fails - Fix an underflow when updating an xattr leaf freemap - Remove some trivial wrappers - Report metadata corruption as an error, not a (potentially) fatal assertion - Clean up the dir/attr buffer mapping code - Allow fatal signals to kill scrub during parent pointer checks" * tag 'xfs-5.5-merge-16' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (198 commits) xfs: allow parent directory scans to be interrupted with fatal signals xfs: remove the mappedbno argument to xfs_da_get_buf xfs: remove the mappedbno argument to xfs_da_read_buf xfs: split xfs_da3_node_read xfs: remove the mappedbno argument to xfs_dir3_leafn_read xfs: remove the mappedbno argument to xfs_dir3_leaf_read xfs: remove the mappedbno argument to xfs_attr3_leaf_read xfs: remove the mappedbno argument to xfs_da_reada_buf xfs: improve the xfs_dabuf_map calling conventions xfs: refactor xfs_dabuf_map xfs: simplify mappedbno handling in xfs_da_{get,read}_buf xfs: report corruption only as a regular error xfs: Remove kmem_zone_free() wrapper xfs: Remove kmem_zone_destroy() wrapper xfs: Remove slab init wrappers xfs: fix attr leaf header freemap.size underflow xfs: fix some memory leaks in log recovery xfs: fix another missing include xfs: remove XFS_IOC_FSSETDM and XFS_IOC_FSSETDM_BY_HANDLE xfs: remove duplicated include from xfs_dir2_data.c ...
2 parents 9b32694 + 8feb473 commit 97eeb4d

File tree

126 files changed

+5828
-6271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+5828
-6271
lines changed

fs/compat_ioctl.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,27 @@ COMPAT_SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd,
185185
/* handled by some ->ioctl(); always a pointer to int */
186186
case FIONREAD:
187187
goto found_handler;
188-
/* these two get messy on amd64 due to alignment differences */
188+
/* these get messy on amd64 due to alignment differences */
189189
#if defined(CONFIG_X86_64)
190190
case FS_IOC_RESVSP_32:
191191
case FS_IOC_RESVSP64_32:
192-
error = compat_ioctl_preallocate(f.file, compat_ptr(arg));
192+
error = compat_ioctl_preallocate(f.file, 0, compat_ptr(arg));
193+
goto out_fput;
194+
case FS_IOC_UNRESVSP_32:
195+
case FS_IOC_UNRESVSP64_32:
196+
error = compat_ioctl_preallocate(f.file, FALLOC_FL_PUNCH_HOLE,
197+
compat_ptr(arg));
198+
goto out_fput;
199+
case FS_IOC_ZERO_RANGE_32:
200+
error = compat_ioctl_preallocate(f.file, FALLOC_FL_ZERO_RANGE,
201+
compat_ptr(arg));
193202
goto out_fput;
194203
#else
195204
case FS_IOC_RESVSP:
196205
case FS_IOC_RESVSP64:
206+
case FS_IOC_UNRESVSP:
207+
case FS_IOC_UNRESVSP64:
208+
case FS_IOC_ZERO_RANGE:
197209
goto found_handler;
198210
#endif
199211

fs/ioctl.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ EXPORT_SYMBOL(generic_block_fiemap);
467467
* Only the l_start, l_len and l_whence fields of the 'struct space_resv'
468468
* are used here, rest are ignored.
469469
*/
470-
int ioctl_preallocate(struct file *filp, void __user *argp)
470+
int ioctl_preallocate(struct file *filp, int mode, void __user *argp)
471471
{
472472
struct inode *inode = file_inode(filp);
473473
struct space_resv sr;
@@ -488,13 +488,14 @@ int ioctl_preallocate(struct file *filp, void __user *argp)
488488
return -EINVAL;
489489
}
490490

491-
return vfs_fallocate(filp, FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
491+
return vfs_fallocate(filp, mode | FALLOC_FL_KEEP_SIZE, sr.l_start,
492+
sr.l_len);
492493
}
493494

494495
/* on ia32 l_start is on a 32-bit boundary */
495496
#if defined CONFIG_COMPAT && defined(CONFIG_X86_64)
496497
/* just account for different alignment */
497-
int compat_ioctl_preallocate(struct file *file,
498+
int compat_ioctl_preallocate(struct file *file, int mode,
498499
struct space_resv_32 __user *argp)
499500
{
500501
struct inode *inode = file_inode(file);
@@ -516,7 +517,7 @@ int compat_ioctl_preallocate(struct file *file,
516517
return -EINVAL;
517518
}
518519

519-
return vfs_fallocate(file, FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
520+
return vfs_fallocate(file, mode | FALLOC_FL_KEEP_SIZE, sr.l_start, sr.l_len);
520521
}
521522
#endif
522523

@@ -533,7 +534,12 @@ static int file_ioctl(struct file *filp, unsigned int cmd,
533534
return put_user(i_size_read(inode) - filp->f_pos, p);
534535
case FS_IOC_RESVSP:
535536
case FS_IOC_RESVSP64:
536-
return ioctl_preallocate(filp, p);
537+
return ioctl_preallocate(filp, 0, p);
538+
case FS_IOC_UNRESVSP:
539+
case FS_IOC_UNRESVSP64:
540+
return ioctl_preallocate(filp, FALLOC_FL_PUNCH_HOLE, p);
541+
case FS_IOC_ZERO_RANGE:
542+
return ioctl_preallocate(filp, FALLOC_FL_ZERO_RANGE, p);
537543
}
538544

539545
return vfs_ioctl(filp, cmd, arg);

fs/xfs/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ xfs-y += $(addprefix libxfs/, \
2727
xfs_bmap_btree.o \
2828
xfs_btree.o \
2929
xfs_da_btree.o \
30-
xfs_da_format.o \
3130
xfs_defer.o \
3231
xfs_dir2.o \
3332
xfs_dir2_block.o \

fs/xfs/kmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ kmem_alloc(size_t size, xfs_km_flags_t flags)
3232

3333

3434
/*
35-
* __vmalloc() will allocate data pages and auxillary structures (e.g.
35+
* __vmalloc() will allocate data pages and auxiliary structures (e.g.
3636
* pagetables) with GFP_KERNEL, yet we may be under GFP_NOFS context here. Hence
3737
* we need to tell memory reclaim that we are in such a context via
3838
* PF_MEMALLOC_NOFS to prevent memory reclaim re-entering the filesystem here

fs/xfs/kmem.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -78,39 +78,9 @@ kmem_zalloc_large(size_t size, xfs_km_flags_t flags)
7878
* Zone interfaces
7979
*/
8080

81-
#define KM_ZONE_HWALIGN SLAB_HWCACHE_ALIGN
82-
#define KM_ZONE_RECLAIM SLAB_RECLAIM_ACCOUNT
83-
#define KM_ZONE_SPREAD SLAB_MEM_SPREAD
84-
#define KM_ZONE_ACCOUNT SLAB_ACCOUNT
85-
8681
#define kmem_zone kmem_cache
8782
#define kmem_zone_t struct kmem_cache
8883

89-
static inline kmem_zone_t *
90-
kmem_zone_init(int size, char *zone_name)
91-
{
92-
return kmem_cache_create(zone_name, size, 0, 0, NULL);
93-
}
94-
95-
static inline kmem_zone_t *
96-
kmem_zone_init_flags(int size, char *zone_name, slab_flags_t flags,
97-
void (*construct)(void *))
98-
{
99-
return kmem_cache_create(zone_name, size, 0, flags, construct);
100-
}
101-
102-
static inline void
103-
kmem_zone_free(kmem_zone_t *zone, void *ptr)
104-
{
105-
kmem_cache_free(zone, ptr);
106-
}
107-
108-
static inline void
109-
kmem_zone_destroy(kmem_zone_t *zone)
110-
{
111-
kmem_cache_destroy(zone);
112-
}
113-
11484
extern void *kmem_zone_alloc(kmem_zone_t *, xfs_km_flags_t);
11585

11686
static inline void *

fs/xfs/libxfs/xfs_ag_resv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "xfs_btree.h"
2020
#include "xfs_refcount_btree.h"
2121
#include "xfs_ialloc_btree.h"
22+
#include "xfs_sb.h"
23+
#include "xfs_ag_resv.h"
2224

2325
/*
2426
* Per-AG Block Reservations

0 commit comments

Comments
 (0)