Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056AbdINLjd (ORCPT ); Thu, 14 Sep 2017 07:39:33 -0400 Received: from mail-ve1eur01on0117.outbound.protection.outlook.com ([104.47.1.117]:46869 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751500AbdINLjb (ORCPT ); Thu, 14 Sep 2017 07:39:31 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=skinsbursky@virtuozzo.com; Reply-To: skinsbursky@virtuozzo.com Subject: Re: [RFC PATCH 1/2] autofs: set compat flag on sbi when daemon uses 32bit addressation To: Ian Kent Cc: autofs@vger.kernel.org, linux-kernel@vger.kernel.org, devel@openvz.org, ldv@altlinux.org References: <20170901110906.2669.1577.stgit@localhost.localdomain> <20170901112144.2669.1453.stgit@localhost.localdomain> From: Stanislav Kinsburskiy Message-ID: <889ec02e-6146-c180-642b-017f6ca71f8a@virtuozzo.com> Date: Thu, 14 Sep 2017 13:39:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [178.19.210.162] X-ClientProxiedBy: HE1PR0102CA0019.eurprd01.prod.exchangelabs.com (2603:10a6:7:14::32) To AM4PR0802MB2242.eurprd08.prod.outlook.com (2603:10a6:200:5e::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5186603-3e7b-4a16-c495-08d4fb6541fb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:AM4PR0802MB2242; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0802MB2242;3:DJwuBYjTPjJLuVsgr4JDPgRC/bYZnSsd6uFBvWtvpwgrK7v4NU4v5Aoru2dtJyOoulIhNh79LXqUIwOGF7E0buXYTw9aZSwHB5LR/PfcX+kf3miNk/m07duYDh1jD0MspFeY1W3uyPDzVjT42ShkGH+y/zdLmfmvwFen0wiUJ0TxIQjLwlD97H7xQWecr9U7ysMFYyT9G7e769AJwd20E6604c07OYsXVMoE+Q9pbvv1eWOXHy51G5OcUs1mF+WN;25:ibsplStscbY7IQRagDTN85tD4A5t+6bSZundzRC7S+zoEbvOPoQM7D1yPsK7aqa8RvzoD/g/n1LLf1e27RnaegqX1CzuaqdnX0z5twQS1HKkB0YjSwoQhPndTXU1gTS0JybT9h2ZQTNfMIXCqxSgkdV94E4OeRsoyUVFNg+4t9EIUmaZK6WqroBuFFel+5KnsYv5x+X36gH8wO0sBtMwm8yQfJ5pv9aCIDnC1tmW/XqDojsHf653BiysfeDswj42A+UbgGNOBSNuUiJ/1ijru6npSahj6SALE9POKhdqT0cSk8DdTASU8sikhiqKsiO2/WzIAiICpaMF7s2wCl/jZw==;31:ysD4fhrN8t1VZTwq7E5cwdrNLEScDO4V7vptU6LnJWFEJwNjK2bqnz4ZoL9E7KudZwucB/GvGUzas2Un/s3JqRMFBW3cQC1+UBcJ/ZP6gGuNwEAqxwIS79DD2zym38NdOiS1BywWLp33muEslzs48jSJWz2v45pgiqLO8t8Forcfx0GW1CVdFnn7qoYemlsxp0j0ey+Iwcnxijr0bWcYKiO+KSCQ6ddIWIqgw/HoEO0= X-MS-TrafficTypeDiagnostic: AM4PR0802MB2242: X-Microsoft-Exchange-Diagnostics: 1;AM4PR0802MB2242;20:OVf6M6H/b4ZCbd8ZCga+Zy9qK6p/znnYzG/mPfpTXKRfP50c2X5i4kppmeOHuNLGaWwKxAR+YZpr84KCZuEcr/FKt4JW64SQl88bLioXRYP6PqzugGRDoNhxFWUsa0SVrQFIzjHocAQ/hk4Fnc4RTCTPKVXkIWT1zX1XES7c2Xh2zDm5yhLsOrIR6Htr+8WIe20bOaQdN04cKh+3yYSMomFQoWt75le+ROzTAzA8GV91KZDyOO61tWvdZcwgkDDAnD3o7Gd182Hbbj3ur6X/lBBpdCMqiiQJML+KVGNt7W6tr7lN8U37pPsisoLkzEkLKRV7nR7ZAUj6tHlNrXCKghx+1hxyjRFypqJ3LnghJFli3Hf02DNuvYG8Z49YQFaGU+qF1c7N918hsnAzI/0ihPOsNvNz+TKLtB9dy15dRkg=;4:OXibsza6qIJ4t+XkZMinMsO4ypUTexlvQSx/2eJiJ9bgAkpTHcgx8QlMynGQS/lZK8s6B1PkWne8+QQazpTEJ449Hdyi9uDaqNtloHuerkO/ncLWJUZJzXasfndd+Nx0iRzxtd0jDhRptb8zX/hwisEgP8pDaCQOUAos2CHQODSCh8CijxNdzXqPRBmYqAedU2zQa40PxEdxOzrA6B7gJKIijBHifF4LSkFmhJutwSVAI1RWieYd3C6DIlWuJ7i2 X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6041248)(20161123555025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM4PR0802MB2242;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM4PR0802MB2242; X-Forefront-PRVS: 0430FA5CB7 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6049001)(6009001)(346002)(39830400002)(376002)(199003)(189002)(76104003)(24454002)(51914003)(2906002)(105586002)(5660300001)(575784001)(2950100002)(43066003)(65826007)(77096006)(23676002)(31696002)(6116002)(3846002)(25786009)(36756003)(64126003)(6666003)(6486002)(83506001)(2870700001)(86362001)(47776003)(101416001)(316002)(106356001)(6916009)(65956001)(65806001)(229853002)(66066001)(16576012)(16526017)(50466002)(3450700001)(7350300001)(76176999)(50986999)(81156014)(189998001)(53546010)(93886005)(54356999)(16300500001)(478600001)(68736007)(7736002)(4001350100001)(33646002)(305945005)(8676002)(110136004)(31686004)(53936002)(81166006)(6246003)(4326008)(97736004)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR0802MB2242;H:[10.134.193.232];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA4MDJNQjIyNDI7MjM6YmhCM1U0MTZtSE5LRUpyYWpYMTlUZ2Zl?= =?utf-8?B?cWp6eEphL1dqZVFXNjJZeEJhSXNYTitGQUpaRmdXS0EyVWFuNEszUVUrMzRB?= =?utf-8?B?K1NBTXdWMzFnRzhmY2JXVHpQSTNVVVYzWDBiWXNtODNsSmY4Szc4bmtmbWFI?= =?utf-8?B?amU0eXhqM3k0QUVHL2trampQZXZmOHFMZ2lqQ21DSjBHVkU0VHBYYlIrcURF?= =?utf-8?B?WWNkVlpyZE1ZY3p3U3RuTUtuQUZiTEFNRHVOZWRxekVjb2htT0JVY2FpdW12?= =?utf-8?B?NllWcU1LM0JHekZnMmZJUDVHcFBhclBvNFZiQmQrMHJxdlVJeXZndkRiWFEy?= =?utf-8?B?UW1JZW8wT011V2pOTGpEeWdlVXEvQWtRRnA2Y0luSC93ZjYwUnJjSFdab0pL?= =?utf-8?B?M3BQMzRRTXMxWXZncGZJOHZ3eW9EN2NoeHJsaDUyeG5VK3B3L25oRmRjUlNB?= =?utf-8?B?RThhdDVpYWpOL2VJQjFSdGh5ek5EMDM5VDltVk9NREFEL3pSQ3RBSmtrVXMv?= =?utf-8?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fvIbi7A9G//YWQASG7HMBsFC8+q1/bcfvykx1CAaVwF1Lsx68UJgEgSgOvZRt0pUtkHPb/utLgg4xx5iI+vZNgn3irAnoyEhlBZHZJnNjjm4j9iEIGmSv+OCa9Lj3YWQZhZ5Vo2fgOg0HdiYTlHsSV8Nn4Y6JqEH39tqMRhDDS6H0ulu6Z8hfG5qyMzh8przm9eoWT/mJ+kCytdiTpbMtPBw8XqQhlYAnsEpdqfE8W5bonNhKv75NgsrvtmOgcA==;5:IHFDknerBePCoiFZCrBnjRLNJIH1de1Mi0tgbRnKuZOOcg5/CxFNKRLJnd8iT6fbKozKcD8ddb0+hFEFq5BQNuURmmOapsSEkI4qM0nzI/3vNFZKNlYnpkXTFCGMnM9RLSgcXgJeGh8ULuYMN2N+Fg==;24:j630HCEUXny9eTeFvo2UpTHHvcQyKi17n9lKhFQutbUQjvz+yHMkiT7Ckhp58iN0xHqsBEvcCtzITPuAQXKcKZB1HtBzShDU0wOLGOVGsug=;7:d9NQ0V9C9ZLHBor7CNrn4I+dCgLHTYaH3oNUvH0BFyIINUmnTjWh8AnwpCLRBleRDsN8AZyfat1xFJs7FkHX0278hf9ggmWmsj6AZw9NYlisX6K/i1L8f12DXQAVOUCZ9rTtKaTXSI6KiDnyIviIdPhpW8tK3AEfYRQH2IvJuQIwKNO97qKflViAzD1WW9F7He4NE3PSqScqoYDgTxoRy7lfPUpu6D1v5PXdpEt3oNw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR0802MB2242;20:/4NfDa+VR9RA6ICVluNPLq5Zd0mAR+AIlAefwFwGwRZm08GwtdHYEOrtTNgrhtukhEv5nZskMVnVrnlHX/aYNrl8CWoHUorZ720N9vlWl/ufmXHviw8aV1lDXNTLx5/ObET5ry20JQQvgM+7IeErminf667GHpf57hhrms2XouE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2017 11:39:27.7432 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2242 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3335 Lines: 103 14.09.2017 13:29, Ian Kent пишет: > On 14/09/17 17:24, Stanislav Kinsburskiy wrote: >> >> >> 14.09.2017 02:38, Ian Kent пишет: >>> On 01/09/17 19:21, Stanislav Kinsburskiy wrote: >>>> Signed-off-by: Stanislav Kinsburskiy >>>> --- >>>> fs/autofs4/autofs_i.h | 3 +++ >>>> fs/autofs4/dev-ioctl.c | 3 +++ >>>> fs/autofs4/inode.c | 4 +++- >>>> 3 files changed, 9 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h >>>> index 4737615..3da105f 100644 >>>> --- a/fs/autofs4/autofs_i.h >>>> +++ b/fs/autofs4/autofs_i.h >>>> @@ -120,6 +120,9 @@ struct autofs_sb_info { >>>> struct list_head active_list; >>>> struct list_head expiring_list; >>>> struct rcu_head rcu; >>>> +#ifdef CONFIG_COMPAT >>>> + unsigned is32bit:1; >>>> +#endif >>>> }; >>>> >>>> static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb) >>>> diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c >>>> index b7c816f..467d6c4 100644 >>>> --- a/fs/autofs4/dev-ioctl.c >>>> +++ b/fs/autofs4/dev-ioctl.c >>>> @@ -397,6 +397,9 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp, >>>> sbi->pipefd = pipefd; >>>> sbi->pipe = pipe; >>>> sbi->catatonic = 0; >>>> +#ifdef CONFIG_COMPAT >>>> + sbi->is32bit = is_compat_task(); >>>> +#endif >>>> } >>>> out: >>>> put_pid(new_pid); >>>> diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c >>>> index 09e7d68..21d3c0b 100644 >>>> --- a/fs/autofs4/inode.c >>>> +++ b/fs/autofs4/inode.c >>>> @@ -301,7 +301,9 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) >>>> } else { >>>> sbi->oz_pgrp = get_task_pid(current, PIDTYPE_PGID); >>>> } >>>> - >>>> +#ifdef CONFIG_COMPAT >>>> + sbi->is32bit = is_compat_task(); >>>> +#endif >>>> if (autofs_type_trigger(sbi->type)) >>>> __managed_dentry_set_managed(root); >>>> >>>> >>> >>> Not sure about this. >>> >>> Don't you think it would be better to avoid the in code #ifdefs by doing some >>> checks and defines in the header file and defining what's need to just use >>> is_compat_task(). >>> >> >> Yes, might be... >> >>> Not sure 2 patches are needed for this either ...... >>> >> >> Well, I found this issue occasionally. > > I'm wondering what the symptoms are? > Size of struct autofs_v5_packet is 300 bytes for x86 and 304 bytes for x86_64. Which means, that 32bit task can read more than size of autofs_v5_packet on 64bit kernel. >> And, frankly speaking, it's not clear to me, whether this issue is important at all, so I wanted to clarify this first. >> Thanks to O_DIRECT, the only way to catch the issue is to try to read more, than expected, in compat task (that's how I found it). > > Right, the O_DIRECT patch from Linus was expected to fix the structure > alignment problem. The stuct field offsets are ok aren't they? > Yes, they are ok. >> I don't see any other flaw so far. And if so, that, probably, we shouldn't care about the issue at all. >> What do you think? > > If we are seeing hangs, incorrect struct fields or similar something > should be done about it but if all is actually working ok then the > O_DIRECT fix is doing it's job and further changes aren't necessary. > Well, yes. O_DIRECT fix covers the issue. Ok then. Thanks for the clarification! > Ian >