]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fc: fix the fc_appid_store return value
authorChristoph Hellwig <hch@lst.de>
Sat, 6 Aug 2022 08:29:55 +0000 (10:29 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 10 Aug 2022 14:05:08 +0000 (16:05 +0200)
commit350a99f544b882280c5929b350cb93c97d46bf5a
tree215ab4241fb4190b343a6397e150899a0519b030
parent5dee1975d5a988033ebafb199676e8f45ab3bc1a
nvme-fc: fix the fc_appid_store return value

"nvme-fc: fold t fc_update_appid into fc_appid_store" accidentally
changed the userspace interface for the appid attribute, because the code
that decrements "count" to remove a trailing '\n' in the parsing results
in the decremented value being incorrectly be returned from the sysfs
write.  Fix this by keeping an orig_count variable for the full length
of the write.

Fixes: b6571210c30a ("nvme-fc: fold t fc_update_appid into fc_appid_store")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Tested-by: Muneendra Kumar M <muneendra.kumar@broadcom.com>
drivers/nvme/host/fc.c