Re: [PATCH 02/13] scsi/osd: don't save block errors into req_results

2017-05-26 Thread Martin K. Petersen
Christoph, > We will only have sense data if the command exectured and got a SCSI > result, so this is pointless. "executed" Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the bo

Re: [PATCH 6/6] Btrfs: add sanity check of extent item in scrub

2017-05-26 Thread Liu Bo
On Fri, May 26, 2017 at 08:33:16PM +0200, David Sterba wrote: > On Thu, May 25, 2017 at 06:26:31PM -0600, Liu Bo wrote: > > Currently scrub only verify checksum of both metadata and data and > > couldn't detect an invalid extent_item. > > This is a different kind of check that scrub was never desi

[PATCH] fixup: btrfs: reduce arguments for decompress_bio ops

2017-05-26 Thread Anand Jain
Signed-off-by: Anand Jain --- Hi David, I note the original patch [1] is already queued so here I am sending a fix-up patch can you pls squash this to [1] [1] [PATCH 2/3 v2] btrfs: reduce arguments for decompress_bio ops This fixup patch, fixes issues reported by kbuild test robot which

[PATCH v2] Btrfs: clear EXTENT_DEFRAG bits in finish_ordered_io

2017-05-26 Thread Liu Bo
Before this, we use 'filled' mode here, ie. if all range has been filled with EXTENT_DEFRAG bits, get to clear it, but if the defrag range joins the adjacent delalloc range, then we'll have EXTENT_DEFRAG bits in extent_state until releasing this inode's pages, and that prevents extent_date from bei

[PATCH v2 0/4] Qgroup uapi improvements

2017-05-26 Thread Sargun Dhillon
This patchset has several improvements around the qgroups user-facing API. It introduces two new ioctls for creating, and removing qgroups. These ioctls have a new args structure that allows passing flags, and some reserved fields for future expansion. The ioctls prevent some operations around leve

[PATCH v2 2/4] btrfs: Add new ioctl uapis for qgroup creation / removal

2017-05-26 Thread Sargun Dhillon
This patch introduces two new ioctls to create, and remove qgroups. These offer a somewhat more intuitive set of operations with the opportunity to add flags that gate to unintentional manipulation of qgroups. The create qgroup ioctl has a a new semantic which level-0 qgroups cannot be created unl

[PATCH v2 3/4] btrfs: Warn the user when the legacy btrfs_qgroup_create API is used

2017-05-26 Thread Sargun Dhillon
This patch adds a warning to let the user know when the legacy qgroup creation / removal API is in use. Eventually, we can deprecate this API. Signed-off-by: Sargun Dhillon --- fs/btrfs/ioctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 78c832

[PATCH v2 4/4] btrfs: Add qgroup_auto_cleanup mount flag to automatically cleanup qgroups

2017-05-26 Thread Sargun Dhillon
This patch introduces a new mount option - qgroup_auto_cleanup. The purpose of this mount option is to cause btrfs to automatically delete qgroups on subvolume deletion. This only cleans up the associated level-0 qgroup, and not qgroups that are above it. Since this behaviour is API-breaking, as p

[PATCH v2 1/4] btrfs: Fail on removing qgroup if del_qgroup_item fails

2017-05-26 Thread Sargun Dhillon
Previously, we were calling del_qgroup_item, and ignoring the return code resulting in a potential to have divergent in-memory state without an error. Perhaps, it makes sense to handle this error code, and put the filesystem into a read only, or similar state. This patch only adds reporting of the

Re: [PATCH 3/3 v2] btrfs: add compression trace points

2017-05-26 Thread Anand Jain
On 05/27/2017 02:08 AM, David Sterba wrote: On Fri, May 26, 2017 at 03:45:00PM +0800, Anand Jain wrote: This patch adds compression and decompression trace points for the purpose of debugging. Signed-off-by: Anand Jain --- v2: no change fs/btrfs/compression.c | 10 ++ include/

Re: [PATCH 2/3 v2] btrfs: reduce arguments for decompress_bio ops

2017-05-26 Thread Anand Jain
On 05/26/2017 10:07 PM, kbuild test robot wrote: Hi Anand, [auto build test ERROR on tip/perf/core] [also build test ERROR on v4.12-rc2 next-20170526] [cannot apply to btrfs/next] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url

