Skip to content

Commit 1ca0f93

Browse files
committed
Merge tag 'nfsd-6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fixes from Chuck Lever: - v6.15 libcrc clean-up makes invalid configurations possible - Fix a potential deadlock introduced during the v6.15 merge window * tag 'nfsd-6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: decrease sc_count directly if fail to queue dl_recall nfs: add missing selections of CONFIG_CRC32
2 parents 0bd2f26 + a1d14d9 commit 1ca0f93

File tree

8 files changed

+4
-27
lines changed

8 files changed

+4
-27
lines changed

fs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ config GRACE_PERIOD
368368
config LOCKD
369369
tristate
370370
depends on FILE_LOCKING
371+
select CRC32
371372
select GRACE_PERIOD
372373

373374
config LOCKD_V4

fs/nfs/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config NFS_FS
33
tristate "NFS client support"
44
depends on INET && FILE_LOCKING && MULTIUSER
5+
select CRC32
56
select LOCKD
67
select SUNRPC
78
select NFS_COMMON
@@ -196,7 +197,6 @@ config NFS_USE_KERNEL_DNS
196197
config NFS_DEBUG
197198
bool
198199
depends on NFS_FS && SUNRPC_DEBUG
199-
select CRC32
200200
default y
201201

202202
config NFS_DISABLE_UDP_SUPPORT

fs/nfs/internal.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -899,18 +899,11 @@ u64 nfs_timespec_to_change_attr(const struct timespec64 *ts)
899899
return ((u64)ts->tv_sec << 30) + ts->tv_nsec;
900900
}
901901

902-
#ifdef CONFIG_CRC32
903902
static inline u32 nfs_stateid_hash(const nfs4_stateid *stateid)
904903
{
905904
return ~crc32_le(0xFFFFFFFF, &stateid->other[0],
906905
NFS4_STATEID_OTHER_SIZE);
907906
}
908-
#else
909-
static inline u32 nfs_stateid_hash(nfs4_stateid *stateid)
910-
{
911-
return 0;
912-
}
913-
#endif
914907

915908
static inline bool nfs_current_task_exiting(void)
916909
{

fs/nfs/nfs4session.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,12 @@ static inline void nfs4_copy_sessionid(struct nfs4_sessionid *dst,
148148
memcpy(dst->data, src->data, NFS4_MAX_SESSIONID_LEN);
149149
}
150150

151-
#ifdef CONFIG_CRC32
152151
/*
153152
* nfs_session_id_hash - calculate the crc32 hash for the session id
154153
* @session - pointer to session
155154
*/
156155
#define nfs_session_id_hash(sess_id) \
157156
(~crc32_le(0xFFFFFFFF, &(sess_id)->data[0], sizeof((sess_id)->data)))
158-
#else
159-
#define nfs_session_id_hash(session) (0)
160-
#endif
161157
#else /* defined(CONFIG_NFS_V4_1) */
162158

163159
static inline int nfs4_init_session(struct nfs_client *clp)

fs/nfsd/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config NFSD
44
depends on INET
55
depends on FILE_LOCKING
66
depends on FSNOTIFY
7+
select CRC32
78
select LOCKD
89
select SUNRPC
910
select EXPORTFS

fs/nfsd/nfs4state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5430,7 +5430,7 @@ static void nfsd_break_one_deleg(struct nfs4_delegation *dp)
54305430
queued = nfsd4_run_cb(&dp->dl_recall);
54315431
WARN_ON_ONCE(!queued);
54325432
if (!queued)
5433-
nfs4_put_stid(&dp->dl_stid);
5433+
refcount_dec(&dp->dl_stid.sc_count);
54345434
}
54355435

54365436
/* Called from break_lease() with flc_lock held. */

fs/nfsd/nfsfh.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ static inline bool fh_fsid_match(const struct knfsd_fh *fh1,
267267
return true;
268268
}
269269

270-
#ifdef CONFIG_CRC32
271270
/**
272271
* knfsd_fh_hash - calculate the crc32 hash for the filehandle
273272
* @fh - pointer to filehandle
@@ -279,12 +278,6 @@ static inline u32 knfsd_fh_hash(const struct knfsd_fh *fh)
279278
{
280279
return ~crc32_le(0xFFFFFFFF, fh->fh_raw, fh->fh_size);
281280
}
282-
#else
283-
static inline u32 knfsd_fh_hash(const struct knfsd_fh *fh)
284-
{
285-
return 0;
286-
}
287-
#endif
288281

289282
/**
290283
* fh_clear_pre_post_attrs - Reset pre/post attributes

include/linux/nfs.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ enum nfs3_stable_how {
5555
NFS_INVALID_STABLE_HOW = -1
5656
};
5757

58-
#ifdef CONFIG_CRC32
5958
/**
6059
* nfs_fhandle_hash - calculate the crc32 hash for the filehandle
6160
* @fh - pointer to filehandle
@@ -67,10 +66,4 @@ static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh)
6766
{
6867
return ~crc32_le(0xFFFFFFFF, &fh->data[0], fh->size);
6968
}
70-
#else /* CONFIG_CRC32 */
71-
static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh)
72-
{
73-
return 0;
74-
}
75-
#endif /* CONFIG_CRC32 */
7669
#endif /* _LINUX_NFS_H */

0 commit comments

Comments
 (0)