From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Fleming Subject: Re: [PATCH v3] efivars,efi-pstore: Hold off deletion of sysfs entry until, the scan is completed Date: Wed, 30 Oct 2013 14:35:27 +0000 Message-ID: <20131030143527.GB8193@console-pimps.org> References: <52584373.3010202@hds.com> <20131017131821.GH10834@console-pimps.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Seiji Aguchi Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org" , "tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org" , Tomoki Sekiyama , "dle-develop-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" List-Id: linux-efi@vger.kernel.org On Fri, 18 Oct, at 10:30:58PM, Seiji Aguchi wrote: > The scanning and deleting logic is still needed. In case an entry(A) > is found, the pointer is saved to psi->data. And efi_pstore_read() > passes the entry(A) to a pstore filesystem by releasing > __efivars->lock. > > And then, the pstore filesystem calls efi_pstore_read() again and the > same entry(A), which is saved to psi->data, is used for re-scanning a > sysfs-list. (That is why list_for_each_entry_safe_from () is used in > efi_pstore_sysfs_entry_iter().) > > So, to protect the entry(A), the logic is needed because, in pstore > filesystem, __efivars->lock Is released. Very good point. -- Matt Fleming, Intel Open Source Technology Center