Re: [PATCH 5/6] Btrfs: remove BUG() in add_data_reference

2017-05-26 Thread Liu Bo
On Fri, May 26, 2017 at 08:20:11PM +0200, David Sterba wrote: > On Thu, May 25, 2017 at 06:26:30PM -0600, Liu Bo wrote: > > Now that we have a helper to report invalid value of extent inline ref > > type, we need to quit gracefully instead of throwing out a kernel panic. > > > > Signed-off-by: Liu

Re: [PATCH 4/6] Btrfs: remove BUG() in print_extent_item

2017-05-26 Thread Liu Bo
On Fri, May 26, 2017 at 08:18:22PM +0200, David Sterba wrote: > On Thu, May 25, 2017 at 06:26:29PM -0600, Liu Bo wrote: > > btrfs_print_leaf() is used in btrfs_get_extent_inline_ref_type, so > > here we really want to print the invalid value of ref type instead of > > causing a kernel panic. > > >

Re: [PATCH] btrfs: btrfs_wait_tree_block_writeback can be void return

2017-05-26 Thread Liu Bo
On Fri, May 26, 2017 at 07:08:31PM +0200, David Sterba wrote: > On Thu, May 25, 2017 at 06:39:52AM -0400, Jeff Layton wrote: > > Nothing checks its return value. > > I think we don't need to check the return value of > filemap_fdatawait_range, because the errors are tracked by other means > (attac

Re: [PATCH 5/8] btrfs: qgroup.h whitespace change

2017-05-26 Thread David Sterba
On Sat, May 20, 2017 at 08:39:37AM +, Sargun Dhillon wrote: > This patch is just changing whitespace alignment in qgroup.h > int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, > - struct btrfs_fs_info *fs_info, u64 qgroupid); > + struct btr

Re: [PATCH] btrfs: tree-log.c: Wrong printk information about namelen

2017-05-26 Thread David Sterba
On Wed, May 24, 2017 at 09:31:32AM +0800, Su Yue wrote: > In verify_dir_item, it wants to printk name_len of dir_item but > printk data_len acutally. Good catch, thanks. Reviewed-by: David Sterba -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message t

Re: [PATCH v4 00/20] Btrfs-progs offline scrub

2017-05-26 Thread Goffredo Baroncelli
Hi Qu, On 2017-05-25 08:21, Qu Wenruo wrote: > And since kernel scrub won't account P/Q corruption, it makes us quite > hard to detect error like kernel screwing up P/Q when scrubbing. could you elaborate the above sentence: in my test the kernel-scrub (4.12.0-rc2) is able to correct a wrong 'P

Re: [PATCH 6/6] Btrfs: add sanity check of extent item in scrub

2017-05-26 Thread David Sterba
On Thu, May 25, 2017 at 06:26:31PM -0600, Liu Bo wrote: > Currently scrub only verify checksum of both metadata and data and > couldn't detect an invalid extent_item. This is a different kind of check that scrub was never designed to do. Scrub just verifies the checksums, not the sructural integri

Re: [PATCH 5/6] Btrfs: remove BUG() in add_data_reference

2017-05-26 Thread David Sterba
On Thu, May 25, 2017 at 06:26:30PM -0600, Liu Bo wrote: > Now that we have a helper to report invalid value of extent inline ref > type, we need to quit gracefully instead of throwing out a kernel panic. > > Signed-off-by: Liu Bo > --- > fs/btrfs/relocation.c | 5 - > 1 file changed, 4 inser

Re: [PATCH 4/6] Btrfs: remove BUG() in print_extent_item

2017-05-26 Thread David Sterba
On Thu, May 25, 2017 at 06:26:29PM -0600, Liu Bo wrote: > btrfs_print_leaf() is used in btrfs_get_extent_inline_ref_type, so > here we really want to print the invalid value of ref type instead of > causing a kernel panic. > > Signed-off-by: Liu Bo > --- > fs/btrfs/print-tree.c | 8 +++- > 1

Re: [PATCH 1/6] Btrfs: add a helper to retrive extent inline ref type

2017-05-26 Thread David Sterba
On Fri, May 26, 2017 at 08:13:05PM +0200, David Sterba wrote: > On Fri, May 26, 2017 at 10:09:54AM +0300, Nikolay Borisov wrote: > > > > > > On 26.05.2017 03:26, Liu Bo wrote: > > > An invalid value of extent inline ref type may be read from a > > > malicious image which may force btrfs to crash.

