From patchwork Tue Aug 16 03:59:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Merillat X-Patchwork-Id: 1070222 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7G40ReR001384 for ; Tue, 16 Aug 2011 04:00:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753007Ab1HPD7w (ORCPT ); Mon, 15 Aug 2011 23:59:52 -0400 Received: from mail-pz0-f42.google.com ([209.85.210.42]:45439 "EHLO mail-pz0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752581Ab1HPD7v (ORCPT ); Mon, 15 Aug 2011 23:59:51 -0400 Received: by pzk37 with SMTP id 37so3976048pzk.1 for ; Mon, 15 Aug 2011 20:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=6Wl2i3LlqOCTHmhEx+6ZaKkiB9G2vE4vLV/5nkmYBaQ=; b=SWFZKCXPfYEqAWsKT9ttRNBM76Kj7MILxOESUzIvf6vImfh4L276f6gonyH7MctWuB ixqjYKsHgFXEBHgzk+G9c0wrl4sd/KBC6fL+2YYQc/+Unr5MJlSjuS0K8l6hVFbN27Gr jc1OeSOa0KUurrAahTXiwrseK2bHyFUADDkgk= MIME-Version: 1.0 Received: by 10.142.128.21 with SMTP id a21mr2214943wfd.371.1313467190893; Mon, 15 Aug 2011 20:59:50 -0700 (PDT) Received: by 10.142.203.12 with HTTP; Mon, 15 Aug 2011 20:59:50 -0700 (PDT) Date: Mon, 15 Aug 2011 23:59:50 -0400 Message-ID: Subject: processes stuck in llseek From: Dan Merillat To: Linux Kernel Mailing List , BTRFS Mailing list Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 16 Aug 2011 04:00:27 +0000 (UTC) I noticed a series of hung_task notifications in dmesg, so I went poking at it. Process is 'dropbox', and it's stuck trying to llseek it's library.zip file. strace of dropbox: ... stat("/home/x/.dropbox-dist/library.zip", {st_mode=S_IFREG|0755, st_size=11575179, ...}) = 0 open("/home/x/.dropbox-dist/library.zip", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=11575179, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa766ea8000 fstat(3, {st_mode=S_IFREG|0755, st_size=11575179, ...}) = 0 lseek(3, 11571200, SEEK_SET SEEK_SET is less than st_size strace of dd if=library.zip of=/dev/null bs=1 seek=11571200: open("library.zip", O_RDONLY) = 3 dup2(3, 0) = 0 close(3) = 0 lseek(0, 0, SEEK_CUR [72960.716080] INFO: task dropbox:1348 blocked for more than 120 seconds. [72960.716084] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [72960.716087] dropbox D ffff8800762d8a78 0 1348 1 0x00000004 [72960.716092] ffff880069cede18 0000000000000086 0000000000096000 0000000000000000 [72960.716097] ffff880069cec000 00000000000119c0 ffff8800762d8700 00000000000119c0 [72960.716101] ffff880069cedfd8 0000000000004000 ffff880069cedfd8 00000000000119c0 [72960.716106] Call Trace: [72960.716113] [] ? trace_hardirqs_on_thunk+0x3a/0x3c [72960.716119] [] ? retint_restore_args+0xe/0xe [72960.716124] [] ? noop_llseek+0xa/0xa [72960.716129] [] ? mutex_spin_on_owner+0x1c/0x45 [72960.716133] [] __mutex_lock_slowpath+0xd2/0x116 [72960.716137] [] ? do_page_fault+0x374/0x3e6 [72960.716140] [] mutex_lock+0x16/0x27 [72960.716146] [] btrfs_file_llseek+0x38/0x297 [72960.716150] [] ? trace_hardirqs_off_thunk+0x3a/0x6c [72960.716153] [] vfs_llseek+0x2e/0x30 [72960.716155] [] sys_lseek+0x3e/0x5d [72960.716159] [] system_call_fastpath+0x16/0x1b Oddly enough, it's just llseek. I can copy/read the file sequentially just fine, but llseek fails on a copy as well. Once I get physically to the system I'll recompile to an unmodified kernel and try again. Other files of the same approximate age llseek correctly. Kernel is 3.1-rc1 with the fglrx module from AMD and the following patch: (I was playing with cross-subvolume reflinking, but not on this file) ret = -ENOMEM; @@ -2246,13 +2246,13 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, * note the key will change type as we walk through the * tree. */ - ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); + ret = btrfs_search_slot(NULL, BTRFS_I(src)->root, &key, path, 0, 0); if (ret < 0) goto out; nritems = btrfs_header_nritems(path->nodes[0]); if (path->slots[0] >= nritems) { - ret = btrfs_next_leaf(root, path); + ret = btrfs_next_leaf(BTRFS_I(src)->root, path); if (ret < 0) goto out; if (ret > 0) @@ -2313,7 +2313,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, else new_key.offset = destoff; - trans = btrfs_start_transaction(root, 1); + trans = btrfs_start_transaction(root, 3); if (IS_ERR(trans)) { ret = PTR_ERR(trans); goto out; --- 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-info.html diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7cf0133..a13b5e2 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2182,7 +2182,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, goto out_fput; ret = -EXDEV; - if (src->i_sb != inode->i_sb || BTRFS_I(src)->root != root) + if (src->i_sb != inode->i_sb) goto out_fput;