summaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-cmp.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2017-02-02 08:56:02 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-04 09:47:12 +0100
commit43ce5921773b827531ed123016625481d43c2bd9 (patch)
treead7ad68957a3d7f8efdd6a2180d17c8eca8e02fd /lib/mpi/mpi-cmp.c
parentb5f68e24cc7bc3492ebc5c70f3ef6babcbd4188b (diff)
xfs: sanity check inode mode when creating new dentry
commit fab8eef86c814c3dd46bc5d760b6e4a53d5fc5a6 upstream. The helper xfs_dentry_to_name() is used by 2 different classes of callers: Callers that pass zero mode and don't care about the returned name.type field and Callers that pass non zero mode and do care about the name.type field. Change xfs_dentry_to_name() to not take the mode argument and change the call sites of the first class to not pass the mode argument. Create a new helper xfs_dentry_mode_to_name() which does pass the mode argument and returns -EFSCORRUPTED if mode is invalid. Callers that translate non zero mode to on-disk file type now check the return value and will export the error to user instead of staging an invalid file type to be written to directory entry. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/mpi/mpi-cmp.c')
0 files changed, 0 insertions, 0 deletions