From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web09.4892.1608158523714886860 for ; Wed, 16 Dec 2020 14:42:04 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iVEfeuO9; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608158522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UHBpW4jO3zdzFjZw+e/c5gDRQ5W3keq04CvGNp9xSXc=; b=iVEfeuO9RZTCOVonxQy2F3uEGT9xeXhmC5VfJLj8HY8E/LCS5zRLjhFhgtAbRR5+YmK1S3 gbY2vZ6/D5e3H/U6lZUrflmfT0xfGVgDW3Ch9YyYtAwTQiaGsvQvdkxuqZxX1sIwnwlZ28 cxltEMGZaqhFdDGKAAQdmthbfLgyf1A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-464-CO5xvLpBP6mzLnhumGaN6g-1; Wed, 16 Dec 2020 17:42:01 -0500 X-MC-Unique: CO5xvLpBP6mzLnhumGaN6g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6CBE801A9E; Wed, 16 Dec 2020 22:41:59 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-152.ams2.redhat.com [10.36.114.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C7991971D; Wed, 16 Dec 2020 22:41:55 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io, virtio-fs@redhat.com, lersek@redhat.com Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2 PATCH 43/48] OvmfPkg/VirtioFsDxe: handle file rename/move in EFI_FILE_PROTOCOL.SetInfo Date: Wed, 16 Dec 2020 22:11:20 +0100 Message-Id: <20201216211125.19496-44-lersek@redhat.com> In-Reply-To: <20201216211125.19496-1-lersek@redhat.com> References: <20201216211125.19496-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 VXNpbmcgdGhlIGZ1bmN0aW9ucyBpbnRyb2R1Y2VkIHByZXZpb3VzbHksIHdlIGNhbiBub3cgaW1w bGVtZW50IHRoZSByZW5hbWUKb3BlcmF0aW9uIGluIFZpcnRpb0ZzU2ltcGxlRmlsZVNldEluZm8o KS4KCkF0dHJpYnV0ZSB1cGRhdGVzIGNvbWUgbGF0ZXIuCgpDYzogQXJkIEJpZXNoZXV2ZWwgPGFy ZC5iaWVzaGV1dmVsQGFybS5jb20+CkNjOiBKb3JkYW4gSnVzdGVuIDxqb3JkYW4ubC5qdXN0ZW5A aW50ZWwuY29tPgpDYzogUGhpbGlwcGUgTWF0aGlldS1EYXVkw6kgPHBoaWxtZEByZWRoYXQuY29t PgpSZWY6IGh0dHBzOi8vYnVnemlsbGEudGlhbm9jb3JlLm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MzA5 NwpTaWduZWQtb2ZmLWJ5OiBMYXN6bG8gRXJzZWsgPGxlcnNla0ByZWRoYXQuY29tPgotLS0KIE92 bWZQa2cvVmlydGlvRnNEeGUvU2ltcG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W5wdXQgdmFsdWUgb2YNCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFZpcnRpb0ZzRmlsZS0+Q2Fub25pY2FsUGF0aG5hbWUgYW5kIGZy b20NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5ld0ZpbGVOYW1lIGlzIGlkZW50aWNh bCB0byB0aGUgaW5wdXQgdmFsdWUgb2YNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZp cnRpb0ZzRmlsZS0+Q2Fub25pY2FsUGF0aG5hbWUuIFRoaXMgbWVhbnMgdGhhdA0KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgRUZJX0ZJTEVfSU5GTyBkb2VzIG5vdCBjb25zdGl0dXRlIGEg cmVuYW1lDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LiBWaXJ0aW9Gc0Zp bGUgaGFzIG5vdCBiZWVuIGNoYW5nZWQuDQorDQorICBAcmV0dmFsIEVGSV9TVUNDRVNTICAgICAg ICBWaXJ0aW9Gc0ZpbGUgaGFzIGJlZW4gcmVuYW1lZC4NCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFZpcnRpb0ZzRmlsZS0+Q2Fub25pY2FsUGF0aG5hbWUgaGFzIGFzc3VtZWQgdGhlDQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0aW5hdGlvbiBwYXRobmFtZSBpbiBjYW5v bmljYWwgZm9ybWF0Lg0KKw0KKyAgQHJldHZhbCBFRklfQUNDRVNTX0RFTklFRCAgVmlydGlvRnNG aWxlIHJlZmVycyB0byB0aGUgcm9vdCBkaXJlY3RvcnksIGFuZA0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTmV3RmlsZU5hbWUgZXhwcmVzc2VzIGFuIGFjdHVhbCByZW5hbWUvbW92ZQ0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC4NCisNCisgIEByZXR2YWwgRUZJ X0FDQ0VTU19ERU5JRUQgIFZpcnRpb0ZzRmlsZSBpcyB0aGUgKHBvc3NpYmx5IGluZGlyZWN0KSBw YXJlbnQNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcmVjdG9yeSBvZiBhdCBsZWFz dCBvbmUgb3RoZXIgVklSVElPX0ZTX0ZJTEUNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHRoYXQgaXMgb3BlbiBmb3IgdGhlIHNhbWUgVmlydGlvIEZpbGVzeXN0ZW0NCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChpZGVudGlmaWVkIGJ5IFZpcnRpb0ZzRmlsZS0+T3duZXJGcyku IFJlbmFtaW5nDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaXJ0aW9Gc0ZpbGUgd291 bGQgaW52YWxpZGF0ZSB0aGUgY2Fub25pY2FsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBwYXRobmFtZXMgb2YgdGhvc2UgVklSVElPX0ZTX0ZJTEUgaW5zdGFuY2VzOw0KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdGhlcmVmb3JlIHRoZSByZXF1ZXN0IGhhcyBiZWVuIHJlamVj dGVkLg0KKw0KKyAgQHJldHZhbCBFRklfQUNDRVNTX0RFTklFRCAgVmlydGlvRnNGaWxlIGlzIG5v dCBvcGVuIGZvciB3cml0aW5nLCBidXQNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5l d0ZpbGVOYW1lIGV4cHJlc3NlcyBhbiBhY3R1YWwgcmVuYW1lL21vdmUNCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHJlcXVlc3QuDQorDQorICBAcmV0dmFsIEVGSV9OT1RfRk9VTkQgICAg ICBBdCBsZWFzdCBvbmUgZG90LWRvdCBjb21wb25lbnQgaW4gTmV3RmlsZU5hbWUNCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGF0dGVtcHRlZCB0byBlc2NhcGUgdGhlIHJvb3QgZGlyZWN0 b3J5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