From: Dongliang Mu
In init_names, strlcpy will overread the src string as the src string is
less than GFS2_FSNAME_LEN(256).
Fix this by modifying strlcpy back to snprintf, reverting
the commit 00377d8e3842.
Fixes: 00377d8e3842 ("[GFS2] Prefer strlcpy() over snprintf()")
Reported-by: syzkaller
On Mon, Jun 27, 2022 at 09:06:43PM -0400, Alexander Aring wrote:
> >
> > If we change the refcount code to _never_ calling unlock() for the
> > specific lock, then all those foo_and_lock_bar() functions can be
> > annotated with "__acquires()". This should also end in the same code?
>
> sorry, thi
Dongliang Mu,
On Tue, Jun 28, 2022 at 8:10 AM Dongliang Mu wrote:
> From: Dongliang Mu
>
> In init_names, strlcpy will overread the src string as the src string is
> less than GFS2_FSNAME_LEN(256).
>
> Fix this by modifying strlcpy back to snprintf, reverting
> the commit 00377d8e3842.
... if t
Hi Luc,
On Tue, Jun 28, 2022 at 4:58 AM Luc Van Oostenryck
wrote:
>
> On Mon, Jun 27, 2022 at 09:06:43PM -0400, Alexander Aring wrote:
> > >
> > > If we change the refcount code to _never_ calling unlock() for the
> > > specific lock, then all those foo_and_lock_bar() functions can be
> > > annot
On Tue, Jun 28, 2022 at 1:58 AM Luc Van Oostenryck
wrote:
>
> I would certainly not recommend this but ...
> if it's OK to cheat and lie then you can do:
> + bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock)
> __acquires(lock);
Actually, we have "__cond_lock()" in the kernel to a
Add state and flags arguments to gfs2_rlist_alloc() to make it somewhat more
obvious which state and flags an rlist uses. With that, stop knocking off
flags in gfs2_glock_nq_m() and its nq_m_sync() helper that are never set in the
first place.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/dir.
Add state and flags arguments to gfs2_rlist_alloc() to make it somewhat more
obvious which state and flags an rlist uses. With that, stop knocking off
flags in gfs2_glock_nq_m() and its nq_m_sync() helper that are never set in the
first place.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/dir.
Include flock glocks in the "glockfd" debugfs file. Those are similar to the
iopen glocks; while an open file is holding an flock, it is holding the file's
flock glock.
We cannot take f_fl_mutex in gfs2_glockfd_seq_show_flock() or else dumping the
"glockfd" file would block on flock operations.
Add the GL_NOPID flag for the remaining glock holders which are not
associated with the current process.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/inode.c | 6 --
fs/gfs2/ops_fstype.c | 14 --
fs/gfs2/super.c | 3 ++-
fs/gfs2/util.c | 6 --
4 files cha
Currently, all glock holders in the "glocks" dump file are reported as
being associated with the process that acquired them, even for holders
that are actually associated with the filesystem itself (like the
journal glock holder) or with cached inodes (like iopen and flock glock
holders). This is
Add the GL_NOPID flag for flock glock holders. Clean up the flag
setting code in do_flock.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/file.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 25f4080bc973..1383f9598011 100644
---
Add a GL_NOPID flag to indicate that once a glock holder has been acquired, it
won't be associated with the current process anymore. This is useful for iopen
and flock glocks which are associated with open files, as well as journal glock
holders and similar which are associated with the filesystem
When a process has a gfs2 file open, the file is keeping a reference on the
underlying gfs2 inode, and the inode is keeping the inode's iopen glock held in
shared mode. In other words, the process depends on the iopen glock of each
open gfs2 file. Expose those dependencies in a new "glockfd" debu
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
nopid
head: b1d0ed94e881ca5b5aee15e05f13db75445398f2
commit: 13ba8572506201aa85020970f776597fbcdcda56 [1/5] gfs2: Add glockfd
debugfs file
config: csky-randconfig-r025-20220627
(https://download.01.org/0day-ci/archive/
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
nopid
head: b1d0ed94e881ca5b5aee15e05f13db75445398f2
commit: 13ba8572506201aa85020970f776597fbcdcda56 [1/5] gfs2: Add glockfd
debugfs file
config: arm64-buildonly-randconfig-r005-20220627
(https://download.01.org/0day-
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
nopid
head: b1d0ed94e881ca5b5aee15e05f13db75445398f2
commit: 13ba8572506201aa85020970f776597fbcdcda56 [1/5] gfs2: Add glockfd
debugfs file
config: csky-randconfig-r025-20220627
(https://download.01.org/0day-ci/archive/
16 matches
Mail list logo