powerpc/opal_elog: Handle multiple writes to ack attribute
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Wed, 14 Oct 2020 06:48:13 +0000 (12:18 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 16 Oct 2020 03:25:12 +0000 (14:25 +1100)
commitd4263b12a1a0e8816e021450be0765a1ad8bb53c
tree7843fdd514b5857773ae2ab995755dbdf56ea61c
parentffd0b25ca049a477cb757e5bcf2d5e1664d12e5d
powerpc/opal_elog: Handle multiple writes to ack attribute

Even though we use self removing sysfs helper, we still need
to make sure we do the final kobject delete conditionally.
sysfs_remove_file_self() will handle parallel calls to remove
the sysfs attribute file and returns true only in the caller
that removed the attribute file. The other parallel callers
are returned false. Do the final kobject delete checking
the return value of sysfs_remove_file_self().

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201014064813.109515-1-aneesh.kumar@linux.ibm.com
arch/powerpc/platforms/powernv/opal-elog.c