[PATCH] Btrfs: turn to readonly when btrfs_start_ioctl_transaction() fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When btrfs_start_ioctl_transaction() fails, we should call
btrfs_std_error() properly for filesystem to readonly.

Signed-off-by: Tsutomu Itoh <t-itoh@xxxxxxxxxxxxxx>
---
This patch needs btrfs_abort_transaction function.

 fs/btrfs/ioctl.c |    4 +++-

 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index b793d11..119a126 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2498,8 +2498,10 @@ static long btrfs_ioctl_trans_start(struct file *file)
 
 	ret = -ENOMEM;
 	trans = btrfs_start_ioctl_transaction(root);
-	if (IS_ERR(trans))
+	if (IS_ERR(trans)) {
+		btrfs_abort_transaction(root, ret);
 		goto out_drop;
+	}
 
 	file->private_data = trans;
 	return 0;


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux