From: Wang Shilong Subject: Re: [PATCH v3 2/2] f2fs: fix setattr project check upon fssetxattr ioctl Date: Wed, 12 Sep 2018 00:00:06 +0000 Message-ID: <84A27250-3DEB-4E64-AA85-9C67915FD34C@ddn.com> References: <1536623661-5912-1-git-send-email-wshilong1991@gmail.com> <20180911224701.GF55456@jaegeuk-macbookpro.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 Cc: Andreas Dilger , "linux-ext4@vger.kernel.org" , Wang Shilong , "dchinner@redhat.com" , "linux-f2fs-devel@lists.sourceforge.net" To: Jaegeuk Kim Return-path: In-Reply-To: <20180911224701.GF55456@jaegeuk-macbookpro.roam.corp.google.com> Content-Language: en-US Content-ID: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net List-Id: linux-ext4.vger.kernel.org DQoNCj4g1NogMjAxOMTqOdTCMTLI1aOsyc/O5zY6NDejrEphZWdldWsgS2ltIDxqYWVnZXVrQGtl cm5lbC5vcmc+INC0tcCjug0KPiANCj4gT24gMDkvMTEsIFdhbmcgU2hpbG9uZyB3cm90ZToNCj4+ IEZyb206IFdhbmcgU2hpbG9uZyA8d2FuZ3NoaWxvbmcxOTkxQGdtYWlsLmNvbT4NCj4+IA0KPj4g Q3VycmVudGx5LCBwcm9qZWN0IHF1b3RhIGNvdWxkIGJlIGNoYW5nZWQgYnkgZnNzZXR4YXR0cg0K Pj4gaW9jdGwsIGFuZCBleGlzdGVkIHBlcm1pc3Npb24gY2hlY2sgaW5vZGVfb3duZXJfb3JfY2Fw YWJsZSgpDQo+PiBpcyBvYnZpb3VzbHkgbm90IGVub3VnaCwganVzdCB0aGluayB0aGF0IGNvbW1v biB1c2VycyBjb3VsZA0KPj4gY2hhbmdlIHByb2plY3QgaWQgb2YgZmlsZSwgdGhhdCBjb3VsZCBt YWtlIHVzZXJzIHRvDQo+PiBicmVhayBwcm9qZWN0IHF1b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