diff --git a/.mailmap b/.mailmap index bb8cd0c84747..e3e2deba0b4f 100644 --- a/.mailmap +++ b/.mailmap @@ -64,6 +64,7 @@ Alex Elder Alex Elder Alex Elder Alex Elder +Alex Elder Alex Hung Alex Shi Alex Shi @@ -82,6 +83,7 @@ Amit Blay Amit Nischal Andi Kleen Andi Shyti +Andrea Cervesato Andreas Herrmann Andreas Hindborg Andrej Shadura @@ -154,6 +156,7 @@ Bart Van Assche Bart Van Assche Bartosz Golaszewski Bartosz Golaszewski +Beat M. Liechti Ben Dooks Ben Dooks Ben Gardner @@ -180,7 +183,8 @@ Boris Brezillon Boris Brezillon Boris Brezillon Boris Brezillon -Bradley Morgan +Bradley Morgan +Bradley Morgan Brendan Higgins Brendan Jackman Brian Avery @@ -356,8 +360,10 @@ Gokul Sriram Palanisamy Govindaraj Saminathan Guo Ren Guo Ren -Guodong Xu -Guodong Xu +Guodong Xu +Guodong Xu +Guodong Xu +Guodong Xu Guru Das Srinagesh Guru Das Srinagesh Guru Das Srinagesh @@ -589,6 +595,9 @@ Lorenzo Stoakes Luca Ceresoli Luca Weiss Lucas De Marchi +Luiz Capitulino +Luiz Capitulino +Luiz Capitulino Lukasz Luba Luo Jie Luo Jie @@ -658,7 +667,8 @@ Maxwell Doose Maya Erez Mayuresh Janorkar Md Sadre Alam -Miaoqing Pan +Miaoqing Pan +Miaoqing Pan Michael Buesch Michael Chan Michael Grzeschik @@ -671,6 +681,7 @@ Michel Lespinasse Michel Lespinasse Mickaël Salaün Miguel Ojeda +Mika Westerberg Mike Leach Mike Rapoport Mike Rapoport @@ -692,6 +703,7 @@ Mythri P K Nadav Amit Nadav Amit Nadia Yvette Chambers William Lee Irwin III +Naman Jain Naoya Horiguchi Naoya Horiguchi Natalie Vock @@ -810,6 +822,8 @@ Richard Genoud Richard Leitner Richard Leitner Richard Leitner +Ridong Chen +Ridong Chen Rob Clark Rob Clark Robert Foss @@ -828,6 +842,7 @@ Rui Saraiva Sachin Mokashi Sachin P Sant Sai Prakash Ranjan +Sai Teja Aluvala Sakari Ailus Sam Protsenko Sam Protsenko @@ -1007,6 +1022,7 @@ Vlad Dogaru Vladimir Davydov Vladimir Davydov Vlastimil Babka +Wang Yibo WangYuli WangYuli Wei Wang diff --git a/Documentation/process/submitting-patches.rst b/Documentation/process/submitting-patches.rst index f271d7413f72..85ba046d66fb 100644 --- a/Documentation/process/submitting-patches.rst +++ b/Documentation/process/submitting-patches.rst @@ -239,9 +239,12 @@ patches as arguments to scripts/get_maintainer.pl). If you cannot find a maintainer for the subsystem you are working on, Andrew Morton (akpm@linux-foundation.org) serves as a maintainer of last resort. -linux-kernel@vger.kernel.org should be used by default for all patches, but the -volume on that list has caused a number of developers to tune it out. Please -do not spam unrelated lists and unrelated people, though. +You should also normally choose at least one mailing list to receive a copy of +your patch set. Look in the MAINTAINERS file for a subsystem-specific list; +your patch will probably get more attention there. +linux-kernel@vger.kernel.org functions as a list of last resort for patches +that do not have a subsystem-specific list. Please do not spam unrelated lists +and unrelated people, though. Many kernel-related lists are hosted at kernel.org; you can find a list of them at https://subspace.kernel.org. There are kernel-related lists diff --git a/MAINTAINERS b/MAINTAINERS index d738990161bd..ca1c59e1fc59 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8884,7 +8884,7 @@ F: Documentation/devicetree/bindings/gpu/ F: Documentation/gpu/ F: drivers/gpu/drm/ F: drivers/gpu/vga/ -F: include/drm/drm +F: include/drm/drm*.h F: include/linux/vga* F: include/uapi/drm/ X: drivers/gpu/drm/amd/ @@ -15933,7 +15933,7 @@ F: Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt F: drivers/i2c/muxes/i2c-mux-ltc4306.c LTP (Linux Test Project) -M: Andrea Cervesato +M: Andrea Cervesato M: Cyril Hrubis M: Jan Stancek M: Petr Vorel diff --git a/fs/ocfs2/dlmfs/userdlm.c b/fs/ocfs2/dlmfs/userdlm.c index 617c92e7b925..516e50a5728d 100644 --- a/fs/ocfs2/dlmfs/userdlm.c +++ b/fs/ocfs2/dlmfs/userdlm.c @@ -162,7 +162,13 @@ static void user_dlm_unblock_lock(struct work_struct *work); static void __user_dlm_queue_lockres(struct user_lock_res *lockres) { + struct inode *inode = user_dlm_inode_from_user_lockres(lockres); + if (!(lockres->l_flags & USER_LOCK_QUEUED)) { + /* Pin the superblock through the worker's iput(). */ + if (!atomic_inc_not_zero(&inode->i_sb->s_active)) + return; + user_dlm_grab_inode_ref(lockres); INIT_WORK(&lockres->l_work, user_dlm_unblock_lock); @@ -275,9 +281,11 @@ static struct ocfs2_locking_protocol user_dlm_lproto = { static inline void user_dlm_drop_inode_ref(struct user_lock_res *lockres) { - struct inode *inode; - inode = user_dlm_inode_from_user_lockres(lockres); + struct inode *inode = user_dlm_inode_from_user_lockres(lockres); + struct super_block *sb = inode->i_sb; + iput(inode); + deactivate_super(sb); } static void user_dlm_unblock_lock(struct work_struct *work) diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index c281902e3bec..a4131d4dd956 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3094,9 +3094,17 @@ static void *ocfs2_dlm_seq_start(struct seq_file *m, loff_t *pos) { struct ocfs2_dlm_seq_priv *priv = m->private; struct ocfs2_lock_res *iter; + struct ocfs2_lock_res *dummy = &priv->p_iter_res; + /* Continue or retry the snapshot left by ->next(). */ + if (*pos) + return priv->p_tmp_res.l_ops ? &priv->p_tmp_res : NULL; + + /* Reads from zero and seek traversal start at the list head. */ spin_lock(&ocfs2_dlm_tracking_lock); - iter = ocfs2_dlm_next_res(&priv->p_iter_res, priv); + list_move(&dummy->l_debug_list, + &priv->p_dlm_debug->d_lockres_tracking); + iter = ocfs2_dlm_next_res(dummy, priv); if (iter) { /* Since lockres' have the lifetime of their container * (which can be inodes, ocfs2_supers, etc) we want to @@ -3105,8 +3113,11 @@ static void *ocfs2_dlm_seq_start(struct seq_file *m, loff_t *pos) * trust any pointers on the copy returned, but that's * ok as the information we want isn't typically held * in them. */ + list_move(&dummy->l_debug_list, &iter->l_debug_list); priv->p_tmp_res = *iter; iter = &priv->p_tmp_res; + } else { + priv->p_tmp_res.l_ops = NULL; } spin_unlock(&ocfs2_dlm_tracking_lock); @@ -3120,17 +3131,19 @@ static void ocfs2_dlm_seq_stop(struct seq_file *m, void *v) static void *ocfs2_dlm_seq_next(struct seq_file *m, void *v, loff_t *pos) { struct ocfs2_dlm_seq_priv *priv = m->private; - struct ocfs2_lock_res *iter = v; + struct ocfs2_lock_res *iter; struct ocfs2_lock_res *dummy = &priv->p_iter_res; (*pos)++; spin_lock(&ocfs2_dlm_tracking_lock); - iter = ocfs2_dlm_next_res(iter, priv); + iter = ocfs2_dlm_next_res(dummy, priv); list_del_init(&dummy->l_debug_list); if (iter) { list_add(&dummy->l_debug_list, &iter->l_debug_list); priv->p_tmp_res = *iter; iter = &priv->p_tmp_res; + } else { + priv->p_tmp_res.l_ops = NULL; } spin_unlock(&ocfs2_dlm_tracking_lock); diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 80c36c60a8ce..e225a96d3753 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -1318,15 +1318,16 @@ static void ocfs2_clear_inode(struct inode *inode) oi->ip_blkno = 0ULL; /* - * ip_jinode is used to track txns against this inode. We ensure that - * the journal is flushed before journal shutdown. Thus it is safe to - * have inodes get cleaned up after journal shutdown. + * ip_jinode is used to track txns against this inode. The journal is + * flushed before it is shut down, so an inode cleaned up after that + * has nothing left to release. Hold the shutdown lock so a journal + * found here stays allocated until the release has finished. */ - if (!osb->journal) - return; - - jbd2_journal_release_jbd_inode(osb->journal->j_journal, - &oi->ip_jinode); + down_read(&osb->journal_shutdown_sem); + if (osb->journal) + jbd2_journal_release_jbd_inode(osb->journal->j_journal, + &oi->ip_jinode); + up_read(&osb->journal_shutdown_sem); } void ocfs2_evict_inode(struct inode *inode) diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index cbb44e280d4b..9c4a48887c9a 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -352,7 +352,7 @@ static int ocfs2_commit_cache(struct ocfs2_super *osb) trace_ocfs2_commit_cache_end(journal->j_trans_id, flushed); ocfs2_wake_downconvert_thread(osb); - wake_up(&journal->j_checkpointed); + wake_up(&osb->checkpoint_event); finally: return status; } @@ -901,7 +901,6 @@ int ocfs2_journal_alloc(struct ocfs2_super *osb) atomic_set(&journal->j_num_trans, 0); init_rwsem(&journal->j_trans_barrier); - init_waitqueue_head(&journal->j_checkpointed); spin_lock_init(&journal->j_lock); journal->j_trans_id = 1UL; INIT_LIST_HEAD(&journal->j_la_cleanups); @@ -1073,12 +1072,14 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb) journal = osb->journal; if (!journal) - goto done; + return; inode = journal->j_inode; - if (journal->j_state != OCFS2_JOURNAL_LOADED) - goto done; + if (journal->j_state != OCFS2_JOURNAL_LOADED) { + down_write(&osb->journal_shutdown_sem); + goto free; + } /* need to inc inode use count - jbd2_journal_destroy will iput. */ if (!igrab(inode)) @@ -1114,6 +1115,12 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb) mlog_errno(status); } + /* + * Exclude the final JBD2 inode cleanup in ocfs2_clear_inode() while + * the journal is destroyed and freed. + */ + down_write(&osb->journal_shutdown_sem); + /* Shutdown the kernel journal system */ if (!jbd2_journal_destroy(journal->j_journal) && !status) { /* @@ -1136,10 +1143,17 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb) journal->j_state = OCFS2_JOURNAL_FREE; -done: - iput(inode); - kfree(journal); +free: + /* Serialize the removal with ocfs2_ci_fully_checkpointed(). */ + spin_lock(&trans_inc_lock); osb->journal = NULL; + spin_unlock(&trans_inc_lock); + wake_up(&osb->checkpoint_event); + kfree(journal); + up_write(&osb->journal_shutdown_sem); + + /* The journal inode's own cleanup takes the read side. */ + iput(inode); } static void ocfs2_clear_journal_error(struct super_block *sb, diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 4b52bf7b0938..f6bfb5d05d3d 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -54,7 +54,6 @@ struct ocfs2_journal { spinlock_t j_lock; unsigned long j_trans_id; struct rw_semaphore j_trans_barrier; - wait_queue_head_t j_checkpointed; /* both fields protected by j_lock*/ struct list_head j_la_cleanups; @@ -91,11 +90,15 @@ static inline void ocfs2_set_ci_lock_trans(struct ocfs2_journal *journal, static inline int ocfs2_ci_fully_checkpointed(struct ocfs2_caching_info *ci) { int ret; - struct ocfs2_journal *journal = - OCFS2_SB(ocfs2_metadata_cache_get_super(ci))->journal; + struct ocfs2_super *osb = + OCFS2_SB(ocfs2_metadata_cache_get_super(ci)); + struct ocfs2_journal *journal; spin_lock(&trans_inc_lock); - ret = time_after(journal->j_trans_id, ci->ci_last_trans); + journal = osb->journal; + /* A NULL journal has already completed checkpointing. */ + ret = !journal || + time_after(journal->j_trans_id, ci->ci_last_trans); spin_unlock(&trans_inc_lock); return ret; } @@ -196,9 +199,6 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) if (ocfs2_mount_local(osb)) return; - if (!osb->journal) - return; - if (!ocfs2_ci_fully_checkpointed(INODE_CACHE(inode))) { /* WARNING: This only kicks off a single * checkpoint. If someone races you and adds more @@ -208,7 +208,8 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) * OK. */ ocfs2_start_checkpoint(osb); - wait_event(osb->journal->j_checkpointed, + /* The wait queue must outlive journal shutdown. */ + wait_event(osb->checkpoint_event, ocfs2_ci_fully_checkpointed(INODE_CACHE(inode))); } } diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c index 6c570157caf1..1c03f45e8965 100644 --- a/fs/ocfs2/mmap.c +++ b/fs/ocfs2/mmap.c @@ -103,7 +103,17 @@ static vm_fault_t __ocfs2_page_mkwrite(struct file *file, goto out; } err = ocfs2_write_end_nolock(mapping, pos, len, len, fsdata); - BUG_ON(err != len); + if (err != len) { + /* + * ocfs2_write_end_nolock() keeps the mmap folio locked so + * that it can be returned to the VM with VM_FAULT_LOCKED. + * On failure nobody else will unlock it, so do it here. + */ + folio_unlock(locked_folio); + mlog_errno(err); + ret = vmf_error(err); + goto out; + } ret = VM_FAULT_LOCKED; out: return ret; diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index e3bb3cc0b25a..8bee145e4888 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -388,6 +388,7 @@ struct ocfs2_super enum ocfs2_recovery_state recovery_state; wait_queue_head_t checkpoint_event; struct ocfs2_journal *journal; + struct rw_semaphore journal_shutdown_sem; unsigned long osb_commit_interval; /* Journal triggers for checksum */ diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 0781c5cbdb11..d2021405d408 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -2048,6 +2048,7 @@ static int ocfs2_initialize_super(struct super_block *sb, } init_waitqueue_head(&osb->checkpoint_event); + init_rwsem(&osb->journal_shutdown_sem); osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM; diff --git a/lib/fault-inject.c b/lib/fault-inject.c index 02916ef2761c..9182d457baf5 100644 --- a/lib/fault-inject.c +++ b/lib/fault-inject.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only #include #include +#include #include #include #include @@ -50,7 +51,12 @@ int setup_fault_attr(struct fault_attr *attr, char *str) return 0; } - prandom_init_once(&fault_rnd_state); + /* + * __setup handlers run before slab and workqueues are initialized, + * but prandom_init_once() calls kmalloc() and schedule_work(). So use + * DO_ONCE_LITE() instead. + */ + DO_ONCE_LITE(prandom_seed_full_state, &fault_rnd_state); attr->probability = probability; attr->interval = interval; diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 16b80a700d4a..265245e568c6 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -959,6 +959,15 @@ sub get_maintainers { $tvi = $end + 1; } + # THE REST matches every file, so only fall back to it when no + # other matching section provides a mailing list for this file + # that we would actually output with the current options. + my ($the_rest) = grep { get_section_name($_) eq "THE REST" } keys %hash; + if (defined($the_rest) && + grep { $_ != $the_rest && section_has_list($_) } keys %hash) { + delete $hash{$the_rest}; + } + foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) { add_categories($line, ""); if ($sections) { @@ -1295,6 +1304,40 @@ sub find_ending_index { return $index; } +sub get_section_name { + my ($index) = @_; + + return $typevalue[find_starting_index($index)]; +} + +sub section_has_list { + my ($index) = @_; + + my $start = find_starting_index($index); + my $end = find_ending_index($index); + for (my $i = $start; $i < $end; $i++) { + next if ($typevalue[$i] !~ m/^L:\s*(.*)/); + my $list_additional = ""; + if ($1 =~ m/[^\s]+\s+(.*)$/) { + $list_additional = $1; + } + return 1 if (list_is_selected($list_additional)); + } + return 0; +} + +# Must match the list selection in add_categories() +sub list_is_selected { + my ($list_additional) = @_; + + if ($list_additional =~ m/subscribers-only/) { + return $email_subscriber_list; + } elsif ($list_additional =~ m/moderated/) { + return $email_list && $email_moderated_list; + } + return $email_list; +} + sub get_subsystem_name { my ($index) = @_;