linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] Btrfs: Show a warning message if one of objectid reaches its highest value
@ 2016-03-09  6:18 Satoru Takeuchi
  2016-03-11 16:05 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Satoru Takeuchi @ 2016-03-09  6:18 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

It's better to show a warning message for the exceptional case
that one of objectid (in most case, inode number) reaches its
highest value. For example, if inode cache is off and this event
happens, we can't create any file even if there are not so many files.
This message ease detecting such problem.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
---
This patch can be applied to 4.5-rc7

V3:
- Show this message every time when hitting this problem
  for simplicity (thanks to the comment from Goffredo).
- Reflect Naota's comment
  - Keep the error code as is.
V2:
 - Reflect Filipe's comment
   - Use btrfs_warn() instead of WARN_ONCE()
   - Print the id of the tree
---
 fs/btrfs/inode-map.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c
index e50316c..5d97ee7 100644
--- a/fs/btrfs/inode-map.c
+++ b/fs/btrfs/inode-map.c
@@ -556,6 +556,9 @@ int btrfs_find_free_objectid(struct btrfs_root *root, u64 *objectid)
 	mutex_lock(&root->objectid_mutex);

 	if (unlikely(root->highest_objectid >= BTRFS_LAST_FREE_OBJECTID)) {
+		btrfs_warn(root->fs_info,
+			   "The objectid of root %llu reaches its highest value.\n",
+			   root->root_key.objectid);
 		ret = -ENOSPC;
 		goto out;
 	}
-- 
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] Btrfs: Show a warning message if one of objectid reaches its highest value
  2016-03-09  6:18 [PATCH v3] Btrfs: Show a warning message if one of objectid reaches its highest value Satoru Takeuchi
@ 2016-03-11 16:05 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2016-03-11 16:05 UTC (permalink / raw)
  To: Satoru Takeuchi; +Cc: linux-btrfs@vger.kernel.org

On Wed, Mar 09, 2016 at 03:18:57PM +0900, Satoru Takeuchi wrote:
> It's better to show a warning message for the exceptional case
> that one of objectid (in most case, inode number) reaches its
> highest value. For example, if inode cache is off and this event
> happens, we can't create any file even if there are not so many files.
> This message ease detecting such problem.
> 
> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

Reviewed-by: David Sterba <dsterba@suse.com>

I'll queue this one, with minor fixes

> +		btrfs_warn(root->fs_info,
> +			   "The objectid of root %llu reaches its highest value.\n",

lower case 'The', no "." and no "\n" for the btrfs_* helpers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-11 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09  6:18 [PATCH v3] Btrfs: Show a warning message if one of objectid reaches its highest value Satoru Takeuchi
2016-03-11 16:05 ` David Sterba

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).