From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934421AbdAHUKo (ORCPT ); Sun, 8 Jan 2017 15:10:44 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59083 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069AbdAHUKh (ORCPT ); Sun, 8 Jan 2017 15:10:37 -0500 Subject: Re: xfs: commit 6552321831dc "xfs: remove i_iolock and use i_rwsem in the VFS inode instead" change causes hang From: Mimi Zohar To: Al Viro Cc: Christoph Hellwig , James Bottomley , linux-xfs@vger.kernel.org, Dave Chinner , linux-fsdevel , linux-kernel Date: Sun, 08 Jan 2017 15:10:28 -0500 In-Reply-To: <20170108192634.GM1555@ZenIV.linux.org.uk> References: <1483886924.8189.81.camel@linux.vnet.ibm.com> <20170108145200.GA29570@lst.de> <1483898365.2542.13.camel@HansenPartnership.com> <20170108181856.GA781@lst.de> <1483901848.2542.27.camel@HansenPartnership.com> <20170108190955.GA1489@lst.de> <20170108192634.GM1555@ZenIV.linux.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 (3.12.11-1.fc21) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17010820-0048-0000-0000-000001F549B5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17010820-0049-0000-0000-000047510D81 Message-Id: <1483906228.2956.59.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-08_15:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701080305 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2017-01-08 at 19:26 +0000, Al Viro wrote: > On Sun, Jan 08, 2017 at 08:09:55PM +0100, Christoph Hellwig wrote: > > > No. We need an ->ima_measure file_operation, guts of process_measurement > > turned into a library function that the FS can call after taking fs-specific > > locks. And maybe also a small wrapper around it that takes ilock and > > can be used directly for file systems not needing special locking. > > Incidentally, it had been literally years since the problems with their > pathname handling had been brought up and we *still* have got no answer. > In the current tree, ima_d_path() is quite capable of returning > path->dentry->d_name.name. Which gets used by subsequent code, > even though there is no warranty whatsoever that it won't be > pointing to freed memory by the time the caller of ima_d_path() > gets it. The pathname/filename is being used in the measurement list and for audit logging. It's currently using d_absolute_path() to get the full pathname, but falls back to using the dentry->d_name.name on failure. Ok, so instead of returning the dentry->d_name.name, we should make a copy it, assuming the error isn't memory related. Mimi