Re: [PATCH 4/4] NFSv4.1 do not release page on commit mismatch

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

 



On May 22, 2012, at 12:24 PM, Myklebust, Trond wrote:

> On Tue, 2012-05-22 at 08:09 -0400, andros@xxxxxxxxxx wrote:
>> From: Andy Adamson <andros@xxxxxxxxxx>
>> 
>> Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
>> ---
>> fs/nfs/write.c |    2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>> 
>> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
>> index e6fe3d6..c7295de 100644
>> --- a/fs/nfs/write.c
>> +++ b/fs/nfs/write.c
>> @@ -1555,6 +1555,8 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)
>> 		/* We have a mismatch. Write the page again */
>> 		dprintk(" mismatch\n");
>> 		nfs_mark_request_dirty(req);
>> +		nfs_unlock_request(req);
>> +		continue;
>> 	next:
>> 		nfs_unlock_and_release_request(req);
>> 	}
> 
> What is this patch trying to fix? As far as I can see it will lead to a
> reference leak.

The release of the page drops the refcount to zero. Since it is a mismatch, we want to continue to use the page, so nfs_page_find_request_locked is called we get the WARNING in kref_get, and an Oops in various places in pnfs_update_layout.

Here is the output of added printk's.

-->Andy

May 21 18:25:33 fedora-64-2 kernel: [  152.988921] NFS:       commit (0:35/2 4096@184320)
May 21 18:25:33 fedora-64-2 kernel: [  152.988923]  mismatch req ffff880042dbb800
May 21 18:25:33 fedora-64-2 kernel: [  152.988927] nfs_release_request WB req ffff880042dbb800 wb_kref 1
May 21 18:25:33 fedora-64-2 kernel: [  152.988932] put_lseg: lseg ffff880042d95380 ref 4 valid 0
May 21 18:25:33 fedora-64-2 kernel: [  152.988945] nfs_page_find_request_locked req ffff88003e033800
May 21 18:25:33 fedora-64-2 kernel: [  152.988949] nfs_page_find_request_locked WB req ffff88003e033800 wb_kref 0
May 21 18:25:33 fedora-64-2 kernel: [  152.988953] ------------[ cut here ]------------
May 21 18:25:33 fedora-64-2 kernel: [  152.989082] WARNING: at include/linux/kref.h:41 kref_get+0x20/0x2c [nfs]()




May 21 18:25:33 fedora-64-2 kernel: [  152.989484] kernel BUG at fs/nfs/pnfs.c:584!
May 21 18:25:33 fedora-64-2 kernel: [  152.989488] invalid opcode: 0000 [#1] SMP
May 21 18:25:33 fedora-64-2 kernel: [  152.989493] CPU 1
May 21 18:25:33 fedora-64-2 kernel: [  152.989495] Modules linked in: nfs_layout_nfsv41_files nfs auth_rpcgss nfs_acl fuse lockd rfcomm bnep ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ip6table_filter ip6_tables snd_ens1371 gameport snd_rawmidi snd_ac97_codec ac97_bus snd_seq snd_seq_device btusb snd_pcm joydev bluetooth rfkill ppdev snd_timer vmw_balloon microcode snd parport_pc parport soundcore snd_page_alloc e1000 i2c_piix4 i2c_core shpchp uinput sunrpc mptspi mptscsih mptbase scsi_transport_spi [last unloaded: scsi_wait_scan]
May 21 18:25:33 fedora-64-2 kernel: [  152.989552]
May 21 18:25:33 fedora-64-2 kernel: [  152.989557] Pid: 1595, comm: flush-0:35 Tainted: G        W    3.4.0-rc7+ #5 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform
May 21 18:25:33 fedora-64-2 kernel: [  152.989566] RIP: 0010:[<ffffffffa02c7377>]  [<ffffffffa02c7377>] pnfs_update_layout+0x460/0x6a6 [nfs]

> 
> -- 
> Trond Myklebust
> Linux NFS client maintainer
> 
> NetApp
> Trond.Myklebust@xxxxxxxxxx
> www.netapp.com
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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 USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux