linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs: label should not contain return char
@ 2014-05-19 17:04 Anand Jain
  2014-05-19 17:04 ` [PATCH 2/2] btrfs: usage error should not be logged into system log Anand Jain
                   ` (5 more replies)
  0 siblings, 6 replies; 30+ messages in thread
From: Anand Jain @ 2014-05-19 17:04 UTC (permalink / raw)
  To: linux-btrfs

From: Anand Jain <Anand.Jain@oracle.com>

generally if you use
  echo "test" > /sys/fs/btrfs/<fsid>/label
it would introduce return char at the end and it can not
be part of the label. The correct command is
  echo -n "test" > /sys/fs/btrfs/<fsid>/label

This patch will check for this user error

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
---
 fs/btrfs/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index c5eb214..63c2907 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -374,7 +374,7 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
 	struct btrfs_root *root = fs_info->fs_root;
 	int ret;
 
-	if (len >= BTRFS_LABEL_SIZE) {
+	if (len >= BTRFS_LABEL_SIZE || strchr(buf, '\n')) {
 		pr_err("BTRFS: unable to set label with more than %d bytes\n",
 		       BTRFS_LABEL_SIZE - 1);
 		return -EINVAL;
-- 
1.8.5.3


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

end of thread, other threads:[~2014-07-01 15:05 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-19 17:04 [PATCH 1/2] btrfs: label should not contain return char Anand Jain
2014-05-19 17:04 ` [PATCH 2/2] btrfs: usage error should not be logged into system log Anand Jain
2014-05-20  6:38   ` [PATCH 2/2 v2] " Anand Jain
2014-05-20 16:36     ` David Sterba
2014-05-19 17:16 ` [PATCH 1/2] btrfs: label should not contain return char Eric Sandeen
2014-05-20  6:40   ` Anand Jain
2014-05-19 17:19 ` Roman Mamedov
2014-05-20  6:42   ` Anand Jain
2014-05-20  6:36 ` [PATCH 1/2 v2] " Anand Jain
2014-05-20 16:32   ` Eric Sandeen
2014-05-22  2:05     ` Anand Jain
2014-05-22  2:14       ` Eric Sandeen
2014-05-22  4:14         ` Roman Mamedov
2014-05-22 16:06           ` Eric Sandeen
2014-05-20 16:33   ` David Sterba
2014-05-20 16:41     ` Eric Sandeen
2014-05-22 10:47     ` Anand Jain
2014-05-22 10:41 ` [PATCH 1/2 v3] " Anand Jain
2014-05-22 10:41   ` [PATCH 2/2 v3] btrfs: usage error should not be logged into system log Anand Jain
2014-05-22 11:21     ` Koen Kooi
2014-05-23  2:41       ` Anand Jain
2014-05-22 11:41   ` [PATCH 1/2 v3] btrfs: label should not contain return char David Sterba
2014-05-23  2:50 ` [PATCH 1/2 v4] " Anand Jain
2014-05-23  2:50   ` [PATCH 2/2 v4] btrfs: usage error should not be logged into system log Anand Jain
2014-05-26 17:41   ` [PATCH 1/2 v4] btrfs: label should not contain return char David Sterba
2014-07-01  5:22   ` [PATCH v5] " Satoru Takeuchi
2014-07-01  6:46     ` Wang Shilong
2014-07-01  8:00       ` [PATCH v6] " Satoru Takeuchi
2014-07-01  8:29         ` Wang Shilong
2014-07-01 15: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).