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 'xfs-6.9-merge-9' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Chandan Babu:

- Fix invalid pointer dereference by initializing xmbuf before
tracepoint function is invoked

- Use memalloc_nofs_save() when inserting into quota radix tree

* tag 'xfs-6.9-merge-9' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: quota radix tree allocations need to be NOFS on insert
xfs: fix dev_t usage in xmbuf tracepoints

+22 -9
+2 -2
fs/xfs/xfs_buf_mem.c
··· 81 81 /* ensure all writes are below EOF to avoid pagecache zeroing */ 82 82 i_size_write(inode, inode->i_sb->s_maxbytes); 83 83 84 - trace_xmbuf_create(btp); 85 - 86 84 error = xfs_buf_cache_init(btp->bt_cache); 87 85 if (error) 88 86 goto out_file; ··· 96 98 error = xfs_init_buftarg(btp, XMBUF_BLOCKSIZE, descr); 97 99 if (error) 98 100 goto out_bcache; 101 + 102 + trace_xmbuf_create(btp); 99 103 100 104 *btpp = btp; 101 105 return 0;
+13 -5
fs/xfs/xfs_dquot.c
··· 811 811 * caller should throw away the dquot and start over. Otherwise, the dquot 812 812 * is returned locked (and held by the cache) as if there had been a cache 813 813 * hit. 814 + * 815 + * The insert needs to be done under memalloc_nofs context because the radix 816 + * tree can do memory allocation during insert. The qi->qi_tree_lock is taken in 817 + * memory reclaim when freeing unused dquots, so we cannot have the radix tree 818 + * node allocation recursing into filesystem reclaim whilst we hold the 819 + * qi_tree_lock. 814 820 */ 815 821 static int 816 822 xfs_qm_dqget_cache_insert( ··· 826 820 xfs_dqid_t id, 827 821 struct xfs_dquot *dqp) 828 822 { 823 + unsigned int nofs_flags; 829 824 int error; 830 825 826 + nofs_flags = memalloc_nofs_save(); 831 827 mutex_lock(&qi->qi_tree_lock); 832 828 error = radix_tree_insert(tree, id, dqp); 833 829 if (unlikely(error)) { 834 830 /* Duplicate found! Caller must try again. */ 835 - mutex_unlock(&qi->qi_tree_lock); 836 831 trace_xfs_dqget_dup(dqp); 837 - return error; 832 + goto out_unlock; 838 833 } 839 834 840 835 /* Return a locked dquot to the caller, with a reference taken. */ 841 836 xfs_dqlock(dqp); 842 837 dqp->q_nrefs = 1; 843 - 844 838 qi->qi_dquots++; 845 - mutex_unlock(&qi->qi_tree_lock); 846 839 847 - return 0; 840 + out_unlock: 841 + mutex_unlock(&qi->qi_tree_lock); 842 + memalloc_nofs_restore(nofs_flags); 843 + return error; 848 844 } 849 845 850 846 /* Check our input parameters. */
+7 -2
fs/xfs/xfs_trace.h
··· 4626 4626 char *path; 4627 4627 struct file *file = btp->bt_file; 4628 4628 4629 + __entry->dev = btp->bt_mount->m_super->s_dev; 4629 4630 __entry->ino = file_inode(file)->i_ino; 4630 4631 memset(pathname, 0, sizeof(pathname)); 4631 4632 path = file_path(file, pathname, sizeof(pathname) - 1); ··· 4634 4633 path = "(unknown)"; 4635 4634 strncpy(__entry->pathname, path, sizeof(__entry->pathname)); 4636 4635 ), 4637 - TP_printk("xmino 0x%lx path '%s'", 4636 + TP_printk("dev %d:%d xmino 0x%lx path '%s'", 4637 + MAJOR(__entry->dev), MINOR(__entry->dev), 4638 4638 __entry->ino, 4639 4639 __entry->pathname) 4640 4640 ); ··· 4644 4642 TP_PROTO(struct xfs_buftarg *btp), 4645 4643 TP_ARGS(btp), 4646 4644 TP_STRUCT__entry( 4645 + __field(dev_t, dev) 4647 4646 __field(unsigned long, ino) 4648 4647 __field(unsigned long long, bytes) 4649 4648 __field(loff_t, size) ··· 4653 4650 struct file *file = btp->bt_file; 4654 4651 struct inode *inode = file_inode(file); 4655 4652 4653 + __entry->dev = btp->bt_mount->m_super->s_dev; 4656 4654 __entry->size = i_size_read(inode); 4657 4655 __entry->bytes = (inode->i_blocks << SECTOR_SHIFT) + inode->i_bytes; 4658 4656 __entry->ino = inode->i_ino; 4659 4657 ), 4660 - TP_printk("xmino 0x%lx mem_bytes 0x%llx isize 0x%llx", 4658 + TP_printk("dev %d:%d xmino 0x%lx mem_bytes 0x%llx isize 0x%llx", 4659 + MAJOR(__entry->dev), MINOR(__entry->dev), 4661 4660 __entry->ino, 4662 4661 __entry->bytes, 4663 4662 __entry->size)