linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chandan Rajendra <chandan@linux.vnet.ibm.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org, fdmanana@gmail.com, chandan@mykolab.com
Subject: Re: [PATCH] Btrfs: Intialize btrfs_root->highest_objectid when loading tree root and subvolume roots
Date: Wed, 07 Oct 2015 19:40:46 +0530	[thread overview]
Message-ID: <8703019.0plYdL21k7@localhost.localdomain> (raw)
In-Reply-To: <20151007092503.GG7734@twin.jikos.cz>

On Wednesday 07 Oct 2015 11:25:03 David Sterba wrote:
> On Mon, Oct 05, 2015 at 10:14:24PM +0530, Chandan Rajendra wrote:
> > +	if (unlikely(root->highest_objectid >= BTRFS_LAST_FREE_OBJECTID)) {
> > +		mutex_unlock(&root->objectid_mutex);
> > +		ret = -ENOSPC;
> 
> ENOSPC ... I don't think it's right as this could be with a normal
> enospc during subvolume creation. The problem is that theh inode number
> space is exhausted, the closest error code I see is EOVERFLOW. As this
> is an ioctl we can afford to define the meaning of this return value as
> such (unlike for eg. creat()/open()).
> 
> > +		goto free_root_dev;
> > +	}
> > +
> > +	mutex_unlock(&root->objectid_mutex);
> > +
> > 
> >  	return 0;

David, Are you suggesting that we return -EOVERFLOW from within
btrfs_init_fs_root() and continue returning -ENOSPC in case of error
(i.e. tree_root->highest_objectid >= BTRFS_LAST_FREE_OBJECTID) from
open_ctree()?

If yes, btrfs_init_fs_root() gets invoked from open_ctree() via
btrfs_read_fs_root_no_name() and hence we may end up returning -EOVERFLOW when
servicing the mount() syscall.

-- 
chandan


  reply	other threads:[~2015-10-07 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 16:44 [PATCH] Btrfs: Intialize btrfs_root->highest_objectid when loading tree root and subvolume roots Chandan Rajendra
2015-10-07  9:25 ` David Sterba
2015-10-07 14:10   ` Chandan Rajendra [this message]
2016-01-03  5:02     ` james harvey
2016-01-05  3:22       ` Chandan Rajendra
2016-01-05 12:12     ` David Sterba
2016-01-06  8:37       ` Chandan Rajendra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8703019.0plYdL21k7@localhost.localdomain \
    --to=chandan@linux.vnet.ibm.com \
    --cc=chandan@mykolab.com \
    --cc=dsterba@suse.cz \
    --cc=fdmanana@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).