Re: [PATCH 1/6] Btrfs: add a helper to retrive extent inline ref type

2017-05-26 Thread David Sterba
On Fri, May 26, 2017 at 10:09:54AM +0300, Nikolay Borisov wrote: > > > On 26.05.2017 03:26, Liu Bo wrote: > > An invalid value of extent inline ref type may be read from a > > malicious image which may force btrfs to crash. > > > > This adds a helper which does sanity check for the ref type, so

Re: [PATCH 0/3 v2] compression ops args clean up and trace point

2017-05-26 Thread David Sterba
On Fri, May 26, 2017 at 03:44:57PM +0800, Anand Jain wrote: > Patch 1 and 2 are preparatory and clean up patches, and patch 3 adds > the trace point for the compression. 1 and 2 added to queue, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a messa

Re: [PATCH 3/3 v2] btrfs: add compression trace points

2017-05-26 Thread David Sterba
On Fri, May 26, 2017 at 03:45:00PM +0800, Anand Jain wrote: > This patch adds compression and decompression trace points for the > purpose of debugging. > > Signed-off-by: Anand Jain > --- > v2: no change > fs/btrfs/compression.c | 10 ++ > include/trace/events/btrfs.h | 36 +++

Re: [PATCH 1/3 v2] btrfs: btrfs_decompress_bio() could accept compressed_bio instead

2017-05-26 Thread David Sterba
On Fri, May 26, 2017 at 03:44:58PM +0800, Anand Jain wrote: > Instead of sending each argument of struct compressed_bio, send > the compressed_bio itself. > > Also by having struct compressed_bio in btrfs_decompress_bio() > it would help tracing. > > Signed-off-by: Anand Jain > --- > v2: no chan

Re: [PATCH 1/6] Btrfs: add a helper to retrive extent inline ref type

2017-05-26 Thread Jeff Mahoney
On 5/26/17 3:09 AM, Nikolay Borisov wrote: > > > On 26.05.2017 03:26, Liu Bo wrote: >> An invalid value of extent inline ref type may be read from a >> malicious image which may force btrfs to crash. >> >> This adds a helper which does sanity check for the ref type, so we can >> know if it's sane

Re: [PATCH] btrfs: btrfs_wait_tree_block_writeback can be void return

2017-05-26 Thread David Sterba
On Thu, May 25, 2017 at 06:39:52AM -0400, Jeff Layton wrote: > Nothing checks its return value. I think we don't need to check the return value of filemap_fdatawait_range, because the errors are tracked by other means (attached to the btree_inode mapping that represents the metadata), in set_btree

Re: [PATCH v4 1/2] btrfs: Separate space_info create/update

