aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2015-08-24 20:13:35 -0400
committerDave Chinner <david@fromorbit.com>2015-08-24 20:13:35 -0400
commit70b33a7466baac62103e04c916b8915665b79d80 (patch)
tree14549cadf0ddb49f3392eb9869c62e3d5ec4ce20 /fs/xfs
parentaa493382cb8c5768ba452d87f175fc2aff63911d (diff)
parentf79af0b9090895520c69fbe1939184c4f8ed8426 (diff)
Merge branch 'xfs-misc-fixes-for-4.3-3' into for-next
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/libxfs/xfs_alloc.c2
-rw-r--r--fs/xfs/libxfs/xfs_dir2_node.c10
-rw-r--r--fs/xfs/xfs_buf.c4
-rw-r--r--fs/xfs/xfs_buf_item.c20
-rw-r--r--fs/xfs/xfs_buf_item.h2
-rw-r--r--fs/xfs/xfs_inode.c8
-rw-r--r--fs/xfs/xfs_super.c12
7 files changed, 34 insertions, 24 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index b7fc17ce8233..ffad7f20342f 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -1937,7 +1937,7 @@ xfs_alloc_fix_freelist(
1937 struct xfs_alloc_arg targs; /* local allocation arguments */ 1937 struct xfs_alloc_arg targs; /* local allocation arguments */
1938 xfs_agblock_t bno; /* freelist block */ 1938 xfs_agblock_t bno; /* freelist block */
1939 xfs_extlen_t need; /* total blocks needed in freelist */ 1939 xfs_extlen_t need; /* total blocks needed in freelist */
1940 int error; 1940 int error = 0;
1941 1941
1942 if (!pag->pagf_init) { 1942 if (!pag->pagf_init) {
1943 error = xfs_alloc_read_agf(mp, tp, args->agno, flags, &agbp); 1943 error = xfs_alloc_read_agf(mp, tp, args->agno, flags, &agbp);
diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c
index 6687489412a0..cc28e924545b 100644
--- a/fs/xfs/libxfs/xfs_dir2_node.c
+++ b/fs/xfs/libxfs/xfs_dir2_node.c
@@ -2131,6 +2131,7 @@ xfs_dir2_node_replace(
2131 int error; /* error return value */ 2131 int error; /* error return value */
2132 int i; /* btree level */ 2132 int i; /* btree level */
2133 xfs_ino_t inum; /* new inode number */ 2133 xfs_ino_t inum; /* new inode number */
2134 int ftype; /* new file type */
2134 xfs_dir2_leaf_t *leaf; /* leaf structure */ 2135 xfs_dir2_leaf_t *leaf; /* leaf structure */
2135 xfs_dir2_leaf_entry_t *lep; /* leaf entry being changed */ 2136 xfs_dir2_leaf_entry_t *lep; /* leaf entry being changed */
2136 int rval; /* internal return value */ 2137 int rval; /* internal return value */
@@ -2144,7 +2145,14 @@ xfs_dir2_node_replace(
2144 state = xfs_da_state_alloc(); 2145 state = xfs_da_state_alloc();
2145 state->args = args; 2146 state->args = args;
2146 state->mp = args->dp->i_mount; 2147 state->mp = args->dp->i_mount;
2148
2149 /*
2150 * We have to save new inode number and ftype since
2151 * xfs_da3_node_lookup_int() is going to overwrite them
2152 */
2147 inum = args->inumber; 2153 inum = args->inumber;
2154 ftype = args->filetype;
2155
2148 /* 2156 /*
2149 * Lookup the entry to change in the btree. 2157 * Lookup the entry to change in the btree.
2150 */ 2158 */
@@ -2182,7 +2190,7 @@ xfs_dir2_node_replace(
2182 * Fill in the new inode number and log the entry. 2190 * Fill in the new inode number and log the entry.
2183 */ 2191 */
2184 dep->inumber = cpu_to_be64(inum); 2192 dep->inumber = cpu_to_be64(inum);
2185 args->dp->d_ops->data_put_ftype(dep, args->filetype); 2193 args->dp->d_ops->data_put_ftype(dep, ftype);
2186 xfs_dir2_data_log_entry(args, state->extrablk.bp, dep); 2194 xfs_dir2_data_log_entry(args, state->extrablk.bp, dep);
2187 rval = 0; 2195 rval = 0;
2188 } 2196 }
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index d7dbd8120aaa..c46166bbb716 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -438,7 +438,6 @@ _xfs_buf_find(
438 xfs_buf_flags_t flags, 438 xfs_buf_flags_t flags,
439 xfs_buf_t *new_bp) 439 xfs_buf_t *new_bp)
440{ 440{
441 size_t numbytes;
442 struct xfs_perag *pag; 441 struct xfs_perag *pag;
443 struct rb_node **rbp; 442 struct rb_node **rbp;
444 struct rb_node *parent; 443 struct rb_node *parent;
@@ -450,10 +449,9 @@ _xfs_buf_find(
450 449
451 for (i = 0; i < nmaps; i++) 450 for (i = 0; i < nmaps; i++)
452 numblks += map[i].bm_len; 451 numblks += map[i].bm_len;
453 numbytes = BBTOB(numblks);
454 452
455 /* Check for IOs smaller than the sector size / not sector aligned */ 453 /* Check for IOs smaller than the sector size / not sector aligned */
456 ASSERT(!(numbytes < btp->bt_meta_sectorsize)); 454 ASSERT(!(BBTOB(numblks) < btp->bt_meta_sectorsize));
457 ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_meta_sectormask)); 455 ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_meta_sectormask));
458 456
459 /* 457 /*
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 919057e0a45b..7e986da34f6c 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -746,13 +746,13 @@ xfs_buf_item_free_format(
746 * buffer (see xfs_buf_attach_iodone() below), then put the 746 * buffer (see xfs_buf_attach_iodone() below), then put the
747 * buf log item at the front. 747 * buf log item at the front.
748 */ 748 */
749void 749int
750xfs_buf_item_init( 750xfs_buf_item_init(
751 xfs_buf_t *bp, 751 struct xfs_buf *bp,
752 xfs_mount_t *mp) 752 struct xfs_mount *mp)
753{ 753{
754 xfs_log_item_t *lip = bp->b_fspriv; 754 struct xfs_log_item *lip = bp->b_fspriv;
755 xfs_buf_log_item_t *bip; 755 struct xfs_buf_log_item *bip;
756 int chunks; 756 int chunks;
757 int map_size; 757 int map_size;
758 int error; 758 int error;
@@ -766,12 +766,11 @@ xfs_buf_item_init(
766 */ 766 */
767 ASSERT(bp->b_target->bt_mount == mp); 767 ASSERT(bp->b_target->bt_mount == mp);
768 if (lip != NULL && lip->li_type == XFS_LI_BUF) 768 if (lip != NULL && lip->li_type == XFS_LI_BUF)
769 return; 769 return 0;
770 770
771 bip = kmem_zone_zalloc(xfs_buf_item_zone, KM_SLEEP); 771 bip = kmem_zone_zalloc(xfs_buf_item_zone, KM_SLEEP);
772 xfs_log_item_init(mp, &bip->bli_item, XFS_LI_BUF, &xfs_buf_item_ops); 772 xfs_log_item_init(mp, &bip->bli_item, XFS_LI_BUF, &xfs_buf_item_ops);
773 bip->bli_buf = bp; 773 bip->bli_buf = bp;
774 xfs_buf_hold(bp);
775 774
776 /* 775 /*
777 * chunks is the number of XFS_BLF_CHUNK size pieces the buffer 776 * chunks is the number of XFS_BLF_CHUNK size pieces the buffer
@@ -784,6 +783,11 @@ xfs_buf_item_init(
784 */ 783 */
785 error = xfs_buf_item_get_format(bip, bp->b_map_count); 784 error = xfs_buf_item_get_format(bip, bp->b_map_count);
786 ASSERT(error == 0); 785 ASSERT(error == 0);
786 if (error) { /* to stop gcc throwing set-but-unused warnings */
787 kmem_zone_free(xfs_buf_item_zone, bip);
788 return error;
789 }
790
787 791
788 for (i = 0; i < bip->bli_format_count; i++) { 792 for (i = 0; i < bip->bli_format_count; i++) {
789 chunks = DIV_ROUND_UP(BBTOB(bp->b_maps[i].bm_len), 793 chunks = DIV_ROUND_UP(BBTOB(bp->b_maps[i].bm_len),
@@ -803,6 +807,8 @@ xfs_buf_item_init(
803 if (bp->b_fspriv) 807 if (bp->b_fspriv)
804 bip->bli_item.li_bio_list = bp->b_fspriv; 808 bip->bli_item.li_bio_list = bp->b_fspriv;
805 bp->b_fspriv = bip; 809 bp->b_fspriv = bip;
810 xfs_buf_hold(bp);
811 return 0;
806} 812}
807 813
808 814
diff --git a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h
index 3f3455a41510..f7eba99d19dd 100644
--- a/fs/xfs/xfs_buf_item.h
+++ b/fs/xfs/xfs_buf_item.h
@@ -61,7 +61,7 @@ typedef struct xfs_buf_log_item {
61 struct xfs_buf_log_format __bli_format; /* embedded in-log header */ 61 struct xfs_buf_log_format __bli_format; /* embedded in-log header */
62} xfs_buf_log_item_t; 62} xfs_buf_log_item_t;
63 63
64void xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *); 64int xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
65void xfs_buf_item_relse(struct xfs_buf *); 65void xfs_buf_item_relse(struct xfs_buf *);
66void xfs_buf_item_log(xfs_buf_log_item_t *, uint, uint); 66void xfs_buf_item_log(xfs_buf_log_item_t *, uint, uint);
67uint xfs_buf_item_dirty(xfs_buf_log_item_t *); 67uint xfs_buf_item_dirty(xfs_buf_log_item_t *);
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 30555f8fd44b..dc40a6d5ae0d 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -362,7 +362,13 @@ int xfs_lots_retries;
362int xfs_lock_delays; 362int xfs_lock_delays;
363#endif 363#endif
364 364
365#ifdef CONFIG_LOCKDEP 365/*
366 * xfs_lockdep_subclass_ok() is only used in an ASSERT, so is only called when
367 * DEBUG or XFS_WARN is set. And MAX_LOCKDEP_SUBCLASSES is then only defined
368 * when CONFIG_LOCKDEP is set. Hence the complex define below to avoid build
369 * errors and warnings.
370 */
371#if (defined(DEBUG) || defined(XFS_WARN)) && defined(CONFIG_LOCKDEP)
366static bool 372static bool
367xfs_lockdep_subclass_ok( 373xfs_lockdep_subclass_ok(
368 int subclass) 374 int subclass)
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index f98ce83b7bc4..3bf503a3f57e 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -261,16 +261,8 @@ xfs_parseargs(
261 mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); 261 mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
262 if (!mp->m_rtname) 262 if (!mp->m_rtname)
263 return -ENOMEM; 263 return -ENOMEM;
264 } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) { 264 } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) ||
265 if (!value || !*value) { 265 !strcmp(this_char, MNTOPT_BIOSIZE)) {
266 xfs_warn(mp, "%s option requires an argument",
267 this_char);
268 return -EINVAL;
269 }
270 if (kstrtoint(value, 10, &iosize))
271 return -EINVAL;
272 iosizelog = ffs(iosize) - 1;
273 } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) {
274 if (!value || !*value) { 266 if (!value || !*value) {
275 xfs_warn(mp, "%s option requires an argument", 267 xfs_warn(mp, "%s option requires an argument",
276 this_char); 268 this_char);