[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20100923105602.d5425e32.sfr@canb.auug.org.au>
Date: Thu, 23 Sep 2010 10:56:02 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Sage Weil <sage@...dream.net>
Cc: linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
Greg Farnum <gregf@...newdream.net>
Subject: linux-next: manual merge of the ceph tree with Linus' tree
Hi Sage,
Today's linux-next merge of the ceph tree got a conflict in
fs/ceph/mds_client.c between commit
3612abbd5df6baa9ca3e0777c6c8646e202d3f66 ("ceph: fix reconnect encoding
for old servers") from Linus' tree and commit
20d5970378f075f8f567b92bd2c16373fbe09b72 ("ceph: preallocate flock state
without locks held") from the ceph tree.
I fixed it up (I think - see below) and can carry the fix for a while.
--
Cheers,
Stephen Rothwell sfr@...b.auug.org.au
diff --cc fs/ceph/mds_client.c
index fad95f8,9c648ed..0000000
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@@ -2361,21 -2365,35 +2365,37 @@@ static int encode_caps_cb(struct inode
if (recon_state->flock) {
int num_fcntl_locks, num_flock_locks;
-
- lock_kernel();
- ceph_count_locks(inode, &num_fcntl_locks, &num_flock_locks);
- rec.v2.flock_len = (2*sizeof(u32) +
- (num_fcntl_locks+num_flock_locks) *
- sizeof(struct ceph_filelock));
-
- err = ceph_pagelist_append(pagelist, &rec, reclen);
- if (!err)
- err = ceph_encode_locks(inode, pagelist,
- num_fcntl_locks,
- num_flock_locks);
- unlock_kernel();
+ struct ceph_pagelist_cursor trunc_point;
+
+ ceph_pagelist_set_cursor(pagelist, &trunc_point);
+ do {
+ lock_kernel();
+ ceph_count_locks(inode, &num_fcntl_locks,
+ &num_flock_locks);
+ rec.v2.flock_len = (2*sizeof(u32) +
+ (num_fcntl_locks+num_flock_locks) *
+ sizeof(struct ceph_filelock));
+ unlock_kernel();
+
+ /* pre-alloc pagelist */
+ ceph_pagelist_truncate(pagelist, &trunc_point);
+ err = ceph_pagelist_append(pagelist, &rec, reclen);
+ if (!err)
+ err = ceph_pagelist_reserve(pagelist,
+ rec.v2.flock_len);
+
+ /* encode locks */
+ if (!err) {
+ lock_kernel();
+ err = ceph_encode_locks(inode,
+ pagelist,
+ num_fcntl_locks,
+ num_flock_locks);
+ unlock_kernel();
+ }
+ } while (err == -ENOSPC);
+ } else {
+ err = ceph_pagelist_append(pagelist, &rec, reclen);
}
out_free:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists