Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932624AbcKBRhp (ORCPT ); Wed, 2 Nov 2016 13:37:45 -0400 Received: from us-smtp-delivery-194.mimecast.com ([216.205.24.194]:58081 "EHLO us-smtp-delivery-194.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756019AbcKBRhn (ORCPT ); Wed, 2 Nov 2016 13:37:43 -0400 From: Trond Myklebust To: Sebastian Andrzej Siewior CC: Schumaker Anna , List Linux NFS Mailing , List Linux Kernel Mailing , "tglx@linutronix.de" Subject: Re: [PATCH v3] NFSv4: replace seqcount_t with a rw_semaphore Thread-Topic: [PATCH v3] NFSv4: replace seqcount_t with a rw_semaphore Thread-Index: AQHSM3mEHI2fh+m5skS58vgJ3aR4g6DCsFUAgAAHVwCAAAQfgIADNaeAgAAHNAA= Date: Wed, 2 Nov 2016 17:37:37 +0000 Message-ID: References: <20161021164727.24485-1-bigeasy@linutronix.de> <20161028210511.k7hrsfxovti7gqtu@linutronix.de> <747E2CCB-3D83-40FD-8B31-46AB5A5E8592@primarydata.com> <20161031131958.mrrez5t7sow75p6v@linutronix.de> <51E3F753-2D1F-4370-BFEB-BD8356D622A1@primarydata.com> <20161031155616.fqbqy53bwpanufhn@linutronix.de> <40147FA4-9FD8-4349-B309-751DFCE875A2@primarydata.com> <20161102171149.kl66dlmlrc44zock@linutronix.de> In-Reply-To: <20161102171149.kl66dlmlrc44zock@linutronix.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [50.124.59.220] x-ms-office365-filtering-correlation-id: ecb29ebc-7d9d-4d11-04bd-08d40346efeb x-microsoft-exchange-diagnostics: 1;BN6PR11MB1570;7:xTqWEs46hSQMqS4zdpPF+oVYv36KmTkbMkAFRV7/CbD+iaTh272hgaRvf3/92ziX9Ml1vWPX8jBJKx+rr3vxiiFQvuIFlNDc8/3uJOn8Ty/lIA7KqltX6lvyNGj4s/qtuxJ4s0MR4fdiFNgIYSrLHi/ViEoUT60+xajU4GxBjzjcDpjHh0eC+XcKJ/UI/EvkAJRiGCMgeEe8tu3/t+Jw5y3U60305hQuHRE04agNGDILtvyjnh8wRAdN+U6WybW5JhuMBHaFFVc2J3/k76/cxHWbqElHTp9uAEcJB/q8hSxpJGu6zGQ6rLwePKyVqd9LFLUhliMwHTj7uQLFJS0NBqCuEycNNC7/E4mla9CBE/g=;20:Z43+pTw7qfUWGNieFnB4Ghz1oGTAnylGEi6fnpuc3WuTGYwYoYUcrx4CrX5jSwOAtDAIchBsTIshY51iMVG95hgyO/M12J8Oae9bAQsxOklhN6MQv29AUZTLY7zBkEvl0D4RRHWY+0YSz7MzxsWcWfLzCMh41tSF23OP+/ucTyE= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN6PR11MB1570; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6043046)(6042046);SRVR:BN6PR11MB1570;BCL:0;PCL:0;RULEID:;SRVR:BN6PR11MB1570; x-forefront-prvs: 0114FF88F6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(189002)(377424004)(199003)(24454002)(93886004)(5002640100001)(92566002)(82746002)(19580395003)(66066001)(102836003)(586003)(3846002)(6116002)(3280700002)(19580405001)(68736007)(83716003)(81156014)(4326007)(8676002)(4001150100001)(2900100001)(8936002)(81166006)(87936001)(97736004)(86362001)(3660700001)(11100500001)(77096005)(101416001)(36756003)(7846002)(50986999)(76176999)(5660300001)(189998001)(7736002)(305945005)(106356001)(54356999)(10400500002)(122556002)(2950100002)(2906002)(110136003)(33656002)(106116001)(6916009)(105586002)(99286002)(104396002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR11MB1570;H:BN6PR11MB1570.namprd11.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <6670DD2DAB135147A415549203791D1B@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: primarydata.com X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2016 17:37:37.0991 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 03193ed6-8726-4bb3-a832-18ab0d28adb7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1570 X-MC-Unique: 5vnthpPoP1WtXzBC2B6zwQ-1 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id uA2HdOR0010396 Content-Length: 572 Lines: 14 > On Nov 2, 2016, at 13:11, Sebastian Andrzej Siewior wrote: > > On 2016-10-31 16:11:02 [+0000], Trond Myklebust wrote: >> >> Yes, and yes. We can’t rely on the list pointers remaining correct, so we restart the list scan and we use the ops->state_flag_bit to signal whether or not state has been recovered for the entry being scanned. > > but this is tested at the top of the loop and by then you look at > lists' ->next pointer which might be invalid. > No. We ensure we restart the list scan if we release the spinlock. It’s safe…