[PATCH v4 4/4] btrfs: Allow rmdir(2) to delete an empty subvolume

2018-04-10 Thread Misono Tomohiro
Change the behaior of rmdir(2) and allow it to delete an empty subvolume by calling btrfs_delete_subvolume() which is used by btrfs_ioctl_snap_destroy(). The required lock for @dir and inode of @dentry is already acquired in vfs layer. We need some check before deleting a subvolume. Permission

[PATCH v4 3/4] btrfs: Refactor btrfs_ioctl_snap_destroy() by using btrfs_delete_subvolume()

2018-04-10 Thread Misono Tomohiro
Use btrfs_delete_subvolume() to refactor btrfs_ioctl_snap_destroy(). The permission check is still done in btrfs_ioctl_snap_destroy(). Also, call of d_delete() is still required since btrfs_delete_subvolume() does not call it. As a result, btrfs_unlink_subvol() and may_destroy_subvol() become

[PATCH v4 2/4] btrfs: Add definition of btrfs_delete_subvolume()

2018-04-10 Thread Misono Tomohiro
Add new function btrfs_delete_subvolume() which is almost identical to the secand half of btrfs_ioctl_snap_destroy(). This function requires inode_lock for both @dir and inode of @dentry. This performes additional check (1. send is not in progress. 2. the subvolume is not a default subvolume. 3.

[PATCH v4 1/4] btrfs: move may_destroy_subvol() from ioctl.c to inode.c

2018-04-10 Thread Misono Tomohiro
This is a preparation work to refactor btrfs_ioctl_snap_destroy() and to allow rmdir(2) to delete an empty subvolume. Signed-off-by: Tomohiro Misono --- fs/btrfs/ctree.h | 1 + fs/btrfs/inode.c | 54 ++

[PATCH v4 0/4] Allow rmdir(2) to delete a subvolume

2018-04-10 Thread Misono Tomohiro
changelog: v3 -> v4 ... Reorganize patches and updates commit log. No code change in total v2 -> v3 ... Use if-else block instead of two if blocks and add Tested-by tag in 2nd patch v1 -> v2 ... Split the patch to hopefully make review easier Note: I will send

Re: [PATCH v3 2/3] btrfs: Allow rmdir(2) to delete a subvolume

2018-04-10 Thread Misono Tomohiro
On 2018/04/06 23:46, David Sterba wrote: > On Fri, Mar 30, 2018 at 03:16:47PM +0900, Misono Tomohiro wrote: >> This patch changes the behavior of rmdir(2) to allow it to delete >> an empty subvolume by default, unless it is not a default subvolume >> and send is not in progress. >> >> New function

Funds Plans..

2018-04-10 Thread Reem Al
Hello, My name is Hon. Ms. Reem Al-Hashimy I am the present Ministry of petroleum in UAE. I write to solicit for your partnership in claiming of $47 Million USD from a Financial Home in Uk. The aforementioned fund $47 Million USD is my share percentage from a Oil companies that I helped

[PATCH] btrfs.static: needs libbtrfsutil

2018-04-10 Thread Baruch Siach
Add libbtrfsutil objects to btrfs.static link command. This fixes static build failure: utils.static.o: In function `parse_qgroupid': utils.c:(.text.parse_qgroupid+0xb0): undefined reference to `btrfs_util_is_subvolume' props.static.o: In function `prop_read_only':

Re: [PATCH v3 0/3] btrfs: Add three new unprivileged ioctls to allow normal users to call "sub list/show" etc.

2018-04-10 Thread David Sterba
On Mon, Mar 19, 2018 at 04:27:09PM +0900, Misono, Tomohiro wrote: > changelog: > > v2-> v3 > - fix kbuild test bot warning > v1 -> v2 > - completely reimplement 1st/2nd ioctl to have user friendly api > - various cleanup, remove unnecessary goto > === > > This adds three new unprivileged

Re: [RFC PATCH 1/8] btrfs: use iocb for __btrfs_buffered_write

2018-04-10 Thread David Sterba
On Fri, Nov 17, 2017 at 11:44:47AM -0600, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > Preparatory patch. It reduces the arguments to __btrfs_buffered_write > to follow buffered_write() style. > > Signed-off-by: Goldwyn Rodrigues I got pointed

Re: [PATCH 2/2] btrfs: Factor out write portion of btrfs_get_blocks_direct

2018-04-10 Thread David Sterba
On Thu, Feb 22, 2018 at 06:12:14PM +0200, Nikolay Borisov wrote: > Now that the read side is extracted into its own function, do the same > to the write side. This leaves btrfs_get_blocks_direct_write with the > sole purpose of handling common locking required. Also flip the > condition in

Re: [PATCH 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct

2018-04-10 Thread David Sterba
On Thu, Feb 22, 2018 at 06:12:13PM +0200, Nikolay Borisov wrote: > Currently this function handles both the READ and WRITE dio cases. This > is facilitated by a bunch of 'if' statements, a goto short-circuit > statement and a very perverse aliasing of "!created"(READ) case > by setting lockstart =

Re: [PATCH v4 0/7] Superblock read and verify cleanups

2018-04-10 Thread David Sterba
On Fri, Mar 30, 2018 at 08:09:16AM +0800, Anand Jain wrote: > v3->v4: > Update changelog and signoff. > Reintroduce explicit check for '-EUCLEAN' > at Patch 2/8 and 5/8. > > v2->v3: > Squash > 4/8 btrfs: make btrfs_check_super_csum() non static > to > 6/8 btrfs: verify superblock

Re: [PATCH] Btrfs: fix loss of prealloc extents past i_size after fsync log replay

2018-04-10 Thread Sasha Levin
Hi, [This is an automated email] This commit has been processed because it contains a "Fixes:" tag, fixing commit: c71bf099abdd Btrfs: Avoid orphan inodes cleanup while replaying log. The bot has also determined it's probably a bug fixing patch. (score: 6.2138) The bot has tested the

Re: How to zero errors

2018-04-10 Thread Austin S. Hemmelgarn
On 2018-04-10 09:08, James Courtier-Dutton wrote: Hi, I have disk that in the past had errors on it. I have fixed up the errors. btrfs scrub now reports no errors. How do I reset these counters to zero? BTRFS info (device sdc2): bdev /dev/sdc2 errs: wr 0, rd 35, flush 0, corrupt 1, gen 0

How to zero errors

2018-04-10 Thread James Courtier-Dutton
Hi, I have disk that in the past had errors on it. I have fixed up the errors. btrfs scrub now reports no errors. How do I reset these counters to zero? BTRFS info (device sdc2): bdev /dev/sdc2 errs: wr 0, rd 35, flush 0, corrupt 1, gen 0 Kind Regards James -- To unsubscribe from this list:

Re: [PATCH] Btrfs: do not abort transaction when failing to insert hole extent

2018-04-10 Thread David Sterba
On Mon, Apr 09, 2018 at 06:23:14PM -0700, Liu Bo wrote: > >>> As maybe_insert_hole is only called by btrfs_cont_expand here, which > >>> means it's a really hole, I don't expect drop_extents would drop > >>> anything, we can remove this drop_extents and put an assert after > >>>

Re: [PATCH 7/7] btrfs: use fs_info for btrfs_handle_em_exist tracepoint

2018-04-10 Thread David Sterba
On Tue, Apr 10, 2018 at 10:45:39AM +0300, Nikolay Borisov wrote: > On 9.04.2018 14:58, David Sterba wrote: > > We really want to know to which filesystem the extent map events belong, > > but as it cannot be reached from the extent_map pointers, we need to > > pass it down the callchain. > > I

Re: [PATCH 0/7] Tracepoint updates

2018-04-10 Thread Nikolay Borisov
On 9.04.2018 14:58, David Sterba wrote: > Switch the inode number type to u64, plus other cleanups and fixups. > > David Sterba (7): > btrfs: tracepoints, use correct type for inode number > btrfs: tracepoints, use %llu instead of %Lu > btrfs: tracepoints, drop unnecessary ULL casts >

Re: [PATCH 7/7] btrfs: use fs_info for btrfs_handle_em_exist tracepoint

2018-04-10 Thread Nikolay Borisov
On 9.04.2018 14:58, David Sterba wrote: > We really want to know to which filesystem the extent map events belong, > but as it cannot be reached from the extent_map pointers, we need to > pass it down the callchain. I really dislike propagating arguments solely for tracepoints purposes, but if