2017-05-26 Thread David Sterba
On Mon, May 22, 2017 at 09:35:49AM +0300, Nikolay Borisov wrote: > +static int create_space_info(struct btrfs_fs_info *info, u64 flags, > + struct btrfs_space_info **new) > +{ > + > + struct btrfs_space_info *space_info; > + int i; > + int ret; > + > + space

Re: [PATCH 1/2] btrfs: rename btrfs_leaf_data to BTRFS_LEAF_DATA_OFFSET

2017-05-26 Thread David Sterba
On Mon, May 22, 2017 at 01:16:10PM +0300, Nikolay Borisov wrote: > +static inline unsigned long BTRFS_LEAF_DATA_OFFSET(void) > +{ > + return offsetof(struct btrfs_leaf, items); > +} Can we make it a simple macro? Functions in place of macros are useful for type checking, but the parameter is g

Re: [PATCH] btrfs: Use kvzalloc instead of kzalloc/vmalloc in alloc_bitmap

2017-05-26 Thread David Sterba
On Thu, May 25, 2017 at 02:27:21PM -0700, Omar Sandoval wrote: > On Thu, May 25, 2017 at 12:18:02PM -0700, Vinnie Magro wrote: > > Replace alloc_bitmap with call to kvzalloc. kvzalloc preserves the > > same fallback heuristic. > > Looks good, thanks. > > Reviewed-by: Omar Sandoval Added to queu

Re: [PATCH] Btrfs: let btrfs_print_leaf print more about block group

2017-05-26 Thread David Sterba
On Thu, May 25, 2017 at 06:08:12PM -0600, Liu Bo wrote: > This adds chunk_objectid and flags, with flags we can recognize whether > the block group is about data or metadata. > > Signed-off-by: Liu Bo Reviewed-by: David Sterba -- To unsubscribe from this list: send the line "unsubscribe linux-b

Re: [PATCH 2/3 v2] btrfs: reduce arguments for decompress_bio ops

2017-05-26 Thread kbuild test robot
Hi Anand, [auto build test ERROR on tip/perf/core] [also build test ERROR on v4.12-rc2 next-20170526] [cannot apply to btrfs/next] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Anand-Jain

Re: [PATCH 07/13] block_dev: propagate bio_iov_iter_get_pages error in __blkdev_direct_IO

2017-05-26 Thread Johannes Thumshirn
On 05/26/2017 10:56 AM, Christoph Hellwig wrote: > Once we move the block layer to its own status code we'll still want to > propagate the bio_iov_iter_get_pages, so restructure __blkdev_direct_IO > to take ret into account when returning the errno. > --- -ENOSIGNOFF? -- Johannes Thumshirn

[PATCH 07/13] block_dev: propagate bio_iov_iter_get_pages error in __blkdev_direct_IO

2017-05-26 Thread Christoph Hellwig
Once we move the block layer to its own status code we'll still want to propagate the bio_iov_iter_get_pages, so restructure __blkdev_direct_IO to take ret into account when returning the errno. --- fs/block_dev.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/block_

[PATCH 09/13] dm: don't return errnos from ->map

2017-05-26 Thread Christoph Hellwig
Instead use the special DM_MAPIO_KILL return value to return -EIO just like we do for the request based path. Note that dm-log-writes returned -ENOMEM in a few places, which now becomes -EIO instead. No consumer treats -ENOMEM special so this shouldn't be an issue (and it should use a mempool to

[PATCH 10/13] dm: change ->end_io calling convention

2017-05-26 Thread Christoph Hellwig
Turn the error paramter into a pointer so that target drivers can change the value, and make sure only DM_ENDIO_* values are returned from the methods. Signed-off-by: Christoph Hellwig --- drivers/md/dm-cache-target.c | 4 ++-- drivers/md/dm-flakey.c| 8 drivers/md/dm-log-wri

[PATCH 08/13] dm mpath: merge do_end_io_bio into multipath_end_io_bio

2017-05-26 Thread Christoph Hellwig
This simplifies the code and especially the error passing a bit and will help with the next patch. Signed-off-by: Christoph Hellwig --- drivers/md/dm-mpath.c | 42 +++--- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/drivers/md/dm-mpath.c b/d

[PATCH 06/13] fs: simplify dio_bio_complete

2017-05-26 Thread Christoph Hellwig
Only read bio->bi_error once in the common path. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- fs/direct-io.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/direct-io.c b/fs/direct-io.c index 04247a6c3f73..bb711e4b86c2 100644 --- a/fs/direct-io.

[PATCH 12/13] blk-mq: switch ->queue_rq return value to blk_status_t

2017-05-26 Thread Christoph Hellwig
Use the same values for use for request completion errors as the return value from ->queue_rq. BLK_STS_RESOURCE is special cased to cause a requeue, and all the others are completed as-is. Signed-off-by: Christoph Hellwig --- block/blk-mq.c| 37 --

[PATCH 04/13] dm: fix REQ_RAHEAD handling

2017-05-26 Thread Christoph Hellwig
A few (but not all) dm targets use a special EWOULDBLOCK error code for failing REQ_RAHEAD requests that fail due to a lack of available resources. But no one else knows about this magic code, and lower level drivers also don't generate it when failing read-ahead requests for similar reasons. So r

[PATCH 05/13] fs: remove the unused error argument to dio_end_io()

2017-05-26 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- fs/btrfs/inode.c | 6 +++--- fs/direct-io.c | 3 +-- include/linux/fs.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 17cbe9306faf..758b2666885e 100644 --- a

dedicated error codes for the block layer V2

2017-05-26 Thread Christoph Hellwig
This series introduces a new blk_status_t error code type for the block layer so that we can have tigher control and explicit semantics for block layer errors. All but the last three patches are cleanups that lead to the new type. The series it mostly limited to the block layer and drivers, and t

[PATCH 03/13] gfs2: remove the unused sd_log_error field

2017-05-26 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- fs/gfs2/incore.h | 1 - fs/gfs2/lops.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index b7cf65d13561..aa3d44527fa2 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/inco

[PATCH 01/13] nvme-lightnvm: use blk_execute_rq in nvme_nvm_submit_user_cmd

2017-05-26 Thread Christoph Hellwig
Instead of reinventing it poorly. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Javier González --- drivers/nvme/host/lightnvm.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightn

[PATCH 02/13] scsi/osd: don't save block errors into req_results

2017-05-26 Thread Christoph Hellwig
We will only have sense data if the command exectured and got a SCSI result, so this is pointless. Signed-off-by: Christoph Hellwig --- drivers/scsi/osd/osd_initiator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_ini

Re: [PATCH 2/3 v2] btrfs: reduce arguments for decompress_bio ops

2017-05-26 Thread Anand Jain
Reviewed-by: Nikolay Borisov Thanks. Anand -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/3 v2] btrfs: reduce arguments for decompress_bio ops

