From owner-freebsd-fs@freebsd.org Mon Jun 27 08:15:17 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7B3FB84611 for ; Mon, 27 Jun 2016 08:15:17 +0000 (UTC) (envelope-from honzhan@microsoft.com) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0132.outbound.protection.outlook.com [157.56.110.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 687B624A8 for ; Mon, 27 Jun 2016 08:15:16 +0000 (UTC) (envelope-from honzhan@microsoft.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=FhyTZUM9LeHi3KQDV32ooaMCUG1+Ma4uau08+CXphRI=; b=RTIWl5h+1ZCdWE0cybdLD1HN1sMZAWvzkDfj+GuoevCtaQevpsBthtGRFkLNCXTpHJ5d4fY708Zl3ZjrLmX/OlS5sW3zHGsNWCeDJ5MyRSc1LWOrAnPpsONVxE9fzZnfG9z6W0QOif4vrpIfxPpU/anRocWhENX+VzEQQ16YETk= Received: from CO2PR03MB2215.namprd03.prod.outlook.com (10.166.92.26) by CO2PR03MB2215.namprd03.prod.outlook.com (10.166.92.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Mon, 27 Jun 2016 08:15:09 +0000 Received: from CO2PR03MB2215.namprd03.prod.outlook.com ([10.166.92.26]) by CO2PR03MB2215.namprd03.prod.outlook.com ([10.166.92.26]) with mapi id 15.01.0523.019; Mon, 27 Jun 2016 08:15:09 +0000 From: Hongjiang Zhang To: "freebsd-fs@freebsd.org" Subject: ufs freeze does not work Thread-Topic: ufs freeze does not work Thread-Index: AdHQS4KXvmVyW6W2TjqUQxMwTLuTxQ== Date: Mon, 27 Jun 2016 08:15:09 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=honzhan@microsoft.com; x-originating-ip: [167.220.255.25] x-ms-office365-filtering-correlation-id: 24666eb5-2ba2-4d22-4af8-08d39e6327c2 x-microsoft-exchange-diagnostics: 1; CO2PR03MB2215; 6:5UUtfmsKlwAecWYhpD8XNqG9qr1MJjPzTXx7vfmmRGDGVCYqwoF+eXlIy+ogVD7Cf5HErtwfctGH/xKZQyHIdP8ZsZgLWtewQnEiexvd3kda73kB/WWbfPJuyxKlMwD9DPlYrAcaP+NMrrR3Hv1CeWj06YsdDIB7ZTDLwOG35uxe15yNbzAU72Ng4GaIWLhMxuG7Sq/WDVhauUOpkHRiwsXshHoy4wgBjb5gq2BX3cswJ//MWILKzDolVKl3QlCNZVy2xbrkdzSOfVtX9r+t4gLS7GsksmcBdC/LiBMEGW74c/rLGfYGbEPsmXw4yfjKbrSyzc1U4YJNFfkwsXzqOa1lqvEXddg+Ku3o9n7MbKs=; 5:h5/Y/1PZLU1n35iS6swKmGwKa2/Uwh+AZkBiYQnJ1P3mVvkFfSC8T/59Du7ewUmwsECQ7OyrzTjDfptyxdya3OAazaXVRWrYOaH9LV7JhypXZLIkYuUiLOn/3LAfiNfo; 24:HimixcBCyKLclrDu4SCUSW86jaoQ0SnMdLNsecwcNpWhES4raa8OOAD+UMxjbsShTaQ7VNwx1ohnr6DItQ+aZt86K2x3rfG3EDV3jKVei44=; 7:gV+/0KCW9HVMof5NpszqVsvzDlzbmw2kFPwV39pfqG1DhApa/1TweD0TSwV070LmKYsTXAnMcycUhre/KQZepOxYe62fqHa8NEIjhuVE8AQwDE5oHsBYLNnExyCBW8Ud788LfWSbpG/MjrPuQrIk7pB0gr4XMLhfs9hRO4vkUQ5IWTcdJjuROfSRnSCHKFPFUkSqAVCatUD6fZtVmBFV3bSA194OMlqrjf4xudJNgA9nH+/WW41yHXU8YTrZljBvpRaiPgwuDzF8nxWyi2k16w== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2215; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21748063052155); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102415321)(61425038)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038); SRVR:CO2PR03MB2215; BCL:0; PCL:0; RULEID:; SRVR:CO2PR03MB2215; x-forefront-prvs: 09860C2161 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(199003)(189002)(53754006)(54356999)(101416001)(50986999)(77096005)(76576001)(229853001)(11100500001)(2351001)(19300405004)(86362001)(2906002)(19625215002)(105586002)(92566002)(189998001)(2501003)(97736004)(110136002)(107886002)(5002640100001)(5640700001)(5630700001)(16236675004)(3280700002)(8936002)(3846002)(102836003)(6116002)(68736007)(106356001)(586003)(66066001)(33656002)(450100001)(87936001)(99286002)(3660700001)(8990500004)(2900100001)(7696003)(7736002)(86612001)(19580395003)(15975445007)(9686002)(81156014)(81166006)(10090500001)(10290500002)(122556002)(8676002)(5005710100001)(74316001)(790700001)(5003600100003)(7846002)(99936001)(10400500002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR03MB2215; H:CO2PR03MB2215.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jun 2016 08:15:09.3595 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2215 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2016 08:15:18 -0000 Hi all, I wrote a test to freeze ufs, but it does not work even if the ioctl return= s successful. What is the problem? #define _PATH_UFSSUSPEND "/dev/ufssuspend" static void freeze_allmountpoints() { struct statfs *mntbuf, *statfsp; int mntsize; int fso; int error; int i; fso =3D open(_PATH_UFSSUSPEND, O_RDWR); if (fso =3D=3D -1) err(1, "unable to open %s", _PATH_UFSSUSPEND); /* * First check the mounted filesystems. */ mntsize =3D getmntinfo(&mntbuf, MNT_NOWAIT); if (mntsize =3D=3D 0) return; printf("mnt size: %d\n", mntsize); for(i =3D mntsize - 1; i >=3D 0; --i) { statfsp =3D &mntbuf[i]; if (strcmp("/", statfsp->f_mntonname) =3D=3D 0 || strcmp("ufs", statfsp->f_fstypename) =3D=3D 0) { printf("begin to suspend on '%s' from '%s'\n", statfsp->f_mntonname, statfsp->f_mntfromnam= e); error =3D ioctl(fso, UFSSUSPEND, &statfsp->f_fsid); if (error !=3D 0) { //err(1, "UFSSUSPEND"); printf("error: %d\n",errno); } else { printf("Successfully suspend filesystem\n")= ; } break; } } close(fso); } Thanks Hongjiang Zhang