[PATCH 2/2 net-next] libceph: Use __counted_by() in struct ceph_snap_context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Annotate the 'snaps' flexible array in "struct ceph_snap_context" with
__counted_by() so that additional checks can be made, if enabled.

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
Compile tested only
---
 include/linux/ceph/libceph.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 4497d0a6772c..485efc8837d5 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -164,7 +164,7 @@ struct ceph_snap_context {
 	refcount_t nref;
 	u64 seq;
 	u32 num_snaps;
-	u64 snaps[];
+	u64 snaps[] __counted_by(num_snaps);
 };
 
 extern struct ceph_snap_context *ceph_create_snap_context(u32 snap_count,
-- 
2.45.1





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux