mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 02:34:01 +08:00
Merge branch 'xfs-4.7-misc-fixes' into for-next
This commit is contained in:
commit
2a4ad5894c
@ -93,19 +93,23 @@ kmem_zalloc_large(size_t size, xfs_km_flags_t flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
|
kmem_realloc(const void *old, size_t newsize, xfs_km_flags_t flags)
|
||||||
xfs_km_flags_t flags)
|
|
||||||
{
|
{
|
||||||
void *new;
|
int retries = 0;
|
||||||
|
gfp_t lflags = kmem_flags_convert(flags);
|
||||||
|
void *ptr;
|
||||||
|
|
||||||
new = kmem_alloc(newsize, flags);
|
do {
|
||||||
if (ptr) {
|
ptr = krealloc(old, newsize, lflags);
|
||||||
if (new)
|
if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP)))
|
||||||
memcpy(new, ptr,
|
return ptr;
|
||||||
((oldsize < newsize) ? oldsize : newsize));
|
if (!(++retries % 100))
|
||||||
kmem_free(ptr);
|
xfs_err(NULL,
|
||||||
}
|
"%s(%u) possible memory allocation deadlock size %zu in %s (mode:0x%x)",
|
||||||
return new;
|
current->comm, current->pid,
|
||||||
|
newsize, __func__, lflags);
|
||||||
|
congestion_wait(BLK_RW_ASYNC, HZ/50);
|
||||||
|
} while (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
|
@ -62,7 +62,7 @@ kmem_flags_convert(xfs_km_flags_t flags)
|
|||||||
|
|
||||||
extern void *kmem_alloc(size_t, xfs_km_flags_t);
|
extern void *kmem_alloc(size_t, xfs_km_flags_t);
|
||||||
extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t);
|
extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t);
|
||||||
extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t);
|
extern void *kmem_realloc(const void *, size_t, xfs_km_flags_t);
|
||||||
static inline void kmem_free(const void *ptr)
|
static inline void kmem_free(const void *ptr)
|
||||||
{
|
{
|
||||||
kvfree(ptr);
|
kvfree(ptr);
|
||||||
|
@ -542,7 +542,6 @@ xfs_iroot_realloc(
|
|||||||
new_max = cur_max + rec_diff;
|
new_max = cur_max + rec_diff;
|
||||||
new_size = XFS_BMAP_BROOT_SPACE_CALC(mp, new_max);
|
new_size = XFS_BMAP_BROOT_SPACE_CALC(mp, new_max);
|
||||||
ifp->if_broot = kmem_realloc(ifp->if_broot, new_size,
|
ifp->if_broot = kmem_realloc(ifp->if_broot, new_size,
|
||||||
XFS_BMAP_BROOT_SPACE_CALC(mp, cur_max),
|
|
||||||
KM_SLEEP | KM_NOFS);
|
KM_SLEEP | KM_NOFS);
|
||||||
op = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1,
|
op = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1,
|
||||||
ifp->if_broot_bytes);
|
ifp->if_broot_bytes);
|
||||||
@ -686,7 +685,6 @@ xfs_idata_realloc(
|
|||||||
ifp->if_u1.if_data =
|
ifp->if_u1.if_data =
|
||||||
kmem_realloc(ifp->if_u1.if_data,
|
kmem_realloc(ifp->if_u1.if_data,
|
||||||
real_size,
|
real_size,
|
||||||
ifp->if_real_bytes,
|
|
||||||
KM_SLEEP | KM_NOFS);
|
KM_SLEEP | KM_NOFS);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1402,8 +1400,7 @@ xfs_iext_realloc_direct(
|
|||||||
if (rnew_size != ifp->if_real_bytes) {
|
if (rnew_size != ifp->if_real_bytes) {
|
||||||
ifp->if_u1.if_extents =
|
ifp->if_u1.if_extents =
|
||||||
kmem_realloc(ifp->if_u1.if_extents,
|
kmem_realloc(ifp->if_u1.if_extents,
|
||||||
rnew_size,
|
rnew_size, KM_NOFS);
|
||||||
ifp->if_real_bytes, KM_NOFS);
|
|
||||||
}
|
}
|
||||||
if (rnew_size > ifp->if_real_bytes) {
|
if (rnew_size > ifp->if_real_bytes) {
|
||||||
memset(&ifp->if_u1.if_extents[ifp->if_bytes /
|
memset(&ifp->if_u1.if_extents[ifp->if_bytes /
|
||||||
@ -1487,9 +1484,8 @@ xfs_iext_realloc_indirect(
|
|||||||
if (new_size == 0) {
|
if (new_size == 0) {
|
||||||
xfs_iext_destroy(ifp);
|
xfs_iext_destroy(ifp);
|
||||||
} else {
|
} else {
|
||||||
ifp->if_u1.if_ext_irec = (xfs_ext_irec_t *)
|
ifp->if_u1.if_ext_irec =
|
||||||
kmem_realloc(ifp->if_u1.if_ext_irec,
|
kmem_realloc(ifp->if_u1.if_ext_irec, new_size, KM_NOFS);
|
||||||
new_size, size, KM_NOFS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -691,7 +691,7 @@ error0:
|
|||||||
* end of the chunk, skip ahead to first id in next allocated chunk
|
* end of the chunk, skip ahead to first id in next allocated chunk
|
||||||
* using the SEEK_DATA interface.
|
* using the SEEK_DATA interface.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
xfs_dq_get_next_id(
|
xfs_dq_get_next_id(
|
||||||
xfs_mount_t *mp,
|
xfs_mount_t *mp,
|
||||||
uint type,
|
uint type,
|
||||||
|
@ -1030,7 +1030,7 @@ xfs_dir_ialloc(
|
|||||||
tp->t_flags &= ~(XFS_TRANS_DQ_DIRTY);
|
tp->t_flags &= ~(XFS_TRANS_DQ_DIRTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
code = xfs_trans_roll(&tp, 0);
|
code = xfs_trans_roll(&tp, NULL);
|
||||||
if (committed != NULL)
|
if (committed != NULL)
|
||||||
*committed = 1;
|
*committed = 1;
|
||||||
|
|
||||||
|
@ -479,6 +479,8 @@ STATIC uint
|
|||||||
xfs_inode_item_push(
|
xfs_inode_item_push(
|
||||||
struct xfs_log_item *lip,
|
struct xfs_log_item *lip,
|
||||||
struct list_head *buffer_list)
|
struct list_head *buffer_list)
|
||||||
|
__releases(&lip->li_ailp->xa_lock)
|
||||||
|
__acquires(&lip->li_ailp->xa_lock)
|
||||||
{
|
{
|
||||||
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
|
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
|
||||||
struct xfs_inode *ip = iip->ili_inode;
|
struct xfs_inode *ip = iip->ili_inode;
|
||||||
|
@ -3325,7 +3325,7 @@ xfs_log_force(
|
|||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
trace_xfs_log_force(mp, 0);
|
trace_xfs_log_force(mp, 0, _RET_IP_);
|
||||||
error = _xfs_log_force(mp, flags, NULL);
|
error = _xfs_log_force(mp, flags, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
xfs_warn(mp, "%s: error %d returned.", __func__, error);
|
xfs_warn(mp, "%s: error %d returned.", __func__, error);
|
||||||
@ -3474,7 +3474,7 @@ xfs_log_force_lsn(
|
|||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
trace_xfs_log_force(mp, lsn);
|
trace_xfs_log_force(mp, lsn, _RET_IP_);
|
||||||
error = _xfs_log_force_lsn(mp, lsn, flags, NULL);
|
error = _xfs_log_force_lsn(mp, lsn, flags, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
xfs_warn(mp, "%s: error %d returned.", __func__, error);
|
xfs_warn(mp, "%s: error %d returned.", __func__, error);
|
||||||
|
@ -3843,7 +3843,7 @@ xlog_recover_add_to_cont_trans(
|
|||||||
old_ptr = item->ri_buf[item->ri_cnt-1].i_addr;
|
old_ptr = item->ri_buf[item->ri_cnt-1].i_addr;
|
||||||
old_len = item->ri_buf[item->ri_cnt-1].i_len;
|
old_len = item->ri_buf[item->ri_cnt-1].i_len;
|
||||||
|
|
||||||
ptr = kmem_realloc(old_ptr, len+old_len, old_len, KM_SLEEP);
|
ptr = kmem_realloc(old_ptr, len + old_len, KM_SLEEP);
|
||||||
memcpy(&ptr[old_len], dp, len);
|
memcpy(&ptr[old_len], dp, len);
|
||||||
item->ri_buf[item->ri_cnt-1].i_len += len;
|
item->ri_buf[item->ri_cnt-1].i_len += len;
|
||||||
item->ri_buf[item->ri_cnt-1].i_addr = ptr;
|
item->ri_buf[item->ri_cnt-1].i_addr = ptr;
|
||||||
|
@ -89,7 +89,6 @@ xfs_uuid_mount(
|
|||||||
if (hole < 0) {
|
if (hole < 0) {
|
||||||
xfs_uuid_table = kmem_realloc(xfs_uuid_table,
|
xfs_uuid_table = kmem_realloc(xfs_uuid_table,
|
||||||
(xfs_uuid_table_size + 1) * sizeof(*xfs_uuid_table),
|
(xfs_uuid_table_size + 1) * sizeof(*xfs_uuid_table),
|
||||||
xfs_uuid_table_size * sizeof(*xfs_uuid_table),
|
|
||||||
KM_SLEEP);
|
KM_SLEEP);
|
||||||
hole = xfs_uuid_table_size++;
|
hole = xfs_uuid_table_size++;
|
||||||
}
|
}
|
||||||
|
@ -1050,19 +1050,21 @@ DECLARE_EVENT_CLASS(xfs_log_item_class,
|
|||||||
)
|
)
|
||||||
|
|
||||||
TRACE_EVENT(xfs_log_force,
|
TRACE_EVENT(xfs_log_force,
|
||||||
TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
|
TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
|
||||||
TP_ARGS(mp, lsn),
|
TP_ARGS(mp, lsn, caller_ip),
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
__field(dev_t, dev)
|
__field(dev_t, dev)
|
||||||
__field(xfs_lsn_t, lsn)
|
__field(xfs_lsn_t, lsn)
|
||||||
|
__field(unsigned long, caller_ip)
|
||||||
),
|
),
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
__entry->dev = mp->m_super->s_dev;
|
__entry->dev = mp->m_super->s_dev;
|
||||||
__entry->lsn = lsn;
|
__entry->lsn = lsn;
|
||||||
|
__entry->caller_ip = caller_ip;
|
||||||
),
|
),
|
||||||
TP_printk("dev %d:%d lsn 0x%llx",
|
TP_printk("dev %d:%d lsn 0x%llx caller %ps",
|
||||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||||
__entry->lsn)
|
__entry->lsn, (void *)__entry->caller_ip)
|
||||||
)
|
)
|
||||||
|
|
||||||
#define DEFINE_LOG_ITEM_EVENT(name) \
|
#define DEFINE_LOG_ITEM_EVENT(name) \
|
||||||
|
Loading…
Reference in New Issue
Block a user