From 6147b43f5e23ce136d5421f0c6ff62842dcbe6b8 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Mon, 14 Feb 2022 15:32:08 +0530 Subject: [PATCH] EX-4841 ofd: Return EOPNOTSUPP instead of EPROTO Modify server to return -EOPNOTSUPP instead of -EPROTO for unsupported fallocate modes Lustre-commit: TBD (5ad69eae24a4f1a6bc02a9fa9d66b0ed1a57fe84) Lustre-change: https://review.whamcloud.com/46516 Fixes: 7462e8cad730 ("LU-14160 fallocate: Add punch mode to fallocate") Signed-off-by: arshad.hussain@aeoncomputing.com Change-Id: Id203c0b9abbdd674af33f1f78e81ae7fe105e90f Reviewed-on: https://review.whamcloud.com/46527 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Patrick Farrell --- lustre/ofd/ofd_dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index b288b8e..e84379a 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -1969,7 +1969,10 @@ static int ofd_fallocate_hdl(struct tgt_session_info *tsi) */ if ((oa->o_valid & (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS)) != (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS)) - RETURN(err_serious(-EPROTO)); + /* Return -EOPNOTSUPP to also handle older + * clients not supporting newer server modes + */ + RETURN(-EOPNOTSUPP); start = oa->o_size; end = oa->o_blocks; -- 1.8.3.1