From owner-freebsd-current@freebsd.org Thu Aug 9 20:38:53 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D62CB1073006 for ; Thu, 9 Aug 2018 20:38:52 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660042.outbound.protection.outlook.com [40.107.66.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7EB86AC2 for ; Thu, 9 Aug 2018 20:38:52 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM (52.132.44.160) by YTOPR0101MB1145.CANPRD01.PROD.OUTLOOK.COM (52.132.50.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 9 Aug 2018 20:38:51 +0000 Received: from YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM ([fe80::88ec:8aee:77d7:6716]) by YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM ([fe80::88ec:8aee:77d7:6716%2]) with mapi id 15.20.1017.020; Thu, 9 Aug 2018 20:38:51 +0000 From: Rick Macklem To: Konstantin Belousov CC: "freebsd-current@FreeBSD.org" , "peter@holm.cc" Subject: Re: ffs_truncate3 panics Thread-Topic: ffs_truncate3 panics Thread-Index: AQHULkj8zfSrFB+Dkkqu0NmeGvZbQKS0RKaAgAGEoXWAAKUlgIAANVYCgACitwCAAJvZIg== Date: Thu, 9 Aug 2018 20:38:50 +0000 Message-ID: References: <20180807131445.GC1884@kib.kiev.ua> <20180808221647.GH1884@kib.kiev.ua> , <20180809111004.GK1884@kib.kiev.ua> In-Reply-To: <20180809111004.GK1884@kib.kiev.ua> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB1145; 6:MrsSFJX4ierS3V6l6IAZASKMuNODug3Oof5e2WJGFCWsSraRHpEQNDSc5iSGubfUB05Moe9/LnDquR58Nv7rGY2UZue5FZZgaifN99t6rJa37K/hooXaIFjxMEgKa8v1pi6AXb7GfX2giYlo98zmbRKS78iSfxpxcleKgEolF3Wc0VqNiWhm+XKwnafFLyEirgXb0AqS/1QD9QEQbxF4wiwmcWX9bvYt+9CW+um50+/2g2JeTQdKVdr4MUFbHj6fBAEMI7+4kMuPf/ouaoi4eSyI87cJ7hOM1k0Sr2rlJF1YTrI/uKDBMlhDbQkDS40UP/m4bR26Y/Ahhtt2jRDdYLZrFUsEfgp/EnMmrxxxBRQAq/c2pMhmsELvn4j2uJmWnoCXJz7q2flc+4VWC/M9wh/ArX5xouA0EoOFewprleAD9FVWlKnP9eZ4Vjev7j1wrHUAGb14PE1CR0EJVrKl0Q==; 5:4NgQscMOXTm33+oE38/iXuHQ4zUwaf4PwynbeCfQoETFf2an2bPYvRUQXI+le73uU81tSZkwXJBW3OgKT3KH83+8znn3o9n4fyz1zpzKlnnKVswYIjMsTYpdx33u+ZWrdhNRI+Mbnukqfv87JHEO3gFZFQiuMysJt9Db6BoY87A=; 7:aIvTRyOFzCeFUcuRriaDrJtozuhBxkafkZgLKsyJZtjxuDpd/tOqCMUxZu5YxWjnlQ2K9X8YVjjIosYycoi4kDAtK8v4plcU+LLSPl+iFYEyHqJl0L3nocRZt1z9Ntxh7X/JWDFQkY8qQ0o9elAlxzAss8tfNxY7IBp7tnXVCnWu1JK3n+3P6UmNfRgv/JXC6AJgmFKXMzzvZLMw4leKmpTQshZYK+cdBssjrkqk5OCTMykTEKnAYUEWnaKCdwIt x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 05f29a83-9a86-4b4f-8cd2-08d5fe381d94 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB1145; x-ms-traffictypediagnostic: YTOPR0101MB1145: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:YTOPR0101MB1145; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB1145; x-forefront-prvs: 0759F7A50A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(366004)(346002)(136003)(199004)(189003)(6246003)(68736007)(305945005)(105586002)(86362001)(74316002)(6436002)(55016002)(97736004)(486006)(9686003)(4326008)(8676002)(81156014)(229853002)(39060400002)(81166006)(446003)(476003)(106356001)(2900100001)(6916009)(11346002)(14454004)(186003)(54906003)(14444005)(25786009)(7696005)(33656002)(316002)(478600001)(8936002)(102836004)(2906002)(1411001)(26005)(786003)(5660300001)(256004)(6506007)(7116003)(93886005)(76176011)(99286004)(74482002)(5250100002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB1145; H:YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3ZxozHdrbeCsB46LkqxzEvVi00Gabb81pGkhVG1IBi0JZ59gIfjSCzvNOzPS7f0JAHcMbEv7URKDYkeNZpaCzT+udUIcjY7ldqUlYCuUxuDH41uEfYeU+FMyncK0jlEU+hWsti1vpUohhyJDqsKeKbJGB8J74WTBRAASZ//BdKGTcuyoEeiCYn7/ccNCt+Q6NU3cnwahj1AOg6YC10npluQZr6Ume8Pa96mLOpEYW+ym7HWp4OmIf/NMHus4sEHZ93E/1nv0PXY5K+0iPnIoycgKPqD1oyaEK08FmrJbPr/MwNOdOjG3oK4TwN25w+v6cSsSV2DyTluJHx6dJmAscpRvoT38aOlVvuhUrWA+2Rc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 05f29a83-9a86-4b4f-8cd2-08d5fe381d94 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2018 20:38:51.0031 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1145 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 20:38:53 -0000 Konstantin Belousov wrote: [stuff snipped] >I wrote: >> >> I can add printf()s anywhere you suggest, but I'm not sure how you would= catch >> this case sooner? (For example, I could print out di_extsize at the begi= nning of >> ffs_truncate(), if that would help?) >May be, add a loop at the beginning of ffs_truncate(), over all buffers >on both clean and dirty queues, calculating number of buffers with >b_lblkno < 0 and >=3D -UFS_NXADDR. Print some diagnostic if such buffer is >detected but di_extsize is zero. Ok, I can do that. These failures don't occur that often, so it might take = a while to get one. >BTW, does NFS server use extended attributes ? What for ? Can you, pleas= e, >point out the code which does this ? For the pNFS service, there are two system namespace extended attributes fo= r each file stored on the service. pnfsd.dsfile - Stores where the data for the file is. Can be displayed by t= he pnfsdsfile(8) command. pnfsd.dsattr - Cached attributes that change when a file is written (size, = mtime, change) so that the MDS doesn't have to do a Getattr on the data server for= every client Getattr. The code is in sys/fs/nfsserver/nfs_nfsdport.c and sys/fs/nfsserver/nfs_nfsdserv.c. Just grep for vn_extattr to see the code. I did notice that my code locks the vnode first and then calls vn_start_wri= te() for the vn_extattr_set() calls, whereas the syscall code locks the vnode a= fter the vn_start_write() call. Does that matter? Thanks, rick