Skip to content

Commit ccb4901

Browse files
committed
quota: Properly annotate i_dquot arrays with __rcu
Dquots pointed to from i_dquot arrays in inodes are protected by dquot_srcu. Annotate them as such and change .get_dquots callback to return properly annotated pointer to make sparse happy. Fixes: b9ba6f9 ("quota: remove dqptr_sem") Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 179b8c9 commit ccb4901

File tree

16 files changed

+16
-17
lines changed

16 files changed

+16
-17
lines changed

fs/ext2/ext2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ struct ext2_inode_info {
674674
struct inode vfs_inode;
675675
struct list_head i_orphan; /* unlinked but open inodes */
676676
#ifdef CONFIG_QUOTA
677-
struct dquot *i_dquot[MAXQUOTAS];
677+
struct dquot __rcu *i_dquot[MAXQUOTAS];
678678
#endif
679679
};
680680

fs/ext2/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, siz
320320
static ssize_t ext2_quota_write(struct super_block *sb, int type, const char *data, size_t len, loff_t off);
321321
static int ext2_quota_on(struct super_block *sb, int type, int format_id,
322322
const struct path *path);
323-
static struct dquot **ext2_get_dquots(struct inode *inode)
323+
static struct dquot __rcu **ext2_get_dquots(struct inode *inode)
324324
{
325325
return EXT2_I(inode)->i_dquot;
326326
}

fs/ext4/ext4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ struct ext4_inode_info {
11561156
tid_t i_datasync_tid;
11571157

11581158
#ifdef CONFIG_QUOTA
1159-
struct dquot *i_dquot[MAXQUOTAS];
1159+
struct dquot __rcu *i_dquot[MAXQUOTAS];
11601160
#endif
11611161

11621162
/* Precomputed uuid+inum+igen checksum for seeding inode checksums */

fs/ext4/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
16001600
static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
16011601
unsigned int flags);
16021602

1603-
static struct dquot **ext4_get_dquots(struct inode *inode)
1603+
static struct dquot __rcu **ext4_get_dquots(struct inode *inode)
16041604
{
16051605
return EXT4_I(inode)->i_dquot;
16061606
}

fs/f2fs/f2fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ struct f2fs_inode_info {
829829
spinlock_t i_size_lock; /* protect last_disk_size */
830830

831831
#ifdef CONFIG_QUOTA
832-
struct dquot *i_dquot[MAXQUOTAS];
832+
struct dquot __rcu *i_dquot[MAXQUOTAS];
833833

834834
/* quota space reservation, managed internally by quota code */
835835
qsize_t i_reserved_quota;

fs/f2fs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2768,7 +2768,7 @@ int f2fs_dquot_initialize(struct inode *inode)
27682768
return dquot_initialize(inode);
27692769
}
27702770

2771-
static struct dquot **f2fs_get_dquots(struct inode *inode)
2771+
static struct dquot __rcu **f2fs_get_dquots(struct inode *inode)
27722772
{
27732773
return F2FS_I(inode)->i_dquot;
27742774
}

fs/jfs/jfs_incore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct jfs_inode_info {
9292
} link;
9393
} u;
9494
#ifdef CONFIG_QUOTA
95-
struct dquot *i_dquot[MAXQUOTAS];
95+
struct dquot __rcu *i_dquot[MAXQUOTAS];
9696
#endif
9797
u32 dev; /* will die when we get wide dev_t */
9898
struct inode vfs_inode;

fs/jfs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type,
824824
return len - towrite;
825825
}
826826

827-
static struct dquot **jfs_get_dquots(struct inode *inode)
827+
static struct dquot __rcu **jfs_get_dquots(struct inode *inode)
828828
{
829829
return JFS_IP(inode)->i_dquot;
830830
}

fs/ocfs2/inode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct ocfs2_inode_info
6565
tid_t i_sync_tid;
6666
tid_t i_datasync_tid;
6767

68-
struct dquot *i_dquot[MAXQUOTAS];
68+
struct dquot __rcu *i_dquot[MAXQUOTAS];
6969
};
7070

7171
/*

fs/ocfs2/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend);
122122
static int ocfs2_enable_quotas(struct ocfs2_super *osb);
123123
static void ocfs2_disable_quotas(struct ocfs2_super *osb);
124124

125-
static struct dquot **ocfs2_get_dquots(struct inode *inode)
125+
static struct dquot __rcu **ocfs2_get_dquots(struct inode *inode)
126126
{
127127
return OCFS2_I(inode)->i_dquot;
128128
}

0 commit comments

Comments
 (0)