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 'for-linus-Jun-21-2012' of git://oss.sgi.com/xfs/xfs

Pull XFS fixes from Ben Myers:
- Fix stale data exposure with unwritten extents
- Fix a warning in xfs_alloc_vextent with ODEBUG
- Fix overallocation and alignment of pages for xfs_bufs
- Fix a cursor leak
- Fix a log hang
- Fix a crash related to xfs_sync_worker
- Rename xfs log structure from struct log to struct xlog so we can use
crash dumps effectively

* tag 'for-linus-Jun-21-2012' of git://oss.sgi.com/xfs/xfs:
xfs: rename log structure to xlog
xfs: shutdown xfs_sync_worker before the log
xfs: Fix overallocation in xfs_buf_allocate_memory()
xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near
xfs: check for stale inode before acquiring iflock on push
xfs: fix debug_object WARN at xfs_alloc_vextent()
xfs: xfs_vm_writepage clear iomap_valid when !buffer_uptodate (REV2)

+152 -130
+2 -1
fs/xfs/xfs_alloc.c
··· 1080 1080 goto restart; 1081 1081 } 1082 1082 1083 + xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); 1083 1084 trace_xfs_alloc_size_neither(args); 1084 1085 args->agbno = NULLAGBLOCK; 1085 1086 return 0; ··· 2442 2441 DECLARE_COMPLETION_ONSTACK(done); 2443 2442 2444 2443 args->done = &done; 2445 - INIT_WORK(&args->work, xfs_alloc_vextent_worker); 2444 + INIT_WORK_ONSTACK(&args->work, xfs_alloc_vextent_worker); 2446 2445 queue_work(xfs_alloc_wq, &args->work); 2447 2446 wait_for_completion(&done); 2448 2447 return args->result;
+8 -3
fs/xfs/xfs_aops.c
··· 981 981 imap_valid = 0; 982 982 } 983 983 } else { 984 - if (PageUptodate(page)) { 984 + if (PageUptodate(page)) 985 985 ASSERT(buffer_mapped(bh)); 986 - imap_valid = 0; 987 - } 986 + /* 987 + * This buffer is not uptodate and will not be 988 + * written to disk. Ensure that we will put any 989 + * subsequent writeable buffers into a new 990 + * ioend. 991 + */ 992 + imap_valid = 0; 988 993 continue; 989 994 } 990 995
+2 -14
fs/xfs/xfs_buf.c
··· 201 201 bp->b_length = numblks; 202 202 bp->b_io_length = numblks; 203 203 bp->b_flags = flags; 204 - 205 - /* 206 - * We do not set the block number here in the buffer because we have not 207 - * finished initialising the buffer. We insert the buffer into the cache 208 - * in this state, so this ensures that we are unable to do IO on a 209 - * buffer that hasn't been fully initialised. 210 - */ 211 - bp->b_bn = XFS_BUF_DADDR_NULL; 204 + bp->b_bn = blkno; 212 205 atomic_set(&bp->b_pin_count, 0); 213 206 init_waitqueue_head(&bp->b_waiters); 214 207 ··· 560 567 if (bp != new_bp) 561 568 xfs_buf_free(new_bp); 562 569 563 - /* 564 - * Now we have a workable buffer, fill in the block number so 565 - * that we can do IO on it. 566 - */ 567 - bp->b_bn = blkno; 568 570 bp->b_io_length = bp->b_length; 569 571 570 572 found: ··· 760 772 int error, i; 761 773 xfs_buf_t *bp; 762 774 763 - bp = xfs_buf_alloc(target, 0, numblks, 0); 775 + bp = xfs_buf_alloc(target, XFS_BUF_DADDR_NULL, numblks, 0); 764 776 if (unlikely(bp == NULL)) 765 777 goto fail; 766 778
+8 -9
fs/xfs/xfs_inode_item.c
··· 505 505 } 506 506 507 507 /* 508 + * Stale inode items should force out the iclog. 509 + */ 510 + if (ip->i_flags & XFS_ISTALE) { 511 + rval = XFS_ITEM_PINNED; 512 + goto out_unlock; 513 + } 514 + 515 + /* 508 516 * Someone else is already flushing the inode. Nothing we can do 509 517 * here but wait for the flush to finish and remove the item from 510 518 * the AIL. ··· 520 512 if (!xfs_iflock_nowait(ip)) { 521 513 rval = XFS_ITEM_FLUSHING; 522 514 goto out_unlock; 523 - } 524 - 525 - /* 526 - * Stale inode items should force out the iclog. 527 - */ 528 - if (ip->i_flags & XFS_ISTALE) { 529 - xfs_ifunlock(ip); 530 - xfs_iunlock(ip, XFS_ILOCK_SHARED); 531 - return XFS_ITEM_PINNED; 532 515 } 533 516 534 517 ASSERT(iip->ili_fields != 0 || XFS_FORCED_SHUTDOWN(ip->i_mount));
+45 -32
fs/xfs/xfs_log.c
··· 38 38 kmem_zone_t *xfs_log_ticket_zone; 39 39 40 40 /* Local miscellaneous function prototypes */ 41 - STATIC int xlog_commit_record(struct log *log, struct xlog_ticket *ticket, 42 - xlog_in_core_t **, xfs_lsn_t *); 41 + STATIC int 42 + xlog_commit_record( 43 + struct xlog *log, 44 + struct xlog_ticket *ticket, 45 + struct xlog_in_core **iclog, 46 + xfs_lsn_t *commitlsnp); 47 + 43 48 STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp, 44 49 xfs_buftarg_t *log_target, 45 50 xfs_daddr_t blk_offset, 46 51 int num_bblks); 47 - STATIC int xlog_space_left(struct log *log, atomic64_t *head); 52 + STATIC int 53 + xlog_space_left( 54 + struct xlog *log, 55 + atomic64_t *head); 48 56 STATIC int xlog_sync(xlog_t *log, xlog_in_core_t *iclog); 49 57 STATIC void xlog_dealloc_log(xlog_t *log); 50 58 ··· 72 64 int eventual_size); 73 65 STATIC void xlog_state_want_sync(xlog_t *log, xlog_in_core_t *iclog); 74 66 75 - STATIC void xlog_grant_push_ail(struct log *log, 76 - int need_bytes); 67 + STATIC void 68 + xlog_grant_push_ail( 69 + struct xlog *log, 70 + int need_bytes); 77 71 STATIC void xlog_regrant_reserve_log_space(xlog_t *log, 78 72 xlog_ticket_t *ticket); 79 73 STATIC void xlog_ungrant_log_space(xlog_t *log, ··· 83 73 84 74 #if defined(DEBUG) 85 75 STATIC void xlog_verify_dest_ptr(xlog_t *log, char *ptr); 86 - STATIC void xlog_verify_grant_tail(struct log *log); 76 + STATIC void 77 + xlog_verify_grant_tail( 78 + struct xlog *log); 87 79 STATIC void xlog_verify_iclog(xlog_t *log, xlog_in_core_t *iclog, 88 80 int count, boolean_t syncing); 89 81 STATIC void xlog_verify_tail_lsn(xlog_t *log, xlog_in_core_t *iclog, ··· 101 89 102 90 static void 103 91 xlog_grant_sub_space( 104 - struct log *log, 105 - atomic64_t *head, 106 - int bytes) 92 + struct xlog *log, 93 + atomic64_t *head, 94 + int bytes) 107 95 { 108 96 int64_t head_val = atomic64_read(head); 109 97 int64_t new, old; ··· 127 115 128 116 static void 129 117 xlog_grant_add_space( 130 - struct log *log, 131 - atomic64_t *head, 132 - int bytes) 118 + struct xlog *log, 119 + atomic64_t *head, 120 + int bytes) 133 121 { 134 122 int64_t head_val = atomic64_read(head); 135 123 int64_t new, old; ··· 177 165 178 166 static inline int 179 167 xlog_ticket_reservation( 180 - struct log *log, 168 + struct xlog *log, 181 169 struct xlog_grant_head *head, 182 170 struct xlog_ticket *tic) 183 171 { ··· 194 182 195 183 STATIC bool 196 184 xlog_grant_head_wake( 197 - struct log *log, 185 + struct xlog *log, 198 186 struct xlog_grant_head *head, 199 187 int *free_bytes) 200 188 { ··· 216 204 217 205 STATIC int 218 206 xlog_grant_head_wait( 219 - struct log *log, 207 + struct xlog *log, 220 208 struct xlog_grant_head *head, 221 209 struct xlog_ticket *tic, 222 210 int need_bytes) ··· 268 256 */ 269 257 STATIC int 270 258 xlog_grant_head_check( 271 - struct log *log, 259 + struct xlog *log, 272 260 struct xlog_grant_head *head, 273 261 struct xlog_ticket *tic, 274 262 int *need_bytes) ··· 335 323 struct xfs_mount *mp, 336 324 struct xlog_ticket *tic) 337 325 { 338 - struct log *log = mp->m_log; 326 + struct xlog *log = mp->m_log; 339 327 int need_bytes; 340 328 int error = 0; 341 329 ··· 401 389 bool permanent, 402 390 uint t_type) 403 391 { 404 - struct log *log = mp->m_log; 392 + struct xlog *log = mp->m_log; 405 393 struct xlog_ticket *tic; 406 394 int need_bytes; 407 395 int error = 0; ··· 477 465 struct xlog_in_core **iclog, 478 466 uint flags) 479 467 { 480 - struct log *log = mp->m_log; 468 + struct xlog *log = mp->m_log; 481 469 xfs_lsn_t lsn = 0; 482 470 483 471 if (XLOG_FORCED_SHUTDOWN(log) || ··· 822 810 void 823 811 xfs_log_unmount(xfs_mount_t *mp) 824 812 { 813 + cancel_delayed_work_sync(&mp->m_sync_work); 825 814 xfs_trans_ail_destroy(mp); 826 815 xlog_dealloc_log(mp->m_log); 827 816 } ··· 851 838 xfs_log_space_wake( 852 839 struct xfs_mount *mp) 853 840 { 854 - struct log *log = mp->m_log; 841 + struct xlog *log = mp->m_log; 855 842 int free_bytes; 856 843 857 844 if (XLOG_FORCED_SHUTDOWN(log)) ··· 929 916 xlog_assign_tail_lsn_locked( 930 917 struct xfs_mount *mp) 931 918 { 932 - struct log *log = mp->m_log; 919 + struct xlog *log = mp->m_log; 933 920 struct xfs_log_item *lip; 934 921 xfs_lsn_t tail_lsn; 935 922 ··· 978 965 */ 979 966 STATIC int 980 967 xlog_space_left( 981 - struct log *log, 968 + struct xlog *log, 982 969 atomic64_t *head) 983 970 { 984 971 int free_bytes; ··· 1290 1277 */ 1291 1278 STATIC int 1292 1279 xlog_commit_record( 1293 - struct log *log, 1280 + struct xlog *log, 1294 1281 struct xlog_ticket *ticket, 1295 1282 struct xlog_in_core **iclog, 1296 1283 xfs_lsn_t *commitlsnp) ··· 1324 1311 */ 1325 1312 STATIC void 1326 1313 xlog_grant_push_ail( 1327 - struct log *log, 1314 + struct xlog *log, 1328 1315 int need_bytes) 1329 1316 { 1330 1317 xfs_lsn_t threshold_lsn = 0; ··· 1803 1790 1804 1791 static xlog_op_header_t * 1805 1792 xlog_write_setup_ophdr( 1806 - struct log *log, 1793 + struct xlog *log, 1807 1794 struct xlog_op_header *ophdr, 1808 1795 struct xlog_ticket *ticket, 1809 1796 uint flags) ··· 1886 1873 1887 1874 static int 1888 1875 xlog_write_copy_finish( 1889 - struct log *log, 1876 + struct xlog *log, 1890 1877 struct xlog_in_core *iclog, 1891 1878 uint flags, 1892 1879 int *record_cnt, ··· 1971 1958 */ 1972 1959 int 1973 1960 xlog_write( 1974 - struct log *log, 1961 + struct xlog *log, 1975 1962 struct xfs_log_vec *log_vector, 1976 1963 struct xlog_ticket *ticket, 1977 1964 xfs_lsn_t *start_lsn, ··· 2834 2821 uint flags, 2835 2822 int *log_flushed) 2836 2823 { 2837 - struct log *log = mp->m_log; 2824 + struct xlog *log = mp->m_log; 2838 2825 struct xlog_in_core *iclog; 2839 2826 xfs_lsn_t lsn; 2840 2827 ··· 2982 2969 uint flags, 2983 2970 int *log_flushed) 2984 2971 { 2985 - struct log *log = mp->m_log; 2972 + struct xlog *log = mp->m_log; 2986 2973 struct xlog_in_core *iclog; 2987 2974 int already_slept = 0; 2988 2975 ··· 3160 3147 */ 3161 3148 xlog_ticket_t * 3162 3149 xlog_ticket_alloc( 3163 - struct log *log, 3150 + struct xlog *log, 3164 3151 int unit_bytes, 3165 3152 int cnt, 3166 3153 char client, ··· 3291 3278 */ 3292 3279 void 3293 3280 xlog_verify_dest_ptr( 3294 - struct log *log, 3281 + struct xlog *log, 3295 3282 char *ptr) 3296 3283 { 3297 3284 int i; ··· 3320 3307 */ 3321 3308 STATIC void 3322 3309 xlog_verify_grant_tail( 3323 - struct log *log) 3310 + struct xlog *log) 3324 3311 { 3325 3312 int tail_cycle, tail_blocks; 3326 3313 int cycle, space;
+11 -11
fs/xfs/xfs_log_cil.c
··· 44 44 */ 45 45 static struct xlog_ticket * 46 46 xlog_cil_ticket_alloc( 47 - struct log *log) 47 + struct xlog *log) 48 48 { 49 49 struct xlog_ticket *tic; 50 50 ··· 72 72 */ 73 73 void 74 74 xlog_cil_init_post_recovery( 75 - struct log *log) 75 + struct xlog *log) 76 76 { 77 77 log->l_cilp->xc_ctx->ticket = xlog_cil_ticket_alloc(log); 78 78 log->l_cilp->xc_ctx->sequence = 1; ··· 182 182 */ 183 183 STATIC void 184 184 xfs_cil_prepare_item( 185 - struct log *log, 185 + struct xlog *log, 186 186 struct xfs_log_vec *lv, 187 187 int *len, 188 188 int *diff_iovecs) ··· 231 231 */ 232 232 static void 233 233 xlog_cil_insert_items( 234 - struct log *log, 234 + struct xlog *log, 235 235 struct xfs_log_vec *log_vector, 236 236 struct xlog_ticket *ticket) 237 237 { ··· 373 373 */ 374 374 STATIC int 375 375 xlog_cil_push( 376 - struct log *log) 376 + struct xlog *log) 377 377 { 378 378 struct xfs_cil *cil = log->l_cilp; 379 379 struct xfs_log_vec *lv; ··· 601 601 */ 602 602 static void 603 603 xlog_cil_push_background( 604 - struct log *log) 604 + struct xlog *log) 605 605 { 606 606 struct xfs_cil *cil = log->l_cilp; 607 607 ··· 629 629 630 630 static void 631 631 xlog_cil_push_foreground( 632 - struct log *log, 632 + struct xlog *log, 633 633 xfs_lsn_t push_seq) 634 634 { 635 635 struct xfs_cil *cil = log->l_cilp; ··· 683 683 xfs_lsn_t *commit_lsn, 684 684 int flags) 685 685 { 686 - struct log *log = mp->m_log; 686 + struct xlog *log = mp->m_log; 687 687 int log_flags = 0; 688 688 struct xfs_log_vec *log_vector; 689 689 ··· 754 754 */ 755 755 xfs_lsn_t 756 756 xlog_cil_force_lsn( 757 - struct log *log, 757 + struct xlog *log, 758 758 xfs_lsn_t sequence) 759 759 { 760 760 struct xfs_cil *cil = log->l_cilp; ··· 833 833 */ 834 834 int 835 835 xlog_cil_init( 836 - struct log *log) 836 + struct xlog *log) 837 837 { 838 838 struct xfs_cil *cil; 839 839 struct xfs_cil_ctx *ctx; ··· 869 869 870 870 void 871 871 xlog_cil_destroy( 872 - struct log *log) 872 + struct xlog *log) 873 873 { 874 874 if (log->l_cilp->xc_ctx) { 875 875 if (log->l_cilp->xc_ctx->ticket)
+31 -15
fs/xfs/xfs_log_priv.h
··· 19 19 #define __XFS_LOG_PRIV_H__ 20 20 21 21 struct xfs_buf; 22 - struct log; 22 + struct xlog; 23 23 struct xlog_ticket; 24 24 struct xfs_mount; 25 25 ··· 352 352 struct xlog_in_core *ic_next; 353 353 struct xlog_in_core *ic_prev; 354 354 struct xfs_buf *ic_bp; 355 - struct log *ic_log; 355 + struct xlog *ic_log; 356 356 int ic_size; 357 357 int ic_offset; 358 358 int ic_bwritecnt; ··· 409 409 * operations almost as efficient as the old logging methods. 410 410 */ 411 411 struct xfs_cil { 412 - struct log *xc_log; 412 + struct xlog *xc_log; 413 413 struct list_head xc_cil; 414 414 spinlock_t xc_cil_lock; 415 415 struct xfs_cil_ctx *xc_ctx; ··· 487 487 * overflow 31 bits worth of byte offset, so using a byte number will mean 488 488 * that round off problems won't occur when releasing partial reservations. 489 489 */ 490 - typedef struct log { 490 + typedef struct xlog { 491 491 /* The following fields don't need locking */ 492 492 struct xfs_mount *l_mp; /* mount point */ 493 493 struct xfs_ail *l_ailp; /* AIL log is working with */ ··· 553 553 extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); 554 554 555 555 extern kmem_zone_t *xfs_log_ticket_zone; 556 - struct xlog_ticket *xlog_ticket_alloc(struct log *log, int unit_bytes, 557 - int count, char client, bool permanent, 558 - xfs_km_flags_t alloc_flags); 556 + struct xlog_ticket * 557 + xlog_ticket_alloc( 558 + struct xlog *log, 559 + int unit_bytes, 560 + int count, 561 + char client, 562 + bool permanent, 563 + xfs_km_flags_t alloc_flags); 559 564 560 565 561 566 static inline void ··· 572 567 } 573 568 574 569 void xlog_print_tic_res(struct xfs_mount *mp, struct xlog_ticket *ticket); 575 - int xlog_write(struct log *log, struct xfs_log_vec *log_vector, 576 - struct xlog_ticket *tic, xfs_lsn_t *start_lsn, 577 - xlog_in_core_t **commit_iclog, uint flags); 570 + int 571 + xlog_write( 572 + struct xlog *log, 573 + struct xfs_log_vec *log_vector, 574 + struct xlog_ticket *tic, 575 + xfs_lsn_t *start_lsn, 576 + struct xlog_in_core **commit_iclog, 577 + uint flags); 578 578 579 579 /* 580 580 * When we crack an atomic LSN, we sample it first so that the value will not ··· 639 629 /* 640 630 * Committed Item List interfaces 641 631 */ 642 - int xlog_cil_init(struct log *log); 643 - void xlog_cil_init_post_recovery(struct log *log); 644 - void xlog_cil_destroy(struct log *log); 632 + int 633 + xlog_cil_init(struct xlog *log); 634 + void 635 + xlog_cil_init_post_recovery(struct xlog *log); 636 + void 637 + xlog_cil_destroy(struct xlog *log); 645 638 646 639 /* 647 640 * CIL force routines 648 641 */ 649 - xfs_lsn_t xlog_cil_force_lsn(struct log *log, xfs_lsn_t sequence); 642 + xfs_lsn_t 643 + xlog_cil_force_lsn( 644 + struct xlog *log, 645 + xfs_lsn_t sequence); 650 646 651 647 static inline void 652 - xlog_cil_force(struct log *log) 648 + xlog_cil_force(struct xlog *log) 653 649 { 654 650 xlog_cil_force_lsn(log, log->l_cilp->xc_current_sequence); 655 651 }
+19 -19
fs/xfs/xfs_log_recover.c
··· 1471 1471 1472 1472 STATIC int 1473 1473 xlog_recover_add_to_cont_trans( 1474 - struct log *log, 1475 - xlog_recover_t *trans, 1474 + struct xlog *log, 1475 + struct xlog_recover *trans, 1476 1476 xfs_caddr_t dp, 1477 1477 int len) 1478 1478 { ··· 1517 1517 */ 1518 1518 STATIC int 1519 1519 xlog_recover_add_to_trans( 1520 - struct log *log, 1521 - xlog_recover_t *trans, 1520 + struct xlog *log, 1521 + struct xlog_recover *trans, 1522 1522 xfs_caddr_t dp, 1523 1523 int len) 1524 1524 { ··· 1588 1588 */ 1589 1589 STATIC int 1590 1590 xlog_recover_reorder_trans( 1591 - struct log *log, 1592 - xlog_recover_t *trans, 1591 + struct xlog *log, 1592 + struct xlog_recover *trans, 1593 1593 int pass) 1594 1594 { 1595 1595 xlog_recover_item_t *item, *n; ··· 1642 1642 */ 1643 1643 STATIC int 1644 1644 xlog_recover_buffer_pass1( 1645 - struct log *log, 1646 - xlog_recover_item_t *item) 1645 + struct xlog *log, 1646 + struct xlog_recover_item *item) 1647 1647 { 1648 1648 xfs_buf_log_format_t *buf_f = item->ri_buf[0].i_addr; 1649 1649 struct list_head *bucket; ··· 1696 1696 */ 1697 1697 STATIC int 1698 1698 xlog_check_buffer_cancelled( 1699 - struct log *log, 1699 + struct xlog *log, 1700 1700 xfs_daddr_t blkno, 1701 1701 uint len, 1702 1702 ushort flags) ··· 2689 2689 2690 2690 STATIC int 2691 2691 xlog_recover_commit_pass1( 2692 - struct log *log, 2693 - struct xlog_recover *trans, 2694 - xlog_recover_item_t *item) 2692 + struct xlog *log, 2693 + struct xlog_recover *trans, 2694 + struct xlog_recover_item *item) 2695 2695 { 2696 2696 trace_xfs_log_recover_item_recover(log, trans, item, XLOG_RECOVER_PASS1); 2697 2697 ··· 2716 2716 2717 2717 STATIC int 2718 2718 xlog_recover_commit_pass2( 2719 - struct log *log, 2720 - struct xlog_recover *trans, 2721 - struct list_head *buffer_list, 2722 - xlog_recover_item_t *item) 2719 + struct xlog *log, 2720 + struct xlog_recover *trans, 2721 + struct list_head *buffer_list, 2722 + struct xlog_recover_item *item) 2723 2723 { 2724 2724 trace_xfs_log_recover_item_recover(log, trans, item, XLOG_RECOVER_PASS2); 2725 2725 ··· 2753 2753 */ 2754 2754 STATIC int 2755 2755 xlog_recover_commit_trans( 2756 - struct log *log, 2756 + struct xlog *log, 2757 2757 struct xlog_recover *trans, 2758 2758 int pass) 2759 2759 { ··· 2793 2793 2794 2794 STATIC int 2795 2795 xlog_recover_unmount_trans( 2796 - struct log *log, 2797 - xlog_recover_t *trans) 2796 + struct xlog *log, 2797 + struct xlog_recover *trans) 2798 2798 { 2799 2799 /* Do nothing now */ 2800 2800 xfs_warn(log->l_mp, "%s: Unmount LR", __func__);
+2 -2
fs/xfs/xfs_mount.h
··· 53 53 54 54 #include "xfs_sync.h" 55 55 56 - struct log; 56 + struct xlog; 57 57 struct xfs_mount_args; 58 58 struct xfs_inode; 59 59 struct xfs_bmbt_irec; ··· 133 133 uint m_readio_blocks; /* min read size blocks */ 134 134 uint m_writeio_log; /* min write size log bytes */ 135 135 uint m_writeio_blocks; /* min write size blocks */ 136 - struct log *m_log; /* log specific stuff */ 136 + struct xlog *m_log; /* log specific stuff */ 137 137 int m_logbufs; /* number of log buffers */ 138 138 int m_logbsize; /* size of each log buffer */ 139 139 uint m_rsumlevels; /* rt summary levels */
+15 -15
fs/xfs/xfs_sync.c
··· 386 386 * We shouldn't write/force the log if we are in the mount/unmount 387 387 * process or on a read only filesystem. The workqueue still needs to be 388 388 * active in both cases, however, because it is used for inode reclaim 389 - * during these times. Use the s_umount semaphore to provide exclusion 390 - * with unmount. 389 + * during these times. Use the MS_ACTIVE flag to avoid doing anything 390 + * during mount. Doing work during unmount is avoided by calling 391 + * cancel_delayed_work_sync on this work queue before tearing down 392 + * the ail and the log in xfs_log_unmount. 391 393 */ 392 - if (down_read_trylock(&mp->m_super->s_umount)) { 393 - if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { 394 - /* dgc: errors ignored here */ 395 - if (mp->m_super->s_frozen == SB_UNFROZEN && 396 - xfs_log_need_covered(mp)) 397 - error = xfs_fs_log_dummy(mp); 398 - else 399 - xfs_log_force(mp, 0); 394 + if (!(mp->m_super->s_flags & MS_ACTIVE) && 395 + !(mp->m_flags & XFS_MOUNT_RDONLY)) { 396 + /* dgc: errors ignored here */ 397 + if (mp->m_super->s_frozen == SB_UNFROZEN && 398 + xfs_log_need_covered(mp)) 399 + error = xfs_fs_log_dummy(mp); 400 + else 401 + xfs_log_force(mp, 0); 400 402 401 - /* start pushing all the metadata that is currently 402 - * dirty */ 403 - xfs_ail_push_all(mp->m_ail); 404 - } 405 - up_read(&mp->m_super->s_umount); 403 + /* start pushing all the metadata that is currently 404 + * dirty */ 405 + xfs_ail_push_all(mp->m_ail); 406 406 } 407 407 408 408 /* queue us up again */
+9 -9
fs/xfs/xfs_trace.h
··· 32 32 struct xfs_dquot; 33 33 struct xfs_log_item; 34 34 struct xlog_ticket; 35 - struct log; 35 + struct xlog; 36 36 struct xlog_recover; 37 37 struct xlog_recover_item; 38 38 struct xfs_buf_log_format; ··· 762 762 DEFINE_DQUOT_EVENT(xfs_dqflush_done); 763 763 764 764 DECLARE_EVENT_CLASS(xfs_loggrant_class, 765 - TP_PROTO(struct log *log, struct xlog_ticket *tic), 765 + TP_PROTO(struct xlog *log, struct xlog_ticket *tic), 766 766 TP_ARGS(log, tic), 767 767 TP_STRUCT__entry( 768 768 __field(dev_t, dev) ··· 830 830 831 831 #define DEFINE_LOGGRANT_EVENT(name) \ 832 832 DEFINE_EVENT(xfs_loggrant_class, name, \ 833 - TP_PROTO(struct log *log, struct xlog_ticket *tic), \ 833 + TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \ 834 834 TP_ARGS(log, tic)) 835 835 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); 836 836 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); ··· 1664 1664 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); 1665 1665 1666 1666 DECLARE_EVENT_CLASS(xfs_log_recover_item_class, 1667 - TP_PROTO(struct log *log, struct xlog_recover *trans, 1667 + TP_PROTO(struct xlog *log, struct xlog_recover *trans, 1668 1668 struct xlog_recover_item *item, int pass), 1669 1669 TP_ARGS(log, trans, item, pass), 1670 1670 TP_STRUCT__entry( ··· 1698 1698 1699 1699 #define DEFINE_LOG_RECOVER_ITEM(name) \ 1700 1700 DEFINE_EVENT(xfs_log_recover_item_class, name, \ 1701 - TP_PROTO(struct log *log, struct xlog_recover *trans, \ 1701 + TP_PROTO(struct xlog *log, struct xlog_recover *trans, \ 1702 1702 struct xlog_recover_item *item, int pass), \ 1703 1703 TP_ARGS(log, trans, item, pass)) 1704 1704 ··· 1709 1709 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover); 1710 1710 1711 1711 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, 1712 - TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), 1712 + TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), 1713 1713 TP_ARGS(log, buf_f), 1714 1714 TP_STRUCT__entry( 1715 1715 __field(dev_t, dev) ··· 1739 1739 1740 1740 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \ 1741 1741 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \ 1742 - TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), \ 1742 + TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \ 1743 1743 TP_ARGS(log, buf_f)) 1744 1744 1745 1745 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel); ··· 1752 1752 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf); 1753 1753 1754 1754 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, 1755 - TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), 1755 + TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), 1756 1756 TP_ARGS(log, in_f), 1757 1757 TP_STRUCT__entry( 1758 1758 __field(dev_t, dev) ··· 1790 1790 ) 1791 1791 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \ 1792 1792 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \ 1793 - TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), \ 1793 + TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \ 1794 1794 TP_ARGS(log, in_f)) 1795 1795 1796 1796 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);