Skip to content

Commit 4edcb9f

Browse files
amir73iljankara
authored andcommitted
fanotify: rename a misnamed constant
FANOTIFY_PIDFD_INFO_HDR_LEN is not the length of the header. Signed-off-by: Amir Goldstein <[email protected]> Signed-off-by: Jan Kara <[email protected]> Link: https://patch.msgid.link/8776ab90fe538225aeb561c560296bafd16b97c4.1731684329.git.josef@toxicpanda.com
1 parent b82c6f5 commit 4edcb9f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/notify/fanotify/fanotify_user.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct kmem_cache *fanotify_perm_event_cachep __ro_after_init;
117117
#define FANOTIFY_EVENT_ALIGN 4
118118
#define FANOTIFY_FID_INFO_HDR_LEN \
119119
(sizeof(struct fanotify_event_info_fid) + sizeof(struct file_handle))
120-
#define FANOTIFY_PIDFD_INFO_HDR_LEN \
120+
#define FANOTIFY_PIDFD_INFO_LEN \
121121
sizeof(struct fanotify_event_info_pidfd)
122122
#define FANOTIFY_ERROR_INFO_LEN \
123123
(sizeof(struct fanotify_event_info_error))
@@ -172,14 +172,14 @@ static size_t fanotify_event_len(unsigned int info_mode,
172172
dot_len = 1;
173173
}
174174

175-
if (info_mode & FAN_REPORT_PIDFD)
176-
event_len += FANOTIFY_PIDFD_INFO_HDR_LEN;
177-
178175
if (fanotify_event_has_object_fh(event)) {
179176
fh_len = fanotify_event_object_fh_len(event);
180177
event_len += fanotify_fid_info_len(fh_len, dot_len);
181178
}
182179

180+
if (info_mode & FAN_REPORT_PIDFD)
181+
event_len += FANOTIFY_PIDFD_INFO_LEN;
182+
183183
return event_len;
184184
}
185185

@@ -501,7 +501,7 @@ static int copy_pidfd_info_to_user(int pidfd,
501501
size_t count)
502502
{
503503
struct fanotify_event_info_pidfd info = { };
504-
size_t info_len = FANOTIFY_PIDFD_INFO_HDR_LEN;
504+
size_t info_len = FANOTIFY_PIDFD_INFO_LEN;
505505

506506
if (WARN_ON_ONCE(info_len > count))
507507
return -EFAULT;

0 commit comments

Comments
 (0)