summaryrefslogtreecommitdiffstats
path: root/mm/init-mm.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2020-07-16 11:42:18 +0300
committerJan Kara <jack@suse.cz>2020-07-27 21:23:37 +0200
commitf35c41567867e06bb0a1d6b74c5bf323be1026e5 (patch)
treebeb4aab78dfae5cc44cd128df0d4b23ebd388e2b /mm/init-mm.c
parentf454fa610a69b93e7ed4de739e736f988d95c2d2 (diff)
downloadlinux-stable-f35c41567867e06bb0a1d6b74c5bf323be1026e5.tar.gz
linux-stable-f35c41567867e06bb0a1d6b74c5bf323be1026e5.tar.bz2
linux-stable-f35c41567867e06bb0a1d6b74c5bf323be1026e5.zip
fanotify: no external fh buffer in fanotify_name_event
The fanotify_fh struct has an inline buffer of size 12 which is enough to store the most common local filesystem file handles (e.g. ext4, xfs). For file handles that do not fit in the inline buffer (e.g. btrfs), an external buffer is allocated to store the file handle. When allocating a variable size fanotify_name_event, there is no point in allocating also an external fh buffer when file handle does not fit in the inline buffer. Check required size for encoding fh, preallocate an event buffer sufficient to contain both file handle and name and store the name after the file handle. At this time, when not reporting name in event, we still allocate the fixed size fanotify_fid_event and an external buffer for large file handles, but fanotify_alloc_name_event() has already been prepared to accept a NULL file_name. Link: https://lore.kernel.org/r/20200716084230.30611-11-amir73il@gmail.com Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'mm/init-mm.c')
0 files changed, 0 insertions, 0 deletions