From: Li Xi Subject: Re: Patch of adding utility to check the status of MMP Date: Wed, 13 Nov 2013 20:07:35 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c2f5468c71d104eb0dcf80 Cc: Shuichi Ihara To: linux-ext4@vger.kernel.org Return-path: Received: from mail-ob0-f177.google.com ([209.85.214.177]:60353 "EHLO mail-ob0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754386Ab3KMMHg (ORCPT ); Wed, 13 Nov 2013 07:07:36 -0500 Received: by mail-ob0-f177.google.com with SMTP id wp4so302181obc.36 for ; Wed, 13 Nov 2013 04:07:36 -0800 (PST) In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org List-ID: --001a11c2f5468c71d104eb0dcf80 Content-Type: text/plain; charset=ISO-8859-1 Hi all, MMP feature of ext4 really helps us a lot to avoid mounting file system more than once, especailly when using ext4 as the basis of a distributed file sytem, e.g. Lustre. However, lack of a userspace utility to check the status of MMP makes it diffcult to utilize this feature to make failover decisions. We tried to write a script to do so by parsing the output of debugfs command. But this solution is not very straight forward. In order to check the sequence and checksum correctly, the script has to embed a lot of value definition, which could be error prone. Finally, we decided to add a new command in the e2fsprogs. With that command, a server is able to check the current MMP state of a device so that it can decide whether to take over the file system service from aother server. I think the patch might helps other use cases too. The attachment is the patch. Thanks, Li Xi --001a11c2f5468c71d104eb0dcf80 Content-Type: application/octet-stream; name="mmpstatus.patch" Content-Disposition: attachment; filename="mmpstatus.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hnyifvlr0 SW5kZXg6IGUyZnNwcm9ncy5naXQvZTJmc3Byb2dzLnNwZWMuaW4KPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gZTJm c3Byb2dzLmdpdC5vcmlnL2UyZnNwcm9ncy5zcGVjLmluCisrKyBlMmZzcHJvZ3MuZ2l0L2UyZnNw cm9ncy5zcGVj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FUlIpCkBAIC0zMDAsNiArMzAzLDE2IEBAIGZzY2sucHJvZmlsZWQ6ICQoRlNDS19PQkpT KSAkKFBST0ZJTEVEX0QKIAkkKFEpICQoQ0MpICQoQUxMX0xERkxBR1MpIC1nIC1wZyAtbyBmc2Nr LnByb2ZpbGVkICQoUFJPRklMRURfRlNDS19PQkpTKSBcCiAJCSQoUFJPRklMRURfTElCQkxLSUQp ICQoTElCSU5UTCkKIAorbW1wc3RhdHVzOiAkKE1NUFNUQVRVU19PQkpTKSAkKERFUExJQkJMS0lE KQorCSQoRSkgIglMRCAkQCIKKwkkKFEpICQoQ0MpICQoQUxMX0xERkxBR1MpIC1vIG1tcHN0YXR1 cyAkKE1NUFNUQVRVU19PQkpTKSAkKExJQkJMS0lEKSBcCisJCSQoTElCSU5UTCkgJChMSUJTKQor CittbXBzdGF0dXMucHJvZmlsZWQ6ICQoTU1QU1RBVFVTX09CSlMpICQoUFJPRklMRURfREVQTElC QkxLSUQpCisJJChFKSAiCUxEICRAIgorCSQoUSkgJChDQykgJChBTExfTERGTEFHUykgLWcgLXBn IC1vIG1tcHN0YXR1cy5wcm9maWxlZCBcCisJCSQoUFJPRklMRURfTU1QU1RBVFVTX09CSlMpICQo UFJPRklMRURfTElCQkxLSUQpICQoTElCSU5UTCkKKwogYmFkYmxvY2tzOiAkKEJBREJMT0NLU19P QkpTKSAkKERFUExJQlMpCiAJJChFKSAiCUxEICRAIgogCSQoUSkgJChDQykgJChBTExfTERGTEFH UykgLW8gYmFkYmxvY2tzICQoQkFEQkxPQ0tTX09CSlMpICQoTElCUykgJChMSUJJTlRMKQpAQCAt Mzg0LDYgKzM5NywxMCBAQCBiYWRibG9ja3MuODogJChERVBfU1VCU1RJVFVURSkgJChzcmNkaXIp CiAJJChFKSAiCVNVQlNUICRAIgogCSQoUSkgJChTVUJTVElUVVRFX1VQVElNRSkgJChzcmNkaXIp L2JhZGJsb2Nrcy44LmluIGJhZGJsb2Nrcy44CQogCittbXBzdGF0dXMuOD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V0dmFsLAorCQkJCV8oIndoaWxlIGNoZWNr aW5nIE1NUCBzdGF0dXMgb2YgJXMiKSwgZGV2aWNlKTsKKwkJCXJldHZhbCA9IDE7CisJCQlicmVh azsKKwkJY2FzZSAwOgorCQkJY29tX2Vycihhcmd2WzBdLCAwLCAiZGV2aWNlICclcycgaXMgbm90 IHVzZWQgbm93XG4iLAorCQkJCWRldmljZSk7CisJCQlicmVhazsKKwkJZGVmYXVsdDoKKwkJCWNv bV9lcnIoYXJndlswXSwgcmV0dmFsLAorCQkJCV8oIndoaWxlIGNoZWNraW5nIE1NUCBzdGF0dXMg b2YgJXMiKSwgZGV2aWNlKTsKKwkJCXJldHZhbCA9IC0xOworCQl9CisJfQorCWV4dDJmc19jbG9z ZShmaWxlc3lzdGVtKTsKK291dF9mcmVlX2RldmljZToKKwlmcmVlKGRldmljZSk7CisJcmV0dXJu IHJldHZhbDsKK30KSW5kZXg6IGUyZnNwcm9ncy5naXQvY29uZmlndXJlLmluCj09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K LS0tIGUyZnNwcm9ncy5naXQub3JpZy9jb25maWd1cmUuaW4KKysrIGUyZnNwcm9ncy5naXQvY29u ZmlndXJlLmluCkBAIC03MTgsNiArNzE4LDMyIEBAIGVzYWNdCiBBQ19TVUJTVChGU0NLX1BST0cp CiBBQ19TVUJTVChGU0NLX01BTikKIGRubAorZG5sIFNlZSB3aGV0aGVyIHRvIGluc3RhbGwgdGhl IGBtbXBzdGF0dXMnIHByb2dyYW0KK2RubAorQUNfQVJHX0VOQUJMRShbbW1wc3RhdHVzXSwKK1sg IC0tZW5hYmxlLW1tcHN0YXR1cyAgICAgICAgICAgYnVpbGQgbW1wc3RhdHVzIHByb2dyYW1dLAor W2lmIHRlc3QgIiRlbmFibGV2YWwiID0gIm5vIgordGhlbgorCU1NUFNUQVRVU19QUk9HPScnIE1N UFNUQVRVU19NQU49JycKKwlBQ19N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