diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-26 14:36:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-26 14:36:20 -0400 |
commit | 2268419e4c9559ec1e80ee7ae7bd54f8976234cb (patch) | |
tree | f135d7cc61dae81d88cf023abbd3c687033437c5 | |
parent | dadedd85630af28b21c826265f7a651f040f6f13 (diff) | |
parent | 88d32d3983e72f2a7de72a49b701e2529c48e9c1 (diff) |
Merge tag 'xfs-5.4-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fixes from Darrick Wong:
"There are a couple of bug fixes and some small code cleanups that came
in recently:
- Minor code cleanups
- Fix a superblock logging error
- Ensure that collapse range converts the data fork to extents format
when necessary
- Revert the ALLOC_USERDATA cleanup because it caused subtle behavior
regressions"
* tag 'xfs-5.4-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: avoid unused to_mp() function warning
xfs: log proper length of superblock
xfs: revert 1baa2800e62d ("xfs: remove the unused XFS_ALLOC_USERDATA flag")
xfs: removed unneeded variable
xfs: convert inode to extent format after extent merge due to shift
-rw-r--r-- | fs/xfs/libxfs/xfs_alloc.h | 7 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 13 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_sb.c | 2 | ||||
-rw-r--r-- | fs/xfs/scrub/alloc.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_sysfs.c | 13 |
5 files changed, 17 insertions, 21 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.h b/fs/xfs/libxfs/xfs_alloc.h index 58fa85cec325..d6ed5d2c07c2 100644 --- a/fs/xfs/libxfs/xfs_alloc.h +++ b/fs/xfs/libxfs/xfs_alloc.h | |||
@@ -81,9 +81,10 @@ typedef struct xfs_alloc_arg { | |||
81 | /* | 81 | /* |
82 | * Defines for datatype | 82 | * Defines for datatype |
83 | */ | 83 | */ |
84 | #define XFS_ALLOC_INITIAL_USER_DATA (1 << 0)/* special case start of file */ | 84 | #define XFS_ALLOC_USERDATA (1 << 0)/* allocation is for user data*/ |
85 | #define XFS_ALLOC_USERDATA_ZERO (1 << 1)/* zero extent on allocation */ | 85 | #define XFS_ALLOC_INITIAL_USER_DATA (1 << 1)/* special case start of file */ |
86 | #define XFS_ALLOC_NOBUSY (1 << 2)/* Busy extents not allowed */ | 86 | #define XFS_ALLOC_USERDATA_ZERO (1 << 2)/* zero extent on allocation */ |
87 | #define XFS_ALLOC_NOBUSY (1 << 3)/* Busy extents not allowed */ | ||
87 | 88 | ||
88 | static inline bool | 89 | static inline bool |
89 | xfs_alloc_is_userdata(int datatype) | 90 | xfs_alloc_is_userdata(int datatype) |
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 054b4ce30033..4edc25a2ba80 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c | |||
@@ -4042,8 +4042,12 @@ xfs_bmapi_allocate( | |||
4042 | */ | 4042 | */ |
4043 | if (!(bma->flags & XFS_BMAPI_METADATA)) { | 4043 | if (!(bma->flags & XFS_BMAPI_METADATA)) { |
4044 | bma->datatype = XFS_ALLOC_NOBUSY; | 4044 | bma->datatype = XFS_ALLOC_NOBUSY; |
4045 | if (whichfork == XFS_DATA_FORK && bma->offset == 0) | 4045 | if (whichfork == XFS_DATA_FORK) { |
4046 | bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA; | 4046 | if (bma->offset == 0) |
4047 | bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA; | ||
4048 | else | ||
4049 | bma->datatype |= XFS_ALLOC_USERDATA; | ||
4050 | } | ||
4047 | if (bma->flags & XFS_BMAPI_ZERO) | 4051 | if (bma->flags & XFS_BMAPI_ZERO) |
4048 | bma->datatype |= XFS_ALLOC_USERDATA_ZERO; | 4052 | bma->datatype |= XFS_ALLOC_USERDATA_ZERO; |
4049 | } | 4053 | } |
@@ -5621,6 +5625,11 @@ xfs_bmse_merge( | |||
5621 | if (error) | 5625 | if (error) |
5622 | return error; | 5626 | return error; |
5623 | 5627 | ||
5628 | /* change to extent format if required after extent removal */ | ||
5629 | error = xfs_bmap_btree_to_extents(tp, ip, cur, logflags, whichfork); | ||
5630 | if (error) | ||
5631 | return error; | ||
5632 | |||
5624 | done: | 5633 | done: |
5625 | xfs_iext_remove(ip, icur, 0); | 5634 | xfs_iext_remove(ip, icur, 0); |
5626 | xfs_iext_prev(XFS_IFORK_PTR(ip, whichfork), icur); | 5635 | xfs_iext_prev(XFS_IFORK_PTR(ip, whichfork), icur); |
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index a08dd8f40346..ac6cdca63e15 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c | |||
@@ -928,7 +928,7 @@ xfs_log_sb( | |||
928 | 928 | ||
929 | xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb); | 929 | xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb); |
930 | xfs_trans_buf_set_type(tp, bp, XFS_BLFT_SB_BUF); | 930 | xfs_trans_buf_set_type(tp, bp, XFS_BLFT_SB_BUF); |
931 | xfs_trans_log_buf(tp, bp, 0, sizeof(struct xfs_dsb)); | 931 | xfs_trans_log_buf(tp, bp, 0, sizeof(struct xfs_dsb) - 1); |
932 | } | 932 | } |
933 | 933 | ||
934 | /* | 934 | /* |
diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c index a43d1813c4ff..5533e48e605d 100644 --- a/fs/xfs/scrub/alloc.c +++ b/fs/xfs/scrub/alloc.c | |||
@@ -97,7 +97,6 @@ xchk_allocbt_rec( | |||
97 | xfs_agnumber_t agno = bs->cur->bc_private.a.agno; | 97 | xfs_agnumber_t agno = bs->cur->bc_private.a.agno; |
98 | xfs_agblock_t bno; | 98 | xfs_agblock_t bno; |
99 | xfs_extlen_t len; | 99 | xfs_extlen_t len; |
100 | int error = 0; | ||
101 | 100 | ||
102 | bno = be32_to_cpu(rec->alloc.ar_startblock); | 101 | bno = be32_to_cpu(rec->alloc.ar_startblock); |
103 | len = be32_to_cpu(rec->alloc.ar_blockcount); | 102 | len = be32_to_cpu(rec->alloc.ar_blockcount); |
@@ -109,7 +108,7 @@ xchk_allocbt_rec( | |||
109 | 108 | ||
110 | xchk_allocbt_xref(bs->sc, bno, len); | 109 | xchk_allocbt_xref(bs->sc, bno, len); |
111 | 110 | ||
112 | return error; | 111 | return 0; |
113 | } | 112 | } |
114 | 113 | ||
115 | /* Scrub the freespace btrees for some AG. */ | 114 | /* Scrub the freespace btrees for some AG. */ |
diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index ddd0bf7a4740..f1bc88f4367c 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c | |||
@@ -63,19 +63,6 @@ static const struct sysfs_ops xfs_sysfs_ops = { | |||
63 | .store = xfs_sysfs_object_store, | 63 | .store = xfs_sysfs_object_store, |
64 | }; | 64 | }; |
65 | 65 | ||
66 | /* | ||
67 | * xfs_mount kobject. The mp kobject also serves as the per-mount parent object | ||
68 | * that is identified by the fsname under sysfs. | ||
69 | */ | ||
70 | |||
71 | static inline struct xfs_mount * | ||
72 | to_mp(struct kobject *kobject) | ||
73 | { | ||
74 | struct xfs_kobj *kobj = to_kobj(kobject); | ||
75 | |||
76 | return container_of(kobj, struct xfs_mount, m_kobj); | ||
77 | } | ||
78 | |||
79 | static struct attribute *xfs_mp_attrs[] = { | 66 | static struct attribute *xfs_mp_attrs[] = { |
80 | NULL, | 67 | NULL, |
81 | }; | 68 | }; |