Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942629AbcJZMvq (ORCPT ); Wed, 26 Oct 2016 08:51:46 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:35098 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941667AbcJZMvm (ORCPT ); Wed, 26 Oct 2016 08:51:42 -0400 MIME-Version: 1.0 X-Originating-IP: [217.173.44.24] In-Reply-To: References: <1477380887-21333-1-git-send-email-mszeredi@redhat.com> <1477380887-21333-4-git-send-email-mszeredi@redhat.com> From: Miklos Szeredi Date: Wed, 26 Oct 2016 14:51:40 +0200 Message-ID: Subject: Re: [PATCH 3/3] ovl: redirect on rename-dir To: Amir Goldstein Cc: Miklos Szeredi , "linux-unionfs@vger.kernel.org" , Guillem Jover , Raphael Hertzog , linux-fsdevel , linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1494 Lines: 38 On Wed, Oct 26, 2016 at 2:11 PM, Amir Goldstein wrote: > On Wed, Oct 26, 2016 at 2:26 PM, Miklos Szeredi wrote: >> On Tue, Oct 25, 2016 at 2:49 PM, Amir Goldstein wrote: >> >>>> @@ -880,31 +913,34 @@ static int ovl_rename(struct inode *olddir, struct dentry *old, >>>> if (WARN_ON(olddentry->d_inode == newdentry->d_inode)) >>>> goto out_dput; >>>> >>>> - if (is_dir && !old_opaque && ovl_lower_positive(new)) { >>>> - err = ovl_set_opaque(olddentry); >>>> - if (err) >>>> - goto out_dput; >>>> - ovl_dentry_set_opaque(old, true); >>>> + if (is_dir) { >>>> + if (ovl_type_merge_or_lower(old)) { >>>> + err = ovl_set_redirect(old); >>> >>> There is a fair chance of getting ENOSPC/EDQUOT here and confuse user space. >>> Would it be better to convert these non fatal errors with EXDEV, so >>> user space will >>> gracefully fallback to recursive rename/clone/copy? >> >> Recursive copy up will surely consume more space than an xattr? > > Surely. But that is not what I meant. > In Ext4, for example, the total size of extended attributes for an > inode is limited to a single block, > so you can get ENOSPC with alot of free space in the file system. Ah. > > You can also get ERANGE if the redirect path length > 256. The 256 limit is for the name of the xattr, not the value. Thanks, Miklos