From ad980c9ab77cc4e0edc5dd3361fd69daabeb99f9 Mon Sep 17 00:00:00 2001 From: Ryusuke Konishi Date: Tue, 2 Aug 2016 14:05:25 -0700 Subject: nilfs2: fix misuse of a semaphore in sysfs code Variables ns_seg_seq, ns_segnum, ns_nextnum, ns_pseg_offset, ns_cno, ns_ctime, ns_nongc_ctime, and ns_ndirtyblks, are protected by ns_segctor_sem, but ns_sem is wrongly used by the nilfs sysfs code when reading these variables. This fixes the misuse and clarifies which semaphore protects them in the comment of the_nilfs struct. Link: http://lkml.kernel.org/r/1465825507-3407-2-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/nilfs2/the_nilfs.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'fs/nilfs2/the_nilfs.h') diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h index 79d1421896d0..b305c6f033e7 100644 --- a/fs/nilfs2/the_nilfs.h +++ b/fs/nilfs2/the_nilfs.h @@ -122,11 +122,8 @@ struct the_nilfs { unsigned int ns_sb_update_freq; /* - * Following fields are dedicated to a writable FS-instance. - * Except for the period seeking checkpoint, code outside the segment - * constructor must lock a segment semaphore while accessing these - * fields. - * The writable FS-instance is sole during a lifetime of the_nilfs. + * The following fields are updated by a writable FS-instance. + * These fields are protected by ns_segctor_sem outside load_nilfs(). */ u64 ns_seg_seq; __u64 ns_segnum; -- cgit