2017-05-26 Thread Nikolay Borisov
On 26.05.2017 10:44, Anand Jain wrote: > struct compressed_bio pointer can be used instead. > > Signed-off-by: Anand Jain > --- > v2: added this patch > fs/btrfs/compression.c | 43 +-- > fs/btrfs/compression.h | 44 ++

Re: [PATCH 1/3 v2] btrfs: btrfs_decompress_bio() could accept compressed_bio instead

2017-05-26 Thread Nikolay Borisov
On 26.05.2017 10:44, Anand Jain wrote: > Instead of sending each argument of struct compressed_bio, send > the compressed_bio itself. > > Also by having struct compressed_bio in btrfs_decompress_bio() > it would help tracing. > > Signed-off-by: Anand Jain > --- > v2: no changes > fs/btrfs/com

Re: [PATCH] btrfs: btrfs_decompress_bio() could accept compressed_bio instead

2017-05-26 Thread Anand Jain
Can you take this idea one notch further and refactor also zlib_decompress_bio and lzo_decompress_bio functions as well? Done. Added in v2. Thanks, Anand -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majo

[PATCH 3/3 v2] btrfs: add compression trace points

2017-05-26 Thread Anand Jain
This patch adds compression and decompression trace points for the purpose of debugging. Signed-off-by: Anand Jain --- v2: no change fs/btrfs/compression.c | 10 ++ include/trace/events/btrfs.h | 36 2 files changed, 46 insertions(+) diff --git

[PATCH 2/3 v2] btrfs: reduce arguments for decompress_bio ops

2017-05-26 Thread Anand Jain
struct compressed_bio pointer can be used instead. Signed-off-by: Anand Jain --- v2: added this patch fs/btrfs/compression.c | 43 +-- fs/btrfs/compression.h | 44 fs/btrfs/lzo.c | 10 +- fs/btrf

[PATCH 1/3 v2] btrfs: btrfs_decompress_bio() could accept compressed_bio instead

2017-05-26 Thread Anand Jain
Instead of sending each argument of struct compressed_bio, send the compressed_bio itself. Also by having struct compressed_bio in btrfs_decompress_bio() it would help tracing. Signed-off-by: Anand Jain --- v2: no changes fs/btrfs/compression.c | 23 +-- 1 file changed, 9 in

[PATCH 0/3 v2] compression ops args clean up and trace point

2017-05-26 Thread Anand Jain
Patch 1 and 2 are preparatory and clean up patches, and patch 3 adds the trace point for the compression. I have used same trace function for both compress and decompress as I wanted to maintain compress and decompress debug data aligned v2: added patch #2 Anand Jain (3): btrfs: btrfs_decompres

Re: [PATCH 1/6] Btrfs: add a helper to retrive extent inline ref type

2017-05-26 Thread Nikolay Borisov
On 26.05.2017 03:26, Liu Bo wrote: > An invalid value of extent inline ref type may be read from a > malicious image which may force btrfs to crash. > > This adds a helper which does sanity check for the ref type, so we can > know if it's sane, return type if so, otherwise return an error. > >